public abstract class AbstractScheduledEventExecutor extends AbstractEventExecutor
EventExecutor
s that want to support scheduling.Modifier and Type | Field and Description |
---|---|
(package private) java.util.Queue<ScheduledFutureTask<?>> |
scheduledTaskQueue |
Constructor and Description |
---|
AbstractScheduledEventExecutor() |
Modifier and Type | Method and Description |
---|---|
protected void |
cancelScheduledTasks()
Cancel all scheduled tasks.
|
protected boolean |
hasScheduledTasks()
Returns
true if a scheduled task is ready for processing. |
private static boolean |
isNullOrEmpty(java.util.Queue<ScheduledFutureTask<?>> queue) |
protected static long |
nanoTime() |
protected long |
nextScheduledTaskNano()
Return the nanoseconds when the next scheduled task is ready to be run or
-1 if no task is scheduled. |
(package private) ScheduledFutureTask<?> |
peekScheduledTask() |
protected java.lang.Runnable |
pollScheduledTask() |
protected java.lang.Runnable |
pollScheduledTask(long nanoTime)
Return the
Runnable which is ready to be executed with the given nanoTime . |
(package private) void |
removeScheduled(ScheduledFutureTask<?> task) |
<V> ScheduledFuture<V> |
schedule(java.util.concurrent.Callable<V> callable,
long delay,
java.util.concurrent.TimeUnit unit) |
ScheduledFuture<?> |
schedule(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit) |
(package private) <V> ScheduledFuture<V> |
schedule(ScheduledFutureTask<V> task) |
ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit) |
(package private) java.util.Queue<ScheduledFutureTask<?>> |
scheduledTaskQueue() |
ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit) |
inEventLoop, iterator, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, next, shutdown, shutdownGracefully, shutdownNow, submit, submit, submit
invokeAll, invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
inEventLoop, parent
isShuttingDown, shutdownGracefully, terminationFuture
java.util.Queue<ScheduledFutureTask<?>> scheduledTaskQueue
protected static long nanoTime()
java.util.Queue<ScheduledFutureTask<?>> scheduledTaskQueue()
private static boolean isNullOrEmpty(java.util.Queue<ScheduledFutureTask<?>> queue)
protected void cancelScheduledTasks()
AbstractEventExecutor.inEventLoop()
is true
.protected final java.lang.Runnable pollScheduledTask()
#pollScheduledTask(long)}
protected final java.lang.Runnable pollScheduledTask(long nanoTime)
Runnable
which is ready to be executed with the given nanoTime
.
You should use nanoTime()
to retrieve the the correct nanoTime
.protected final long nextScheduledTaskNano()
-1
if no task is scheduled.final ScheduledFutureTask<?> peekScheduledTask()
protected final boolean hasScheduledTasks()
true
if a scheduled task is ready for processing.public ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface EventExecutorGroup
schedule
in interface java.util.concurrent.ScheduledExecutorService
schedule
in class AbstractEventExecutor
public <V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface EventExecutorGroup
schedule
in interface java.util.concurrent.ScheduledExecutorService
schedule
in class AbstractEventExecutor
public ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate
in interface EventExecutorGroup
scheduleAtFixedRate
in interface java.util.concurrent.ScheduledExecutorService
scheduleAtFixedRate
in class AbstractEventExecutor
public ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay
in interface EventExecutorGroup
scheduleWithFixedDelay
in interface java.util.concurrent.ScheduledExecutorService
scheduleWithFixedDelay
in class AbstractEventExecutor
<V> ScheduledFuture<V> schedule(ScheduledFutureTask<V> task)
final void removeScheduled(ScheduledFutureTask<?> task)