Package io.netty.channel
Class ThreadPerChannelEventLoopGroup
- java.lang.Object
-
- io.netty.util.concurrent.AbstractEventExecutorGroup
-
- io.netty.channel.ThreadPerChannelEventLoopGroup
-
- All Implemented Interfaces:
EventLoopGroup
,EventExecutorGroup
,java.lang.Iterable<EventExecutor>
,java.util.concurrent.Executor
,java.util.concurrent.ExecutorService
,java.util.concurrent.ScheduledExecutorService
- Direct Known Subclasses:
OioEventLoopGroup
@Deprecated public class ThreadPerChannelEventLoopGroup extends AbstractEventExecutorGroup implements EventLoopGroup
Deprecated.this will be remove in the next-major release.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ThreadPerChannelEventLoopGroup()
Deprecated.Create a newThreadPerChannelEventLoopGroup
with no limit in place.protected
ThreadPerChannelEventLoopGroup(int maxChannels)
Deprecated.Create a newThreadPerChannelEventLoopGroup
.protected
ThreadPerChannelEventLoopGroup(int maxChannels, java.util.concurrent.Executor executor, java.lang.Object... args)
Deprecated.Create a newThreadPerChannelEventLoopGroup
.protected
ThreadPerChannelEventLoopGroup(int maxChannels, java.util.concurrent.ThreadFactory threadFactory, java.lang.Object... args)
Deprecated.Create a newThreadPerChannelEventLoopGroup
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.boolean
isShutdown()
Deprecated.boolean
isShuttingDown()
Deprecated.Returnstrue
if and only if allEventExecutor
s managed by thisEventExecutorGroup
are being shut down gracefully or was shut down.boolean
isTerminated()
Deprecated.java.util.Iterator<EventExecutor>
iterator()
Deprecated.protected EventLoop
newChild(java.lang.Object... args)
Deprecated.Creates a newEventLoop
.EventLoop
next()
Deprecated.Return the nextEventLoop
to useChannelFuture
register(Channel channel)
Deprecated.ChannelFuture
register(ChannelPromise promise)
Deprecated.ChannelFuture
register(Channel channel, ChannelPromise promise)
Deprecated.void
shutdown()
Deprecated.Future<?>
shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.Signals this executor that the caller wants the executor to be shut down.Future<?>
terminationFuture()
Deprecated.Returns theFuture
which is notified when allEventExecutor
s managed by thisEventExecutorGroup
have been terminated.-
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
schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submit
-
-
-
-
Constructor Detail
-
ThreadPerChannelEventLoopGroup
protected ThreadPerChannelEventLoopGroup()
Deprecated.Create a newThreadPerChannelEventLoopGroup
with no limit in place.
-
ThreadPerChannelEventLoopGroup
protected ThreadPerChannelEventLoopGroup(int maxChannels)
Deprecated.Create a newThreadPerChannelEventLoopGroup
.- Parameters:
maxChannels
- the maximum number of channels to handle with this instance. Once you try to register a newChannel
and the maximum is exceed it will throw anChannelException
. on theregister(Channel)
andregister(ChannelPromise)
method. Use0
to use no limit
-
ThreadPerChannelEventLoopGroup
protected ThreadPerChannelEventLoopGroup(int maxChannels, java.util.concurrent.ThreadFactory threadFactory, java.lang.Object... args)
Deprecated.Create a newThreadPerChannelEventLoopGroup
.- Parameters:
maxChannels
- the maximum number of channels to handle with this instance. Once you try to register a newChannel
and the maximum is exceed it will throw anChannelException
on theregister(Channel)
andregister(ChannelPromise)
method. Use0
to use no limitthreadFactory
- theThreadFactory
used to create newThread
instances that handle the registeredChannel
sargs
- arguments which will passed to eachnewChild(Object...)
call.
-
ThreadPerChannelEventLoopGroup
protected ThreadPerChannelEventLoopGroup(int maxChannels, java.util.concurrent.Executor executor, java.lang.Object... args)
Deprecated.Create a newThreadPerChannelEventLoopGroup
.- Parameters:
maxChannels
- the maximum number of channels to handle with this instance. Once you try to register a newChannel
and the maximum is exceed it will throw anChannelException
on theregister(Channel)
andregister(ChannelPromise)
method. Use0
to use no limitexecutor
- theExecutor
used to create newThread
instances that handle the registeredChannel
sargs
- arguments which will passed to eachnewChild(Object...)
call.
-
-
Method Detail
-
newChild
protected EventLoop newChild(java.lang.Object... args) throws java.lang.Exception
Deprecated.Creates a newEventLoop
. The default implementation creates a newThreadPerChannelEventLoop
.- Throws:
java.lang.Exception
-
iterator
public java.util.Iterator<EventExecutor> iterator()
Deprecated.- Specified by:
iterator
in interfaceEventExecutorGroup
- Specified by:
iterator
in interfacejava.lang.Iterable<EventExecutor>
-
next
public EventLoop next()
Deprecated.Description copied from interface:EventLoopGroup
Return the nextEventLoop
to use- Specified by:
next
in interfaceEventExecutorGroup
- Specified by:
next
in interfaceEventLoopGroup
-
shutdownGracefully
public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.Description copied from interface:EventExecutorGroup
Signals this executor that the caller wants the executor to be shut down. Once this method is called,EventExecutorGroup.isShuttingDown()
starts to returntrue
, and the executor prepares to shut itself down. UnlikeEventExecutorGroup.shutdown()
, graceful shutdown ensures that no tasks are submitted for 'the quiet period' (usually a couple seconds) before it shuts itself down. If a task is submitted during the quiet period, it is guaranteed to be accepted and the quiet period will start over.- Specified by:
shutdownGracefully
in interfaceEventExecutorGroup
- Parameters:
quietPeriod
- the quiet period as described in the documentationtimeout
- the maximum amount of time to wait until the executor is EventExecutorGroup.shutdown() regardless if a task was submitted during the quiet periodunit
- the unit ofquietPeriod
andtimeout
- Returns:
- the
EventExecutorGroup.terminationFuture()
-
terminationFuture
public Future<?> terminationFuture()
Deprecated.Description copied from interface:EventExecutorGroup
Returns theFuture
which is notified when allEventExecutor
s managed by thisEventExecutorGroup
have been terminated.- Specified by:
terminationFuture
in interfaceEventExecutorGroup
-
shutdown
@Deprecated public void shutdown()
Deprecated.- Specified by:
shutdown
in interfaceEventExecutorGroup
- Specified by:
shutdown
in interfacejava.util.concurrent.ExecutorService
- Specified by:
shutdown
in classAbstractEventExecutorGroup
-
isShuttingDown
public boolean isShuttingDown()
Deprecated.Description copied from interface:EventExecutorGroup
Returnstrue
if and only if allEventExecutor
s managed by thisEventExecutorGroup
are being shut down gracefully or was shut down.- Specified by:
isShuttingDown
in interfaceEventExecutorGroup
-
isShutdown
public boolean isShutdown()
Deprecated.- Specified by:
isShutdown
in interfacejava.util.concurrent.ExecutorService
-
isTerminated
public boolean isTerminated()
Deprecated.- Specified by:
isTerminated
in interfacejava.util.concurrent.ExecutorService
-
awaitTermination
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Deprecated.- Specified by:
awaitTermination
in interfacejava.util.concurrent.ExecutorService
- Throws:
java.lang.InterruptedException
-
register
public ChannelFuture register(Channel channel)
Deprecated.Description copied from interface:EventLoopGroup
Register aChannel
with thisEventLoop
. The returnedChannelFuture
will get notified once the registration was complete.- Specified by:
register
in interfaceEventLoopGroup
-
register
public ChannelFuture register(ChannelPromise promise)
Deprecated.Description copied from interface:EventLoopGroup
Register aChannel
with thisEventLoop
using aChannelFuture
. The passedChannelFuture
will get notified once the registration was complete and also will get returned.- Specified by:
register
in interfaceEventLoopGroup
-
register
@Deprecated public ChannelFuture register(Channel channel, ChannelPromise promise)
Deprecated.Description copied from interface:EventLoopGroup
Register aChannel
with thisEventLoop
. The passedChannelFuture
will get notified once the registration was complete and also will get returned.- Specified by:
register
in interfaceEventLoopGroup
-
-