Package com.linkedin.alpini.netty4.misc
Class LocalThreadEventLoopGroup<E extends io.netty.channel.MultithreadEventLoopGroup>
- java.lang.Object
-
- io.netty.util.concurrent.AbstractEventExecutorGroup
-
- io.netty.util.concurrent.MultithreadEventExecutorGroup
-
- io.netty.channel.MultithreadEventLoopGroup
-
- com.linkedin.alpini.netty4.misc.LocalThreadEventLoopGroup<E>
-
- 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 specialisedEventLoopGroupwhich theMultithreadEventLoopGroup.next()method prefers to return anEventLoopfor the current thread, if the current thread is a thread of the wrapped MultithreadEventLoopGroup.
-
-
Constructor Summary
Constructors Constructor Description LocalThreadEventLoopGroup(E executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long timeout, java.util.concurrent.TimeUnit unit)booleanisShutdown()booleanisShuttingDown()booleanisTerminated()protected io.netty.channel.EventLoopnewChild(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 aEventLoopGroupwhich represents a single thread.io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup>singleThreadGroup(io.netty.channel.EventLoop executor)Return aEventLoopGroupwhich 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
-
-
-
-
Constructor Detail
-
LocalThreadEventLoopGroup
public LocalThreadEventLoopGroup(@Nonnull E executor)
-
-
Method Detail
-
singleThreadGroup
@Nonnull public io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup()
Return aEventLoopGroupwhich represents a single thread.- Specified by:
singleThreadGroupin interfaceSingleThreadEventLoopGroupSupplier- Returns:
- future of EventLoopGroup
-
singleThreadGroup
@Nonnull public io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup(@Nonnull io.netty.channel.EventLoop executor)Return aEventLoopGroupwhich represents a single thread.- Specified by:
singleThreadGroupin interfaceSingleThreadEventLoopGroupSupplier- 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:
newChildin classio.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:
shutdownGracefullyin interfaceio.netty.util.concurrent.EventExecutorGroup- Overrides:
shutdownGracefullyin classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
terminationFuture
public io.netty.util.concurrent.Future<?> terminationFuture()
- Specified by:
terminationFuturein interfaceio.netty.util.concurrent.EventExecutorGroup- Overrides:
terminationFuturein classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
isShuttingDown
public boolean isShuttingDown()
- Specified by:
isShuttingDownin interfaceio.netty.util.concurrent.EventExecutorGroup- Overrides:
isShuttingDownin classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfacejava.util.concurrent.ExecutorService- Overrides:
isShutdownin classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfacejava.util.concurrent.ExecutorService- Overrides:
isTerminatedin classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
awaitTermination
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException- Specified by:
awaitTerminationin interfacejava.util.concurrent.ExecutorService- Overrides:
awaitTerminationin classio.netty.util.concurrent.MultithreadEventExecutorGroup- Throws:
java.lang.InterruptedException
-
-