EventExecutorGroup which will preserve Runnable execution order but makes no guarantees about what
EventExecutor (and therefore Thread) will be used to execute the Runnables.
The EventExecutorGroup#next() for the wrapped EventExecutorGroup must NOT return
executors of type OrderedEventExecutor.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final EventExecutorGroup | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | NonStickyEventExecutorGroup(EventExecutorGroup group, int maxTaskExecutePerRun)
Creates a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | awaitTermination(long
The non-negative maximum amount of time to wait for the executor group to terminate. timeout, TimeUnit The non-null time unit of the timeout. unit)Overrides default io. EventExecutorGroup to terminate, up to the given timeout.
|
| public void | execute(Runnable
the runnable task task)Overrides default io. |
| public boolean | isShutdown()
Implements io. true if all EventExecutors managed by this EventExecutorGroup have been
shut down gracefully and moved past the grace period so that they are no
longer accepting any new tasks.
|
| public boolean | isShuttingDown()
Implements io. true if and only if all EventExecutors managed by this EventExecutorGroup
are being shut down gracefully or was shut down.
|
| public boolean | isTerminated()
Overrides default io. true if all EventExecutors managed by this EventExecutorGroup are
shut down, and all of their tasks have completed.
|
| public Iterator | iterator()
Implements io. T.
|
| private NonStickyEventExecutorGroup. | |
| public EventExecutor | next()
Implements io. EventExecutors managed by this EventExecutorGroup.
|
| public Future | schedule(Runnable
The task that should be executed in this task, long EventExecutorGroup after the given delay.A positive time delay, in the given time unit. delay, TimeUnit The non-null time unit for the delay. unit)Overrides default io. EventExecutor
in this group, and return a future that produces a null result when the task completes.
|
| public <V> Future | schedule(Callable<V>
The task that should be executed in this task, long EventExecutorGroup after the given delay.A positive time delay, in the given time unit. delay, TimeUnit The non-null time unit for the delay. unit)Overrides default io. EventExecutor
in this group, and return a future that will return the result of the callable when the task completes.
|
| public Future | scheduleAtFixedRate(Runnable
The task that should be scheduled to execute at a fixed rate in this task, long EventExecutorGroup.The positive initial delay for the first task execution, in terms of the given time unit. initialDelay, long The positive period for the execution frequency to use after the first execution has started,
in terms of the given time unit. period, TimeUnit The non-null time unit for the delay and period. unit)Overrides default io. EventExecutor.
|
| public Future | scheduleWithFixedDelay(Runnable
The task that should be scheduled to execute with fixed delays in this task, long EventExecutorGroup.The positive initial delay for the first task execution, in terms of the given time unit. initialDelay, long The positive subsequent delay between task, to use after the first execution has completed,
in terms of the given time unit. delay, TimeUnit The non-null time unit for the delays. unit)Overrides default io. EventExecutor.
|
| public Future | shutdownGracefully()
Overrides default io. shutdownGracefully(long, long, TimeUnit) with sensible default values.
|
| public Future | shutdownGracefully(long
the quiet period as described in the documentation quietPeriod, long the maximum amount of time to wait until the executor is
shutting down regardless if a task was submitted during the quiet period. timeout, TimeUnit the unit of unit)quietPeriod and timeoutImplements io. |
| public Future | submit(Runnable
The task that should be executed in this task)EventExecutorGroup.Overrides default io. EventExecutor in this group,
and return a future that produces a null result when the task completes.
|
| public <T> Future | submit(Runnable
The task that should be executed in this task, T EventExecutorGroup.The value that the returned future will complete with, if the task completes successfully. result)Overrides default io. EventExecutor in this group,
and return a future that produces the given result when the task completes.
|
| public <T> Future | submit(Callable<T>
The task that should be executed in this task)EventExecutorGroup.Overrides default io. EventExecutor in this group,
and return a future that will return the result of the callable when the task completes.
|
| public Future | terminationFuture()
Implements io. Future which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated.
|
| private static EventExecutorGroup |
| group | back to summary |
|---|---|
| private final EventExecutorGroup group | |
| maxTaskExecutePerRun | back to summary |
|---|---|
| private final int maxTaskExecutePerRun | |
| NonStickyEventExecutorGroup | back to summary |
|---|---|
| public NonStickyEventExecutorGroup(EventExecutorGroup group) Creates a new instance. Be aware that the given | |
| NonStickyEventExecutorGroup | back to summary |
|---|---|
| public NonStickyEventExecutorGroup(EventExecutorGroup group, int maxTaskExecutePerRun) Creates a new instance. Be aware that the given | |
| awaitTermination | back to summary |
|---|---|
| public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException Overrides default io. Doc from io. Wait for this
| |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Overrides default io. Doc from java. Executes the given command at some time in the future. The command
may execute in a new thread, in a pooled thread, or in the calling
thread, at the discretion of the | |
| isShutdown | back to summary |
|---|---|
| public boolean isShutdown() Implements io. Doc from io. Returns An executor group that "is shut down" might still be executing tasks that it has queued up, but it will no longer be accepting any new tasks. Once all running and queued tasks have completed, the executor group will be terminated.
| |
| isShuttingDown | back to summary |
|---|---|
| public boolean isShuttingDown() Implements io. Doc from io. Returns An executor group that "is shutting down" can still accept new tasks for a little while (the grace period), but will eventually start rejecting new tasks. At that point, the executor group will be shut down.
| |
| isTerminated | back to summary |
|---|---|
| public boolean isTerminated() Overrides default io. Doc from io. Returns
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements io. Doc from java. Returns an iterator over elements of type
| |
| newExecutor | back to summary |
|---|---|
| private NonStickyEventExecutorGroup. | |
| next | back to summary |
|---|---|
| public EventExecutor next() Implements io. Doc from io. Returns one of the
| |
| schedule | back to summary |
|---|---|
| public Future Overrides default io. Doc from io. Schedule the given task for execution after the given delay, in the next available
| |
| schedule | back to summary |
|---|---|
| public <V> Future Overrides default io. Doc from io. Schedule the given task for execution after the given delay, in the next available
| |
| scheduleAtFixedRate | back to summary |
|---|---|
| public Future Overrides default io. Doc from io. Schedule the given task for periodic execution in the next available The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.
| |
| scheduleWithFixedDelay | back to summary |
|---|---|
| public Future Overrides default io. Doc from io. Schedule the given task for periodic execution in the next available
This is in contrast to The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.
| |
| shutdownGracefully | back to summary |
|---|---|
| public Future Overrides default io. Doc from io. Shortcut method for | |
| shutdownGracefully | back to summary |
|---|---|
| public Future Implements io. Doc from io. Signals this executor that the caller wants the executor to be shut down. Once this method is called,
| |
| submit | back to summary |
|---|---|
| public Future Overrides default io. Doc from io. Submit the given task for execution in the next available
| |
| submit | back to summary |
|---|---|
| public <T> Future Overrides default io. Doc from io. Submit the given task for execution in the next available
| |
| submit | back to summary |
|---|---|
| public <T> Future Overrides default io. Doc from io. Submit the given task for execution in the next available
| |
| terminationFuture | back to summary |
|---|---|
| public Future Implements io. Doc from io. Returns the
| |
| verify | back to summary |
|---|---|
| private static EventExecutorGroup verify(EventExecutorGroup group) | |
| Modifier and Type | Field and Description |
|---|---|
| private final EventExecutor | |
| private final int | |
| private static final int | |
| private static final int | |
| private final AtomicInteger | |
| private static final int | |
| private final Queue |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | awaitTermination(long
The non-negative maximum amount of time to wait for the executor group to terminate. timeout, TimeUnit The non-null time unit of the timeout. unit)Overrides default io. EventExecutorGroup to terminate, up to the given timeout.
|
| public void | execute(Runnable
the runnable task task)Implements io. |
| public boolean | inEventLoop(Thread thread)
Implements io. true if the given Thread is executed in the event loop,
false otherwise.
|
| public boolean | isShutdown()
Implements io. true if all EventExecutors managed by this EventExecutorGroup have been
shut down gracefully and moved past the grace period so that they are no
longer accepting any new tasks.
|
| public boolean | isShuttingDown()
Implements io. true if and only if all EventExecutors managed by this EventExecutorGroup
are being shut down gracefully or was shut down.
|
| public boolean | isTerminated()
Overrides default io. true if all EventExecutors managed by this EventExecutorGroup are
shut down, and all of their tasks have completed.
|
| public void | |
| public Future | schedule(Runnable
The task that should be executed in this task, long EventExecutorGroup after the given delay.A positive time delay, in the given time unit. delay, TimeUnit The non-null time unit for the delay. unit)Implements io. EventExecutor
in this group, and return a future that produces a null result when the task completes.
|
| public <V> Future | schedule(Callable<V>
The task that should be executed in this task, long EventExecutorGroup after the given delay.A positive time delay, in the given time unit. delay, TimeUnit The non-null time unit for the delay. unit)Implements io. EventExecutor
in this group, and return a future that will return the result of the callable when the task completes.
|
| public Future | scheduleAtFixedRate(Runnable
The task that should be scheduled to execute at a fixed rate in this task, long EventExecutorGroup.The positive initial delay for the first task execution, in terms of the given time unit. initialDelay, long The positive period for the execution frequency to use after the first execution has started,
in terms of the given time unit. period, TimeUnit The non-null time unit for the delay and period. unit)Implements io. EventExecutor.
|
| public Future | scheduleWithFixedDelay(Runnable
The task that should be scheduled to execute with fixed delays in this task, long EventExecutorGroup.The positive initial delay for the first task execution, in terms of the given time unit. initialDelay, long The positive subsequent delay between task, to use after the first execution has completed,
in terms of the given time unit. delay, TimeUnit The non-null time unit for the delays. unit)Implements io. EventExecutor.
|
| public Future | shutdownGracefully(long
the quiet period as described in the documentation quietPeriod, long the maximum amount of time to wait until the executor is
shutting down regardless if a task was submitted during the quiet period. timeout, TimeUnit the unit of unit)quietPeriod and timeoutImplements io. |
| public Future | terminationFuture()
Implements io. Future which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated.
|
| executor | back to summary |
|---|---|
| private final EventExecutor executor | |
| maxTaskExecutePerRun | back to summary |
|---|---|
| private final int maxTaskExecutePerRun | |
| NONE | back to summary |
|---|---|
| private static final int NONE | |
| RUNNING | back to summary |
|---|---|
| private static final int RUNNING | |
| state | back to summary |
|---|---|
| private final AtomicInteger state | |
| SUBMITTED | back to summary |
|---|---|
| private static final int SUBMITTED | |
| tasks | back to summary |
|---|---|
| private final Queue<Runnable> tasks | |
| NonStickyOrderedEventExecutor | back to summary |
|---|---|
| pack-priv NonStickyOrderedEventExecutor(EventExecutor executor, int maxTaskExecutePerRun) | |
| awaitTermination | back to summary |
|---|---|
| public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException Overrides default io. Doc from io. Wait for this
| |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Implements io. Doc from java. Executes the given command at some time in the future. The command
may execute in a new thread, in a pooled thread, or in the calling
thread, at the discretion of the | |
| inEventLoop | back to summary |
|---|---|
| public boolean inEventLoop(Thread thread) Implements io. Doc from io. Return
| |
| isShutdown | back to summary |
|---|---|
| public boolean isShutdown() Implements io. Doc from io. Returns An executor group that "is shut down" might still be executing tasks that it has queued up, but it will no longer be accepting any new tasks. Once all running and queued tasks have completed, the executor group will be terminated.
| |
| isShuttingDown | back to summary |
|---|---|
| public boolean isShuttingDown() Implements io. Doc from io. Returns An executor group that "is shutting down" can still accept new tasks for a little while (the grace period), but will eventually start rejecting new tasks. At that point, the executor group will be shut down.
| |
| isTerminated | back to summary |
|---|---|
| public boolean isTerminated() Overrides default io. Doc from io. Returns
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| schedule | back to summary |
|---|---|
| public Future Implements io. Doc from io. Schedule the given task for execution after the given delay, in the next available
| |
| schedule | back to summary |
|---|---|
| public <V> Future Implements io. Doc from io. Schedule the given task for execution after the given delay, in the next available
| |
| scheduleAtFixedRate | back to summary |
|---|---|
| public Future Implements io. Doc from io. Schedule the given task for periodic execution in the next available The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.
| |
| scheduleWithFixedDelay | back to summary |
|---|---|
| public Future Implements io. Doc from io. Schedule the given task for periodic execution in the next available
This is in contrast to The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.
| |
| shutdownGracefully | back to summary |
|---|---|
| public Future Implements io. Doc from io. Signals this executor that the caller wants the executor to be shut down. Once this method is called,
| |
| terminationFuture | back to summary |
|---|---|
| public Future Implements io. Doc from io. Returns the
| |