public class ThreadPerChannelEventLoopGroup extends io.netty.util.concurrent.AbstractEventExecutorGroup implements EventLoopGroup
| Modifier | Constructor and Description |
|---|---|
protected |
ThreadPerChannelEventLoopGroup()
Create a new
ThreadPerChannelEventLoopGroup with no limit in place. |
protected |
ThreadPerChannelEventLoopGroup(int maxChannels)
Create a new
ThreadPerChannelEventLoopGroup. |
protected |
ThreadPerChannelEventLoopGroup(int maxChannels,
Executor executor,
Object... args)
Create a new
ThreadPerChannelEventLoopGroup. |
protected |
ThreadPerChannelEventLoopGroup(int maxChannels,
ThreadFactory threadFactory,
Object... args)
Create a new
ThreadPerChannelEventLoopGroup. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
<E extends io.netty.util.concurrent.EventExecutor> |
children() |
boolean |
isShutdown() |
boolean |
isShuttingDown() |
boolean |
isTerminated() |
protected EventLoop |
newChild(Object... args)
Creates a new
EventLoop. |
EventLoop |
next() |
ChannelFuture |
register(Channel channel)
|
ChannelFuture |
register(Channel channel,
ChannelPromise promise)
|
void |
shutdown()
Deprecated.
|
io.netty.util.concurrent.Future<?> |
shutdownGracefully(long quietPeriod,
long timeout,
TimeUnit unit) |
io.netty.util.concurrent.Future<?> |
terminationFuture() |
close, execute, invokeAll, invokeAll, invokeAny, invokeAny, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submitclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitschedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submitinvokeAll, invokeAll, invokeAny, invokeAnycloseprotected ThreadPerChannelEventLoopGroup()
ThreadPerChannelEventLoopGroup with no limit in place.protected ThreadPerChannelEventLoopGroup(int maxChannels)
ThreadPerChannelEventLoopGroup.maxChannels - the maximum number of channels to handle with this instance. Once you try to register
a new Channel and the maximum is exceed it will throw an
ChannelException. on the register(Channel) and
register(Channel, ChannelPromise) method.
Use 0 to use no limitprotected ThreadPerChannelEventLoopGroup(int maxChannels,
ThreadFactory threadFactory,
Object... args)
ThreadPerChannelEventLoopGroup.maxChannels - the maximum number of channels to handle with this instance. Once you try to register
a new Channel and the maximum is exceed it will throw an
ChannelException on the register(Channel) and
register(Channel, ChannelPromise) method.
Use 0 to use no limitthreadFactory - the ThreadFactory used to create new Thread instances that handle the
registered Channelsargs - arguments which will passed to each newChild(Object...) call.protected ThreadPerChannelEventLoopGroup(int maxChannels,
Executor executor,
Object... args)
ThreadPerChannelEventLoopGroup.maxChannels - the maximum number of channels to handle with this instance. Once you try to register
a new Channel and the maximum is exceed it will throw an
ChannelException on the register(Channel) and
register(Channel, ChannelPromise) method.
Use 0 to use no limitexecutor - the Executor used to create new Thread instances that handle the
registered Channelsargs - arguments which will passed to each newChild(Object...) call.protected EventLoop newChild(Object... args) throws Exception
EventLoop. The default implementation creates a new ThreadPerChannelEventLoop.Exceptionpublic <E extends io.netty.util.concurrent.EventExecutor> Set<E> children()
children in interface io.netty.util.concurrent.EventExecutorGrouppublic EventLoop next()
next in interface EventLoopGroupnext in interface io.netty.util.concurrent.EventExecutorGrouppublic io.netty.util.concurrent.Future<?> shutdownGracefully(long quietPeriod,
long timeout,
TimeUnit unit)
shutdownGracefully in interface io.netty.util.concurrent.EventExecutorGrouppublic io.netty.util.concurrent.Future<?> terminationFuture()
terminationFuture in interface io.netty.util.concurrent.EventExecutorGroup@Deprecated public void shutdown()
shutdown in interface io.netty.util.concurrent.EventExecutorGroupshutdown in interface ExecutorServiceshutdown in class io.netty.util.concurrent.AbstractEventExecutorGrouppublic boolean isShuttingDown()
isShuttingDown in interface io.netty.util.concurrent.EventExecutorGrouppublic boolean isShutdown()
isShutdown in interface ExecutorServicepublic boolean isTerminated()
isTerminated in interface ExecutorServicepublic boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface ExecutorServiceInterruptedExceptionpublic ChannelFuture register(Channel channel)
EventLoopGroupChannel with an EventLoop from this EventLoopGroup. The returned
ChannelFuture will get notified once the registration is completed.
It's only safe to submit a new task to the EventLoop from within a
ChannelHandler once the ChannelPromise succeeded. Otherwise
the task may or may not be rejected.
register in interface EventLoopGrouppublic ChannelFuture register(Channel channel, ChannelPromise promise)
EventLoopGroupChannel with an EventLoop from this EventLoopGroup. The provided
ChannelPromise will get notified once the registration is completed. The returned ChannelFuture
is the same ChannelPromise that was passed to the method.
It's only safe to submit a new task to the EventLoop from within a
ChannelHandler once the ChannelPromise succeeded. Otherwise
the task may or may not be rejected.
register in interface EventLoopGroupCopyright © 2008–2015 The Netty Project. All rights reserved.