public interface EventExecutorGroup extends java.util.concurrent.ScheduledExecutorService, java.lang.Iterable<EventExecutor>
EventExecutorGroup
is responsible for providing the EventExecutor
's to use
via its next()
method. Besides this, it is also responsible for handling their
life-cycle and allows shutting them down in a global fashion.Modifier and Type | Method and Description |
---|---|
boolean |
isShuttingDown()
Returns
true if and only if this executor was started to be
shut down gracefuclly or was shut down. |
java.util.Iterator<EventExecutor> |
iterator()
Returns a read-only
Iterator over all EventExecutor , which are handled by this
EventExecutorGroup at the time of invoke this method. |
EventExecutor |
next()
Returns one of the
EventExecutor s that belong to this group. |
<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) |
ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit) |
ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit) |
void |
shutdown()
Deprecated.
|
Future<?> |
shutdownGracefully()
Shortcut method for
shutdownGracefully(long, long, TimeUnit) with sensible default values. |
Future<?> |
shutdownGracefully(long quietPeriod,
long timeout,
java.util.concurrent.TimeUnit unit)
Signals this executor that the caller wants the executor to be shut down.
|
java.util.List<java.lang.Runnable> |
shutdownNow()
Deprecated.
|
<T> Future<T> |
submit(java.util.concurrent.Callable<T> task) |
Future<?> |
submit(java.lang.Runnable task) |
<T> Future<T> |
submit(java.lang.Runnable task,
T result) |
Future<?> |
terminationFuture()
Returns the
Future which is notified when this executor has been terminated. |
boolean isShuttingDown()
true
if and only if this executor was started to be
shut down gracefuclly or was shut down.Future<?> shutdownGracefully()
shutdownGracefully(long, long, TimeUnit)
with sensible default values.terminationFuture()
Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
isShuttingDown()
starts to return true
, and the executor prepares to shut itself down.
Unlike shutdown()
, graceful shutdown ensures that no tasks are submitted for 'the quiet period'
(usually a couple seconds) before it shuts itself down. If a task is submitted during the quiet period,
it is guaranteed to be accepted and the quiet period will start over.quietPeriod
- the quiet period as described in the documentationtimeout
- the maximum amount of time to wait until the executor is shutdown()
regardless if a task was submitted during the quiet periodunit
- the unit of quietPeriod
and timeout
terminationFuture()
Future<?> terminationFuture()
Future
which is notified when this executor has been terminated.@Deprecated void shutdown()
shutdownGracefully(long, long, TimeUnit)
or shutdownGracefully()
instead.shutdown
in interface java.util.concurrent.ExecutorService
@Deprecated java.util.List<java.lang.Runnable> shutdownNow()
shutdownGracefully(long, long, TimeUnit)
or shutdownGracefully()
instead.shutdownNow
in interface java.util.concurrent.ExecutorService
EventExecutor next()
EventExecutor
s that belong to this group.java.util.Iterator<EventExecutor> iterator()
Iterator
over all EventExecutor
, which are handled by this
EventExecutorGroup
at the time of invoke this method.iterator
in interface java.lang.Iterable<EventExecutor>
Future<?> submit(java.lang.Runnable task)
submit
in interface java.util.concurrent.ExecutorService
<T> Future<T> submit(java.lang.Runnable task, T result)
submit
in interface java.util.concurrent.ExecutorService
<T> Future<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface java.util.concurrent.ExecutorService
ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface java.util.concurrent.ScheduledExecutorService
<V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule
in interface java.util.concurrent.ScheduledExecutorService
ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate
in interface java.util.concurrent.ScheduledExecutorService
ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay
in interface java.util.concurrent.ScheduledExecutorService
Copyright © 2008–2018 The Netty Project. All rights reserved.