public abstract class AbstractEventExecutor extends java.util.concurrent.AbstractExecutorService implements EventExecutor
EventExecutor implementations.| 限定符和类型 | 类和说明 |
|---|---|
static interface |
AbstractEventExecutor.LazyRunnable
已过时。
override
SingleThreadEventExecutor.wakesUpForTask(java.lang.Runnable) to re-create this behaviour |
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractEventExecutor() |
protected |
AbstractEventExecutor(EventExecutorGroup parent) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
inEventLoop()
Calls
EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument |
java.util.Iterator<EventExecutor> |
iterator() |
void |
lazyExecute(java.lang.Runnable task)
Like
Executor.execute(Runnable) but does not guarantee the task will be run until either
a non-lazy task is executed or the executor is shut down. |
<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 |
runTask(java.lang.Runnable task) |
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()
|
Future<?> |
shutdownGracefully()
Shortcut method for
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values. |
java.util.List<java.lang.Runnable> |
shutdownNow()
|
<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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinEventLoopisShuttingDown, shutdownGracefully, terminationFutureprotected AbstractEventExecutor()
protected AbstractEventExecutor(EventExecutorGroup parent)
public EventExecutorGroup parent()
EventExecutorEventExecutorGroup which is the parent of this EventExecutor,parent 在接口中 EventExecutorpublic EventExecutor next()
EventExecutornext 在接口中 EventExecutornext 在接口中 EventExecutorGrouppublic boolean inEventLoop()
EventExecutorEventExecutor.inEventLoop(Thread) with Thread.currentThread() as argumentinEventLoop 在接口中 EventExecutorpublic java.util.Iterator<EventExecutor> iterator()
iterator 在接口中 EventExecutorGroupiterator 在接口中 java.lang.Iterable<EventExecutor>public Future<?> shutdownGracefully()
EventExecutorGroupEventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values.shutdownGracefully 在接口中 EventExecutorGroupEventExecutorGroup.terminationFuture()@Deprecated public abstract void shutdown()
shutdown 在接口中 EventExecutorGroupshutdown 在接口中 java.util.concurrent.ExecutorService@Deprecated public java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow 在接口中 EventExecutorGroupshutdownNow 在接口中 java.util.concurrent.ExecutorServicepublic <V> Promise<V> newPromise()
EventExecutorPromise.newPromise 在接口中 EventExecutorpublic <V> ProgressivePromise<V> newProgressivePromise()
EventExecutorProgressivePromise.newProgressivePromise 在接口中 EventExecutorpublic <V> Future<V> newSucceededFuture(V result)
EventExecutorFuture 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 在接口中 EventExecutorpublic <V> Future<V> newFailedFuture(java.lang.Throwable cause)
EventExecutorFuture 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 在接口中 EventExecutorpublic Future<?> submit(java.lang.Runnable task)
submit 在接口中 EventExecutorGroupsubmit 在接口中 java.util.concurrent.ExecutorServicesubmit 在类中 java.util.concurrent.AbstractExecutorServicepublic <T> Future<T> submit(java.lang.Runnable task, T result)
submit 在接口中 EventExecutorGroupsubmit 在接口中 java.util.concurrent.ExecutorServicesubmit 在类中 java.util.concurrent.AbstractExecutorServicepublic <T> Future<T> submit(java.util.concurrent.Callable<T> task)
submit 在接口中 EventExecutorGroupsubmit 在接口中 java.util.concurrent.ExecutorServicesubmit 在类中 java.util.concurrent.AbstractExecutorServiceprotected final <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.lang.Runnable runnable,
T value)
newTaskFor 在类中 java.util.concurrent.AbstractExecutorServiceprotected final <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.util.concurrent.Callable<T> callable)
newTaskFor 在类中 java.util.concurrent.AbstractExecutorServicepublic ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule 在接口中 EventExecutorGroupschedule 在接口中 java.util.concurrent.ScheduledExecutorServicepublic <V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule 在接口中 EventExecutorGroupschedule 在接口中 java.util.concurrent.ScheduledExecutorServicepublic ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate 在接口中 EventExecutorGroupscheduleAtFixedRate 在接口中 java.util.concurrent.ScheduledExecutorServicepublic ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay 在接口中 EventExecutorGroupscheduleWithFixedDelay 在接口中 java.util.concurrent.ScheduledExecutorServiceprotected static void safeExecute(java.lang.Runnable task)
Runnable and just log if it throws a Throwable.protected static void runTask(java.lang.Runnable task)
@UnstableApi public void lazyExecute(java.lang.Runnable task)
Executor.execute(Runnable) but does not guarantee the task will be run until either
a non-lazy task is executed or the executor is shut down.
The default implementation just delegates to Executor.execute(Runnable).