public abstract class AbstractEventExecutor extends java.util.concurrent.AbstractExecutorService implements EventExecutor
EventExecutor
implementations.Modifier and Type | Field and Description |
---|---|
(package private) static long |
DEFAULT_SHUTDOWN_QUIET_PERIOD |
(package private) static long |
DEFAULT_SHUTDOWN_TIMEOUT |
private static InternalLogger |
logger |
private EventExecutorGroup |
parent |
private java.util.Collection<EventExecutor> |
selfCollection |
Modifier | Constructor and Description |
---|---|
protected |
AbstractEventExecutor() |
protected |
AbstractEventExecutor(EventExecutorGroup parent) |
Modifier and Type | Method and Description |
---|---|
boolean |
inEventLoop()
Calls
EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument |
java.util.Iterator<EventExecutor> |
iterator() |
<V> Future<V> |
newFailedFuture(java.lang.Throwable cause)
Create a new
Future which is marked as failed already. |
<V> ProgressivePromise<V> |
newProgressivePromise()
Create a new
ProgressivePromise . |
<V> Promise<V> |
newPromise()
Return a new
Promise . |
<V> Future<V> |
newSucceededFuture(V result)
Create a new
Future which is marked as succeeded already. |
protected <T> java.util.concurrent.RunnableFuture<T> |
newTaskFor(java.util.concurrent.Callable<T> callable) |
protected <T> java.util.concurrent.RunnableFuture<T> |
newTaskFor(java.lang.Runnable runnable,
T value) |
EventExecutor |
next()
Returns a reference to itself.
|
EventExecutorGroup |
parent()
Return the
EventExecutorGroup which is the parent of this EventExecutor , |
protected static void |
safeExecute(java.lang.Runnable task)
Try to execute the given
Runnable and just log if it throws a Throwable . |
<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) |
abstract void |
shutdown()
Deprecated.
|
Future<?> |
shutdownGracefully()
Shortcut method for
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values. |
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) |
invokeAll, invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
inEventLoop
isShuttingDown, shutdownGracefully, terminationFuture
private static final InternalLogger logger
static final long DEFAULT_SHUTDOWN_QUIET_PERIOD
static final long DEFAULT_SHUTDOWN_TIMEOUT
private final EventExecutorGroup parent
private final java.util.Collection<EventExecutor> selfCollection
protected AbstractEventExecutor()
protected AbstractEventExecutor(EventExecutorGroup parent)
public EventExecutorGroup parent()
EventExecutor
EventExecutorGroup
which is the parent of this EventExecutor
,parent
in interface EventExecutor
public EventExecutor next()
EventExecutor
next
in interface EventExecutor
next
in interface EventExecutorGroup
public boolean inEventLoop()
EventExecutor
EventExecutor.inEventLoop(Thread)
with Thread.currentThread()
as argumentinEventLoop
in interface EventExecutor
public java.util.Iterator<EventExecutor> iterator()
iterator
in interface EventExecutorGroup
iterator
in interface java.lang.Iterable<EventExecutor>
public Future<?> shutdownGracefully()
EventExecutorGroup
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)
with sensible default values.shutdownGracefully
in interface EventExecutorGroup
EventExecutorGroup.terminationFuture()
@Deprecated public abstract void shutdown()
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)
or shutdownGracefully()
instead.shutdown
in interface EventExecutorGroup
shutdown
in interface java.util.concurrent.ExecutorService
@Deprecated public java.util.List<java.lang.Runnable> shutdownNow()
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)
or shutdownGracefully()
instead.shutdownNow
in interface EventExecutorGroup
shutdownNow
in interface java.util.concurrent.ExecutorService
public <V> Promise<V> newPromise()
EventExecutor
Promise
.newPromise
in interface EventExecutor
public <V> ProgressivePromise<V> newProgressivePromise()
EventExecutor
ProgressivePromise
.newProgressivePromise
in interface EventExecutor
public <V> Future<V> newSucceededFuture(V result)
EventExecutor
Future
which is marked as succeeded already. So Future.isSuccess()
will return true
. All FutureListener
added to it will be notified directly. Also
every call of blocking methods will just return without blocking.newSucceededFuture
in interface EventExecutor
public <V> Future<V> newFailedFuture(java.lang.Throwable cause)
EventExecutor
Future
which is marked as failed already. So Future.isSuccess()
will return false
. All FutureListener
added to it will be notified directly. Also
every call of blocking methods will just return without blocking.newFailedFuture
in interface EventExecutor
public Future<?> submit(java.lang.Runnable task)
submit
in interface EventExecutorGroup
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
public <T> Future<T> submit(java.lang.Runnable task, T result)
submit
in interface EventExecutorGroup
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
public <T> Future<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface EventExecutorGroup
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
protected final <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.lang.Runnable runnable, T value)
newTaskFor
in class java.util.concurrent.AbstractExecutorService
protected final <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.util.concurrent.Callable<T> callable)
newTaskFor
in class java.util.concurrent.AbstractExecutorService
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
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
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
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
protected static void safeExecute(java.lang.Runnable task)
Runnable
and just log if it throws a Throwable
.