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
,Iterable<io.netty.util.concurrent.EventExecutor>
,Executor
,ExecutorService
,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.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
awaitTermination
(long timeout, TimeUnit unit) boolean
boolean
boolean
protected io.netty.channel.EventLoop
io.netty.util.concurrent.Future<?>
shutdownGracefully
(long quietPeriod, long timeout, TimeUnit unit) io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup>
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<?>
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.ExecutorService
invokeAll, invokeAll, invokeAny, invokeAny
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
LocalThreadEventLoopGroup
-
-
Method Details
-
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
- Specified by:
newChild
in classio.netty.channel.MultithreadEventLoopGroup
- Throws:
Exception
-
shutdownGracefully
public io.netty.util.concurrent.Future<?> shutdownGracefully(long quietPeriod, long timeout, 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 interfaceExecutorService
- Overrides:
isShutdown
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminated
in interfaceExecutorService
- Overrides:
isTerminated
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
-
awaitTermination
- Specified by:
awaitTermination
in interfaceExecutorService
- Overrides:
awaitTermination
in classio.netty.util.concurrent.MultithreadEventExecutorGroup
- Throws:
InterruptedException
-