public final class Para extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addDestroyListener(DestroyListener dl)
Registers a new destruction listener.
|
static void |
addInitListener(InitializeListener il)
Registers a new initialization listener.
|
static void |
addIOListener(IOListener iol)
Registers a new Para I/O listener.
|
static void |
addSearchQueryListener(IOListener iol)
Registers a new Para I/O listener for listening to search queries.
|
static void |
asyncExecute(Runnable runnable)
Executes a
Runnable asynchronously. |
static ScheduledFuture<?> |
asyncExecutePeriodically(Runnable task,
long delay,
long interval,
TimeUnit t)
Executes a
Runnable at a fixed interval, asynchronously. |
static void |
destroy()
Calls all registered listeners on exit.
|
static Cache |
getCache() |
static List<CustomResourceHandler> |
getCustomResourceHandlers()
Try loading external
CustomResourceHandler classes. |
static DAO |
getDAO() |
static ExecutorService |
getExecutorService()
Returns the Para executor service.
|
static Set<IOListener> |
getIOListeners()
Returns a list of I/O listeners (callbacks).
|
static ClassLoader |
getParaClassLoader()
Returns the
URLClassLoader classloader for Para. |
static Queue |
getQueue() |
static ScheduledExecutorService |
getScheduledExecutorService()
Returns the Para scheduled executor service.
|
static Search |
getSearch() |
static Set<IOListener> |
getSearchQueryListeners()
Returns a list of I/O listeners for search queries.
|
static String |
getVersion()
The current version of Para.
|
static void |
initialize()
Executes all initialize listeners and prints logo.
|
static Map<String,String> |
newApp(String appid,
String name,
boolean sharedTable,
boolean sharedIndex)
Creates a new application and returns the credentials for it.
|
static void |
printLogo()
Prints the Para logo to System.out.
|
static Map<String,String> |
setup()
Creates the root application and returns the credentials for it.
|
public static final String LOGO
public static void initialize()
public static void destroy()
public static Search getSearch()
Searchpublic static Cache getCache()
Cachepublic static Queue getQueue()
Queuepublic static void addInitListener(InitializeListener il)
il - the listenerpublic static void addDestroyListener(DestroyListener dl)
dl - the listenerpublic static void addIOListener(IOListener iol)
iol - the listenerpublic static Set<IOListener> getIOListeners()
public static void addSearchQueryListener(IOListener iol)
iol - the listenerpublic static Set<IOListener> getSearchQueryListeners()
public static ExecutorService getExecutorService()
public static ScheduledExecutorService getScheduledExecutorService()
public static void asyncExecute(Runnable runnable)
Runnable asynchronously.runnable - a taskpublic static ScheduledFuture<?> asyncExecutePeriodically(Runnable task, long delay, long interval, TimeUnit t)
Runnable at a fixed interval, asynchronously.task - a taskdelay - run afterinterval - run at this interval of timet - time unitpublic static List<CustomResourceHandler> getCustomResourceHandlers()
CustomResourceHandler classes.
These will handle custom API requests.
via ServiceLoader.load(java.lang.Class).public static ClassLoader getParaClassLoader()
URLClassLoader classloader for Para.
Used for loading JAR files from 'lib/*.jar'.public static Map<String,String> setup()
public static Map<String,String> newApp(String appid, String name, boolean sharedTable, boolean sharedIndex)
appid - the app identifiername - the full name of the appsharedTable - false if the app should have its own tablesharedIndex - false if the app should have its own indexpublic static void printLogo()
public static String getVersion()
Copyright © 2019 Erudika. All rights reserved.