public class TimerScheduler extends AbstractLifeCycle implements Scheduler, java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
private static class |
TimerScheduler.SimpleTask |
AbstractLifeCycle.AbstractLifeCycleListener
Scheduler.Task
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
private boolean |
_daemon |
private java.lang.String |
_name |
private java.util.Timer |
_timer |
private static Logger |
LOG |
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING
Constructor and Description |
---|
TimerScheduler() |
TimerScheduler(java.lang.String name,
boolean daemon) |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
void |
run() |
Scheduler.Task |
schedule(java.lang.Runnable task,
long delay,
java.util.concurrent.TimeUnit units) |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stop
private static final Logger LOG
private final java.lang.String _name
private final boolean _daemon
private java.util.Timer _timer
public TimerScheduler()
public TimerScheduler(java.lang.String name, boolean daemon)
protected void doStart() throws java.lang.Exception
doStart
in class AbstractLifeCycle
java.lang.Exception
protected void doStop() throws java.lang.Exception
doStop
in class AbstractLifeCycle
java.lang.Exception
public Scheduler.Task schedule(java.lang.Runnable task, long delay, java.util.concurrent.TimeUnit units)
public void run()
run
in interface java.lang.Runnable