public class ScheduledExecutorScheduler extends AbstractLifeCycle implements Scheduler
Scheduler based on JDK's ScheduledThreadPoolExecutor.
While use of ScheduledThreadPoolExecutor creates futures that will not be used,
it has the advantage of allowing to set a property to remove cancelled tasks from its
queue even if the task did not fire, which provides a huge benefit in the performance
of garbage collection in young generation.AbstractLifeCycle.AbstractLifeCycleListenerScheduler.TaskLifeCycle.Listener| Constructor and Description |
|---|
ScheduledExecutorScheduler() |
ScheduledExecutorScheduler(String name,
boolean daemon) |
ScheduledExecutorScheduler(String name,
boolean daemon,
ClassLoader threadFactoryClassLoader) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart() |
protected void |
doStop() |
Scheduler.Task |
schedule(Runnable task,
long delay,
TimeUnit unit) |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic ScheduledExecutorScheduler()
public ScheduledExecutorScheduler(String name, boolean daemon)
public ScheduledExecutorScheduler(String name, boolean daemon, ClassLoader threadFactoryClassLoader)
protected void doStart()
throws Exception
doStart in class AbstractLifeCycleExceptionprotected void doStop()
throws Exception
doStop in class AbstractLifeCycleExceptionpublic Scheduler.Task schedule(Runnable task, long delay, TimeUnit unit)
Copyright © 1995-2015 Webtide. All Rights Reserved.