Class AbstractEventExecutor

java.lang.Object
java.util.concurrent.AbstractExecutorService
io.netty.util.concurrent.AbstractEventExecutor
All Implemented Interfaces:
EventExecutor, EventExecutorGroup, ThreadAwareExecutor, java.lang.Iterable<EventExecutor>, java.util.concurrent.Executor, java.util.concurrent.ExecutorService, java.util.concurrent.ScheduledExecutorService
Direct Known Subclasses:
AbstractEventLoop, AbstractScheduledEventExecutor, ImmediateEventExecutor, NonStickyEventExecutorGroup.NonStickyOrderedEventExecutor

public abstract class AbstractEventExecutor extends java.util.concurrent.AbstractExecutorService implements EventExecutor
Abstract base class for EventExecutor implementations.
  • Field Details

  • Constructor Details

    • AbstractEventExecutor

      protected AbstractEventExecutor()
    • AbstractEventExecutor

      protected AbstractEventExecutor(EventExecutorGroup parent)
  • Method Details

    • parent

      public EventExecutorGroup parent()
      Description copied from interface: EventExecutor
      Return the EventExecutorGroup which is the parent of this EventExecutor,
      Specified by:
      parent in interface EventExecutor
    • next

      public EventExecutor next()
      Description copied from interface: EventExecutorGroup
      Returns one of the EventExecutors managed by this EventExecutorGroup.
      Specified by:
      next in interface EventExecutorGroup
    • iterator

      public java.util.Iterator<EventExecutor> iterator()
      Specified by:
      iterator in interface EventExecutorGroup
      Specified by:
      iterator in interface java.lang.Iterable<EventExecutor>
    • shutdownGracefully

      public Future<?> shutdownGracefully()
      Description copied from interface: EventExecutorGroup
      Shortcut method for EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values.
      Specified by:
      shutdownGracefully in interface EventExecutorGroup
      Returns:
      the EventExecutorGroup.terminationFuture()
    • shutdown

      @Deprecated public abstract void shutdown()
      Specified by:
      shutdown in interface EventExecutorGroup
      Specified by:
      shutdown in interface java.util.concurrent.ExecutorService
    • shutdownNow

      @Deprecated public java.util.List<java.lang.Runnable> shutdownNow()
      Specified by:
      shutdownNow in interface EventExecutorGroup
      Specified by:
      shutdownNow in interface java.util.concurrent.ExecutorService
    • submit

      public Future<?> submit(java.lang.Runnable task)
      Specified by:
      submit in interface EventExecutorGroup
      Specified by:
      submit in interface java.util.concurrent.ExecutorService
      Overrides:
      submit in class java.util.concurrent.AbstractExecutorService
    • submit

      public <T> Future<T> submit(java.lang.Runnable task, T result)
      Specified by:
      submit in interface EventExecutorGroup
      Specified by:
      submit in interface java.util.concurrent.ExecutorService
      Overrides:
      submit in class java.util.concurrent.AbstractExecutorService
    • submit

      public <T> Future<T> submit(java.util.concurrent.Callable<T> task)
      Specified by:
      submit in interface EventExecutorGroup
      Specified by:
      submit in interface java.util.concurrent.ExecutorService
      Overrides:
      submit in class java.util.concurrent.AbstractExecutorService
    • newTaskFor

      protected final <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.lang.Runnable runnable, T value)
      Overrides:
      newTaskFor in class java.util.concurrent.AbstractExecutorService
    • newTaskFor

      protected final <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.util.concurrent.Callable<T> callable)
      Overrides:
      newTaskFor in class java.util.concurrent.AbstractExecutorService
    • schedule

      public ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
      Specified by:
      schedule in interface EventExecutorGroup
      Specified by:
      schedule in interface java.util.concurrent.ScheduledExecutorService
    • schedule

      public <V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
      Specified by:
      schedule in interface EventExecutorGroup
      Specified by:
      schedule in interface java.util.concurrent.ScheduledExecutorService
    • scheduleAtFixedRate

      public ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
      Specified by:
      scheduleAtFixedRate in interface EventExecutorGroup
      Specified by:
      scheduleAtFixedRate in interface java.util.concurrent.ScheduledExecutorService
    • scheduleWithFixedDelay

      public ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
      Specified by:
      scheduleWithFixedDelay in interface EventExecutorGroup
      Specified by:
      scheduleWithFixedDelay in interface java.util.concurrent.ScheduledExecutorService
    • safeExecute

      protected static void safeExecute(java.lang.Runnable task)
      Try to execute the given Runnable and just log if it throws a Throwable.
    • runTask

      protected static void runTask(java.lang.Runnable task)
    • lazyExecute

      @UnstableApi public 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.

      The default implementation just delegates to Executor.execute(Runnable).