public abstract class GuiceRecurringDaemon extends GuiceDaemon
| Modifier | Constructor and Description |
|---|---|
protected |
GuiceRecurringDaemon(boolean daemonThread,
Timeout sleepTime)
Creates a new Daemon; the Daemon will start once the guice object is fully constructed
|
protected |
GuiceRecurringDaemon(Timeout sleepTime)
Creates a new Daemon; the Daemon will start once the guice object is fully constructed
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
execute()
Run one iteration of the daemon
|
protected void |
executeException(java.lang.Throwable t)
Called when the
execute() method throws an exception. |
void |
postConstruct()
Called after Guice has fully and successfully constructed this object
|
void |
run() |
shouldStartAsDaemon, shutdown, sleep, sleepinterrupt, isRunning, isThreadRunning, startThread, startThread, stopAll, stopThread, waitForTermination, waitForTerminationprotected Timeout sleepTime
protected GuiceRecurringDaemon(Timeout sleepTime)
sleepTime - the amount of time to sleep between calls to the execute() methodprotected GuiceRecurringDaemon(boolean daemonThread,
Timeout sleepTime)
daemonThread - true if the thread should be started as a daemon thread, otherwise falsesleepTime - the amount of time to sleep between calls to the execute() methodpublic void run()
protected void executeException(java.lang.Throwable t)
Called when the execute() method throws an exception. This method can be overridden by subclasses to record
exception details or to take remedial action. By default it will log the exception at the ERROR level.
Note: Any exception thrown by this method will cause the thread to terminate
t - the exception that was caughtprotected abstract void execute()
throws java.lang.Exception
java.lang.Exception - if an exception occurs (the exception will be passed to executeException(Throwable) but otherwise ignored)public void postConstruct()
GuiceLifecycleListenerpostConstruct in interface GuiceLifecycleListenerpostConstruct in class GuiceDaemonCopyright © 2014. All Rights Reserved.