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 specialisedEventLoopGroup
which theMultithreadEventLoopGroup.next()
method prefers to return anEventLoop
for 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 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 aEventLoopGroup
which represents a single thread.io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup>
singleThreadGroup(io.netty.channel.EventLoop executor)
Return aEventLoopGroup
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
-
-
-
-
Constructor Detail
-
LocalThreadEventLoopGroup
public LocalThreadEventLoopGroup(@Nonnull E executor)
-
-
Method Detail
-
singleThreadGroup
@Nonnull public io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup()
Return aEventLoopGroup
which represents a single thread.- Specified by:
singleThreadGroup
in 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 aEventLoopGroup
which represents a single thread.- Specified by:
singleThreadGroup
in 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:
newChild
in 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:
shutdownGracefully
in interfaceio.netty.util.concurrent.EventExecutorGroup
- Overrides:
shutdownGracefully
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
terminationFuture
public io.netty.util.concurrent.Future<?> terminationFuture()
- Specified by:
terminationFuture
in interfaceio.netty.util.concurrent.EventExecutorGroup
- Overrides:
terminationFuture
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
isShuttingDown
public boolean isShuttingDown()
- Specified by:
isShuttingDown
in interfaceio.netty.util.concurrent.EventExecutorGroup
- Overrides:
isShuttingDown
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacejava.util.concurrent.ExecutorService
- Overrides:
isShutdown
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacejava.util.concurrent.ExecutorService
- Overrides:
isTerminated
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
awaitTermination
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
awaitTermination
in interfacejava.util.concurrent.ExecutorService
- Overrides:
awaitTermination
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
- Throws:
java.lang.InterruptedException
-
-