Class AppDaemonService
java.lang.Object
fr.paris.lutece.portal.service.daemon.AppDaemonService
this class provides methods to manage daemons services
-
Method Summary
Modifier and TypeMethodDescriptionstatic DaemonGets a daemon object from its key namestatic Collection<DaemonEntry>Get the current known DaemonEntries within the DaemonFactorystatic voidinit()Performs initialization of the DaemonFactory.static voidmodifyDaemonInterval(String strDaemonKey, String strDaemonInterval) modify daemon intervalstatic voidregisterDaemon(DaemonEntry entry) Register a daemon by its entrystatic voidshutdown()Performs the shutdown of the DaemonFactory.static booleansignalDaemon(String strDaemonKey) Signal a daemon for execution in the immediate future.static booleansignalDaemon(String strDaemonKey, long nDelay, TimeUnit unit) Signal a daemon for execution in the immediate future.static voidstartDaemon(String strDaemonKey) Starts a daemonstatic voidstopDaemon(String strDaemonKey) Stops a daemonstatic voidunregisterDaemon(String strDaemonKey) Unregister a daemon
-
Method Details
-
init
public static void init()Performs initialization of the DaemonFactory. Note that this should return right away so that processing can continue (IE thread off everything)- Throws:
LuteceInitException- If an error occurred
-
registerDaemon
Register a daemon by its entry- Parameters:
entry- The daemon entry- Throws:
LuteceInitException- If an error occurred
-
unregisterDaemon
Unregister a daemon- Parameters:
strDaemonKey- The daemon key
-
startDaemon
Starts a daemon- Parameters:
strDaemonKey- The daemon key
-
stopDaemon
Stops a daemon- Parameters:
strDaemonKey- The daemon key
-
signalDaemon
Signal a daemon for execution in the immediate future.This can fail is resources are limited, which should be exceptional.
- Parameters:
strDaemonKey- the daemon key- Returns:
trueif the daemon was successfully signaled,falseotherwise- Since:
- 6.0.0
-
signalDaemon
Signal a daemon for execution in the immediate future.This can fail is resources are limited, which should be exceptional.
- Parameters:
strDaemonKey- the daemon keynDelay- the delay before executionunit- the unit ofnDelayargument- Returns:
trueif the daemon was successfully signaled,falseotherwise- Since:
- 6.0.0
-
modifyDaemonInterval
modify daemon interval- Parameters:
strDaemonKey- The daemon keystrDaemonInterval- the daemon interval
-
getDaemonEntries
Get the current known DaemonEntries within the DaemonFactory- Returns:
- the entries list of daemons declaration
-
shutdown
public static void shutdown()Performs the shutdown of the DaemonFactory. -
getDaemon
Gets a daemon object from its key name- Parameters:
strDaemonKey- The daemon key- Returns:
- The daemon
-