Class AbstractEventExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
io.netty.util.concurrent.AbstractEventExecutor
- All Implemented Interfaces:
EventExecutor, EventExecutorGroup, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
- Direct Known Subclasses:
AbstractEventLoop, AbstractScheduledEventExecutor, ImmediateEventExecutor
public abstract class AbstractEventExecutor
extends AbstractExecutorService
implements EventExecutor
Abstract base class for
EventExecutor implementations.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected -
Method Summary
Modifier and TypeMethodDescriptionbooleanCallsEventExecutor.inEventLoop(Thread)withThread.currentThread()as argumentiterator()voidlazyExecute(Runnable task) LikeExecutor.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(Throwable cause) Create a newFuturewhich is marked as failed already.<V> ProgressivePromise<V> Create a newProgressivePromise.<V> Promise<V> Return a newPromise.<V> Future<V> newSucceededFuture(V result) Create a newFuturewhich is marked as succeeded already.protected final <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) protected final <T> RunnableFuture<T> newTaskFor(Callable<T> callable) next()Returns a reference to itself.parent()Return theEventExecutorGroupwhich is the parent of thisEventExecutor,protected static voidprotected static voidsafeExecute(Runnable task) <V> ScheduledFuture<V> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) abstract voidshutdown()Deprecated.Future<?> Shortcut method forEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)with sensible default values.Deprecated.Future<?> <T> Future<T> <T> Future<T> Methods inherited from class AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAnyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EventExecutor
inEventLoopMethods inherited from interface EventExecutorGroup
isShuttingDown, shutdownGracefully, terminationFutureMethods inherited from interface ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminatedMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
AbstractEventExecutor
protected AbstractEventExecutor() -
AbstractEventExecutor
-
-
Method Details
-
parent
Description copied from interface:EventExecutorReturn theEventExecutorGroupwhich is the parent of thisEventExecutor,- Specified by:
parentin interfaceEventExecutor
-
next
Description copied from interface:EventExecutorReturns a reference to itself.- Specified by:
nextin interfaceEventExecutor- Specified by:
nextin interfaceEventExecutorGroup
-
inEventLoop
public boolean inEventLoop()Description copied from interface:EventExecutorCallsEventExecutor.inEventLoop(Thread)withThread.currentThread()as argument- Specified by:
inEventLoopin interfaceEventExecutor
-
iterator
- Specified by:
iteratorin interfaceEventExecutorGroup- Specified by:
iteratorin interfaceIterable<EventExecutor>
-
shutdownGracefully
Description copied from interface:EventExecutorGroupShortcut method forEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)with sensible default values.- Specified by:
shutdownGracefullyin interfaceEventExecutorGroup- Returns:
- the
EventExecutorGroup.terminationFuture()
-
shutdown
Deprecated.- Specified by:
shutdownin interfaceEventExecutorGroup- Specified by:
shutdownin interfaceExecutorService
-
shutdownNow
Deprecated.- Specified by:
shutdownNowin interfaceEventExecutorGroup- Specified by:
shutdownNowin interfaceExecutorService
-
newPromise
Description copied from interface:EventExecutorReturn a newPromise.- Specified by:
newPromisein interfaceEventExecutor
-
newProgressivePromise
Description copied from interface:EventExecutorCreate a newProgressivePromise.- Specified by:
newProgressivePromisein interfaceEventExecutor
-
newSucceededFuture
Description copied from interface:EventExecutorCreate a newFuturewhich is marked as succeeded already. SoFuture.isSuccess()will returntrue. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newSucceededFuturein interfaceEventExecutor
-
newFailedFuture
Description copied from interface:EventExecutorCreate a newFuturewhich is marked as failed already. SoFuture.isSuccess()will returnfalse. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newFailedFuturein interfaceEventExecutor
-
submit
- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
submit
- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
submit
- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classAbstractExecutorService
-
newTaskFor
- Overrides:
newTaskForin classAbstractExecutorService
-
newTaskFor
- Overrides:
newTaskForin classAbstractExecutorService
-
schedule
- Specified by:
schedulein interfaceEventExecutorGroup- Specified by:
schedulein interfaceScheduledExecutorService
-
schedule
- Specified by:
schedulein interfaceEventExecutorGroup- Specified by:
schedulein interfaceScheduledExecutorService
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - Specified by:
scheduleAtFixedRatein interfaceEventExecutorGroup- Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - Specified by:
scheduleWithFixedDelayin interfaceEventExecutorGroup- Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService
-
safeExecute
-
runTask
-
lazyExecute
LikeExecutor.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).
-
SingleThreadEventExecutor.wakesUpForTask(Runnable)to re-create this behaviour