Class AppDaemonService
- java.lang.Object
-
- fr.paris.lutece.portal.service.daemon.AppDaemonService
-
public final class AppDaemonService extends java.lang.Objectthis class provides methods to manage daemons services
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DaemongetDaemon(java.lang.String strDaemonKey)Gets a daemon object from its key namestatic java.util.Collection<DaemonEntry>getDaemonEntries()Get the current known DaemonEntries within the DaemonFactorystatic voidinit()Performs initialization of the DaemonFactory.static voidmodifyDaemonInterval(java.lang.String strDaemonKey, java.lang.String strDaemonInterval)modify daemon intervalstatic voidregisterDaemon(DaemonEntry entry)Register a daemon by its entrystatic voidshutdown()Performs the shutdown of the DaemonFactory.static booleansignalDaemon(java.lang.String strDaemonKey)Signal a daemon for execution in the immediate future.static booleansignalDaemon(java.lang.String strDaemonKey, long nDelay, java.util.concurrent.TimeUnit unit)Signal a daemon for execution in the immediate future.static voidstartDaemon(java.lang.String strDaemonKey)Starts a daemonstatic voidstopDaemon(java.lang.String strDaemonKey)Stops a daemonstatic voidunregisterDaemon(java.lang.String strDaemonKey)Unregister a daemon
-
-
-
Method Detail
-
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
public static void registerDaemon(DaemonEntry entry) throws LuteceInitException
Register a daemon by its entry- Parameters:
entry- The daemon entry- Throws:
LuteceInitException- If an error occurred
-
unregisterDaemon
public static void unregisterDaemon(java.lang.String strDaemonKey)
Unregister a daemon- Parameters:
strDaemonKey- The daemon key
-
startDaemon
public static void startDaemon(java.lang.String strDaemonKey)
Starts a daemon- Parameters:
strDaemonKey- The daemon key
-
stopDaemon
public static void stopDaemon(java.lang.String strDaemonKey)
Stops a daemon- Parameters:
strDaemonKey- The daemon key
-
signalDaemon
public static boolean signalDaemon(java.lang.String strDaemonKey)
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
public static boolean signalDaemon(java.lang.String strDaemonKey, long nDelay, java.util.concurrent.TimeUnit unit)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
public static void modifyDaemonInterval(java.lang.String strDaemonKey, java.lang.String strDaemonInterval)modify daemon interval- Parameters:
strDaemonKey- The daemon keystrDaemonInterval- the daemon interval
-
getDaemonEntries
public static java.util.Collection<DaemonEntry> 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
public static Daemon getDaemon(java.lang.String strDaemonKey)
Gets a daemon object from its key name- Parameters:
strDaemonKey- The daemon key- Returns:
- The daemon
-
-