Class LocalThreadEventLoopGroup<E extends io.netty.channel.MultithreadEventLoopGroup>

  • All Implemented Interfaces:
    SingleThreadEventLoopGroupSupplier, io.netty.channel.EventLoopGroup, io.netty.util.concurrent.EventExecutorGroup, java.lang.Iterable<io.netty.util.concurrent.EventExecutor>, java.util.concurrent.Executor, java.util.concurrent.ExecutorService, java.util.concurrent.ScheduledExecutorService

    public class LocalThreadEventLoopGroup<E extends io.netty.channel.MultithreadEventLoopGroup>
    extends io.netty.channel.MultithreadEventLoopGroup
    implements SingleThreadEventLoopGroupSupplier
    A specialised EventLoopGroup which the MultithreadEventLoopGroup.next() method prefers to return an EventLoop for the current thread, if the current thread is a thread of the wrapped MultithreadEventLoopGroup.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean awaitTermination​(long timeout, java.util.concurrent.TimeUnit unit)  
      boolean isShutdown()  
      boolean isShuttingDown()  
      boolean isTerminated()  
      protected io.netty.channel.EventLoop newChild​(java.util.concurrent.Executor executor, java.lang.Object... args)  
      io.netty.util.concurrent.Future<?> shutdownGracefully​(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)  
      io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup()
      Return a EventLoopGroup which represents a single thread.
      io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup​(io.netty.channel.EventLoop executor)
      Return a EventLoopGroup which represents a single thread.
      io.netty.util.concurrent.Future<?> terminationFuture()  
      • Methods inherited from class io.netty.channel.MultithreadEventLoopGroup

        newDefaultThreadFactory, next, register, register, register
      • Methods inherited from class io.netty.util.concurrent.MultithreadEventExecutorGroup

        executorCount, iterator, shutdown
      • Methods inherited from class io.netty.util.concurrent.AbstractEventExecutorGroup

        execute, invokeAll, invokeAll, invokeAny, invokeAny, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submit
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.util.concurrent.EventExecutorGroup

        iterator, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownNow, submit, submit, submit
      • Methods inherited from interface io.netty.channel.EventLoopGroup

        next, register, register, register
      • Methods inherited from interface java.util.concurrent.Executor

        execute
      • Methods inherited from interface java.util.concurrent.ExecutorService

        invokeAll, invokeAll, invokeAny, invokeAny
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • LocalThreadEventLoopGroup

        public LocalThreadEventLoopGroup​(@Nonnull
                                         E executor)
    • Method Detail

      • singleThreadGroup

        @Nonnull
        public io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup()
        Return a EventLoopGroup which represents a single thread.
        Specified by:
        singleThreadGroup in interface SingleThreadEventLoopGroupSupplier
        Returns:
        future of EventLoopGroup
      • singleThreadGroup

        @Nonnull
        public io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup​(@Nonnull
                                                                                                  io.netty.channel.EventLoop executor)
        Return a EventLoopGroup which represents a single thread.
        Specified by:
        singleThreadGroup in interface SingleThreadEventLoopGroupSupplier
        Returns:
        future of EventLoopGroup
      • newChild

        protected io.netty.channel.EventLoop newChild​(java.util.concurrent.Executor executor,
                                                      java.lang.Object... args)
                                               throws java.lang.Exception
        Specified by:
        newChild in class io.netty.channel.MultithreadEventLoopGroup
        Throws:
        java.lang.Exception
      • shutdownGracefully

        public io.netty.util.concurrent.Future<?> shutdownGracefully​(long quietPeriod,
                                                                     long timeout,
                                                                     java.util.concurrent.TimeUnit unit)
        Specified by:
        shutdownGracefully in interface io.netty.util.concurrent.EventExecutorGroup
        Overrides:
        shutdownGracefully in class io.netty.util.concurrent.MultithreadEventExecutorGroup
      • terminationFuture

        public io.netty.util.concurrent.Future<?> terminationFuture()
        Specified by:
        terminationFuture in interface io.netty.util.concurrent.EventExecutorGroup
        Overrides:
        terminationFuture in class io.netty.util.concurrent.MultithreadEventExecutorGroup
      • isShuttingDown

        public boolean isShuttingDown()
        Specified by:
        isShuttingDown in interface io.netty.util.concurrent.EventExecutorGroup
        Overrides:
        isShuttingDown in class io.netty.util.concurrent.MultithreadEventExecutorGroup
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface java.util.concurrent.ExecutorService
        Overrides:
        isShutdown in class io.netty.util.concurrent.MultithreadEventExecutorGroup
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface java.util.concurrent.ExecutorService
        Overrides:
        isTerminated in class io.netty.util.concurrent.MultithreadEventExecutorGroup
      • awaitTermination

        public boolean awaitTermination​(long timeout,
                                        java.util.concurrent.TimeUnit unit)
                                 throws java.lang.InterruptedException
        Specified by:
        awaitTermination in interface java.util.concurrent.ExecutorService
        Overrides:
        awaitTermination in class io.netty.util.concurrent.MultithreadEventExecutorGroup
        Throws:
        java.lang.InterruptedException