EventExecutor
s that want to support scheduling.
Modifier and Type | Field and Description |
---|---|
pack-priv long | |
private static final Comparator | |
pack-priv PriorityQueue | |
private static final long | |
pack-priv static final Runnable |
Access | Constructor and Description |
---|---|
protected | |
protected |
Modifier and Type | Method and Description |
---|---|
protected boolean | afterScheduledTaskSubmitted(long deadlineNanos)
|
protected boolean | beforeScheduledTaskSubmitted(long
deadline of the to-be-scheduled task
relative to deadlineNanos)AbstractScheduledEventExecutor#getCurrentTimeNanos() Called from arbitrary non- |
protected void | |
pack-priv static long | |
protected static long | Returns: the number of nano seconds from nowdeadlineNanos would expire.An arbitrary deadline in nano seconds. deadlineNanos)Given an arbitrary deadline |
pack-priv static long | |
protected long | |
protected final boolean | |
protected static long | Returns: initial value used for delay and computations based upon a monatomic time source.The initial value used for delay and computations based upon a monatomic time source. |
private static boolean | |
protected static long | |
protected final long | nextScheduledTaskDeadlineNanos()
Return the deadline (in nanoseconds) when the next scheduled task is ready to be run or |
protected final long | nextScheduledTaskNano()
Return the nanoseconds until the next scheduled task is ready to be run or |
pack-priv final ScheduledFutureTask | |
protected final Runnable | |
protected final Runnable | pollScheduledTask(long nanoTime)
Return the |
pack-priv final void | |
public ScheduledFuture | schedule(Runnable
the task to execute command, long the time from now to delay execution delay, TimeUnit the time unit of the delay parameter unit)Overrides io. Implements io. |
public <V> ScheduledFuture | schedule(Callable<V>
the function to execute callable, long the time from now to delay execution delay, TimeUnit the time unit of the delay parameter unit)Overrides io. Implements io. |
private <V> ScheduledFuture | |
public ScheduledFuture | scheduleAtFixedRate(Runnable
the task to execute command, long the time to delay first execution initialDelay, long the period between successive executions period, TimeUnit the time unit of the initialDelay and period parameters unit)Overrides io. Implements io. initialDelay , then initialDelay + period , then
initialDelay + 2 * period , and so on.
|
pack-priv PriorityQueue | |
pack-priv final void | |
public ScheduledFuture | scheduleWithFixedDelay(Runnable
the task to execute command, long the time to delay first execution initialDelay, long the delay between the termination of one
execution and the commencement of the next delay, TimeUnit the time unit of the initialDelay and delay parameters unit)Overrides io. Implements io. |
protected void | validateScheduled(long amount, TimeUnit unit)
Deprecated
will be removed in the future.
Sub-classes may override this to restrict the maximal amount of time someone can use to schedule a task.
|
private void |
nextTaskId | back to summary |
---|---|
pack-priv long nextTaskId |
SCHEDULED_FUTURE_TASK_COMPARATOR | back to summary |
---|---|
private static final Comparator<ScheduledFutureTask<?>> SCHEDULED_FUTURE_TASK_COMPARATOR |
scheduledTaskQueue | back to summary |
---|---|
pack-priv PriorityQueue<ScheduledFutureTask<?>> scheduledTaskQueue |
START_TIME | back to summary |
---|---|
private static final long START_TIME |
WAKEUP_TASK | back to summary |
---|---|
pack-priv static final Runnable WAKEUP_TASK |
AbstractScheduledEventExecutor | back to summary |
---|---|
protected AbstractScheduledEventExecutor() |
AbstractScheduledEventExecutor | back to summary |
---|---|
protected AbstractScheduledEventExecutor(EventExecutorGroup parent) |
afterScheduledTaskSubmitted | back to summary |
---|---|
protected boolean afterScheduledTaskSubmitted(long deadlineNanos) See
|
beforeScheduledTaskSubmitted | back to summary |
---|---|
protected boolean beforeScheduledTaskSubmitted(long deadlineNanos) Called from arbitrary non-
If
|
cancelScheduledTasks | back to summary |
---|---|
protected void cancelScheduledTasks() Cancel all scheduled tasks.
This method MUST be called only when |
deadlineNanos | back to summary |
---|---|
pack-priv static long deadlineNanos(long nanoTime, long delay) |
deadlineToDelayNanos | back to summary |
---|---|
protected static long deadlineToDelayNanos(long deadlineNanos) Given an arbitrary deadline
|
defaultCurrentTimeNanos | back to summary |
---|---|
pack-priv static long defaultCurrentTimeNanos() |
getCurrentTimeNanos | back to summary |
---|---|
protected long getCurrentTimeNanos() Get the current time in nanoseconds by this executor's clock. This is not the same as
|
hasScheduledTasks | back to summary |
---|---|
protected final boolean hasScheduledTasks() Returns |
initialNanoTime | back to summary |
---|---|
protected static long initialNanoTime() The initial value used for delay and computations based upon a monatomic time source.
|
isNullOrEmpty | back to summary |
---|---|
private static boolean isNullOrEmpty(Queue<ScheduledFutureTask<?>> queue) |
nanoTime | back to summary |
---|---|
protected static long nanoTime()
Deprecated Use the non-static
|
nextScheduledTaskDeadlineNanos | back to summary |
---|---|
protected final long nextScheduledTaskDeadlineNanos() Return the deadline (in nanoseconds) when the next scheduled task is ready to be run or |
nextScheduledTaskNano | back to summary |
---|---|
protected final long nextScheduledTaskNano() Return the nanoseconds until the next scheduled task is ready to be run or |
peekScheduledTask | back to summary |
---|---|
pack-priv final ScheduledFutureTask |
pollScheduledTask | back to summary |
---|---|
protected final Runnable pollScheduledTask()
|
pollScheduledTask | back to summary |
---|---|
protected final Runnable pollScheduledTask(long nanoTime) Return the |
removeScheduled | back to summary |
---|---|
pack-priv final void removeScheduled(final ScheduledFutureTask<?> task) |
schedule | back to summary |
---|---|
public ScheduledFuture Overrides io. Implements io. Doc from java. Submits a one-shot task that becomes enabled after the given delay.
|
schedule | back to summary |
---|---|
public <V> ScheduledFuture Overrides io. Implements io. Doc from java. Submits a value-returning one-shot task that becomes enabled after the given delay.
|
schedule | back to summary |
---|---|
private <V> ScheduledFuture |
scheduleAtFixedRate | back to summary |
---|---|
public ScheduledFuture Overrides io. Implements io. Doc from java. Submits a periodic action that becomes enabled first after the
given initial delay, and subsequently with the given period;
that is, executions will commence after
The sequence of task executions continues indefinitely until one of the following exceptional completions occur:
isDone() on the returned future will
return true .
If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
|
scheduledTaskQueue | back to summary |
---|---|
pack-priv PriorityQueue |
scheduleFromEventLoop | back to summary |
---|---|
pack-priv final void scheduleFromEventLoop(final ScheduledFutureTask<?> task) |
scheduleWithFixedDelay | back to summary |
---|---|
public ScheduledFuture Overrides io. Implements io. Doc from java. Submits a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next. The sequence of task executions continues indefinitely until one of the following exceptional completions occur:
isDone() on the returned future will
return true .
|
validateScheduled | back to summary |
---|---|
protected void validateScheduled(long amount, TimeUnit unit)
Deprecated will be removed in the future. Sub-classes may override this to restrict the maximal amount of time someone can use to schedule a task.
|
validateScheduled0 | back to summary |
---|---|
private void validateScheduled0(long amount, TimeUnit unit)
|