public abstract class AbstractEventExecutor extends AbstractExecutorService implements EventExecutor
EventExecutor
implementations.Modifier | Constructor and Description |
---|---|
protected |
AbstractEventExecutor() |
protected |
AbstractEventExecutor(EventExecutorGroup parent) |
Modifier and Type | Method and Description |
---|---|
<E extends EventExecutor> |
children()
Returns an unmodifiable singleton set which contains itself.
|
void |
close() |
boolean |
inEventLoop()
Calls
EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument |
<V> Future<V> |
newFailedFuture(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> RunnableFuture<T> |
newTaskFor(Callable<T> callable) |
protected <T> RunnableFuture<T> |
newTaskFor(Runnable runnable,
T value) |
EventExecutor |
next()
Returns a reference to itself.
|
EventExecutorGroup |
parent()
Return the
EventExecutorGroup which is the parent of this EventExecutor , |
<V> ScheduledFuture<V> |
schedule(Callable<V> callable,
long delay,
TimeUnit unit) |
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit) |
ScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit) |
ScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit) |
abstract void |
shutdown()
Deprecated.
|
Future<?> |
shutdownGracefully()
Shortcut method for
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values. |
List<Runnable> |
shutdownNow()
Deprecated.
|
<T> Future<T> |
submit(Callable<T> task) |
Future<?> |
submit(Runnable task) |
<T> Future<T> |
submit(Runnable task,
T result) |
EventExecutor |
unwrap()
Returns an
EventExecutor that is not a WrappedEventExecutor . |
invokeAll, invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
inEventLoop
isShuttingDown, shutdownGracefully, terminationFuture
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
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 <E extends EventExecutor> Set<E> children()
EventExecutor
children
in interface EventExecutor
children
in interface EventExecutorGroup
public boolean inEventLoop()
EventExecutor
EventExecutor.inEventLoop(Thread)
with Thread.currentThread()
as argumentinEventLoop
in interface EventExecutor
public EventExecutor unwrap()
EventExecutor
EventExecutor
that is not a WrappedEventExecutor
.
WrappedEventExecutor
implementing this method must return the underlying
EventExecutor
while making sure that it's not a WrappedEventExecutor
(e.g. by multiple calls to EventExecutor.unwrap()
).
EventExecutor
that is not a WrappedEventExecutor
must return a reference to itself.
unwrap
in interface 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 ExecutorService
@Deprecated public List<Runnable> shutdownNow()
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)
or shutdownGracefully()
instead.shutdownNow
in interface EventExecutorGroup
shutdownNow
in interface 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(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(Runnable task)
submit
in interface EventExecutorGroup
submit
in interface ExecutorService
submit
in class AbstractExecutorService
public <T> Future<T> submit(Runnable task, T result)
submit
in interface EventExecutorGroup
submit
in interface ExecutorService
submit
in class AbstractExecutorService
public <T> Future<T> submit(Callable<T> task)
submit
in interface EventExecutorGroup
submit
in interface ExecutorService
submit
in class AbstractExecutorService
protected final <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value)
newTaskFor
in class AbstractExecutorService
protected final <T> RunnableFuture<T> newTaskFor(Callable<T> callable)
newTaskFor
in class AbstractExecutorService
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
schedule
in interface EventExecutorGroup
schedule
in interface ScheduledExecutorService
public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
schedule
in interface EventExecutorGroup
schedule
in interface ScheduledExecutorService
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
scheduleAtFixedRate
in interface EventExecutorGroup
scheduleAtFixedRate
in interface ScheduledExecutorService
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
scheduleWithFixedDelay
in interface EventExecutorGroup
scheduleWithFixedDelay
in interface ScheduledExecutorService
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2008–2015 The Netty Project. All rights reserved.