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 protectedThreadPerChannelEventLoopGroup()Deprecated.Create a newThreadPerChannelEventLoopGroupwith no limit in place.protectedThreadPerChannelEventLoopGroup(int maxChannels)Deprecated.Create a newThreadPerChannelEventLoopGroup.protectedThreadPerChannelEventLoopGroup(int maxChannels, java.util.concurrent.Executor executor, java.lang.Object... args)Deprecated.Create a newThreadPerChannelEventLoopGroup.protectedThreadPerChannelEventLoopGroup(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 booleanawaitTermination(long timeout, java.util.concurrent.TimeUnit unit)Deprecated.booleanisShutdown()Deprecated.booleanisShuttingDown()Deprecated.Returnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.booleanisTerminated()Deprecated.java.util.Iterator<EventExecutor>iterator()Deprecated.protected EventLoopnewChild(java.lang.Object... args)Deprecated.Creates a newEventLoop.EventLoopnext()Deprecated.Return the nextEventLoopto useChannelFutureregister(Channel channel)Deprecated.ChannelFutureregister(ChannelPromise promise)Deprecated.ChannelFutureregister(Channel channel, ChannelPromise promise)Deprecated.voidshutdown()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 theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave 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, ticker
-
-
-
-
Constructor Detail
-
ThreadPerChannelEventLoopGroup
protected ThreadPerChannelEventLoopGroup()
Deprecated.Create a newThreadPerChannelEventLoopGroupwith 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 newChanneland the maximum is exceed it will throw anChannelException. on theregister(Channel)andregister(ChannelPromise)method. Use0to 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 newChanneland the maximum is exceed it will throw anChannelExceptionon theregister(Channel)andregister(ChannelPromise)method. Use0to use no limitthreadFactory- theThreadFactoryused to create newThreadinstances that handle the registeredChannelsargs- 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 newChanneland the maximum is exceed it will throw anChannelExceptionon theregister(Channel)andregister(ChannelPromise)method. Use0to use no limitexecutor- theExecutorused to create newThreadinstances that handle the registeredChannelsargs- 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:
iteratorin interfaceEventExecutorGroup- Specified by:
iteratorin interfacejava.lang.Iterable<EventExecutor>
-
next
public EventLoop next()
Deprecated.Description copied from interface:EventLoopGroupReturn the nextEventLoopto use- Specified by:
nextin interfaceEventExecutorGroup- Specified by:
nextin interfaceEventLoopGroup
-
shutdownGracefully
public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.Description copied from interface:EventExecutorGroupSignals 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:
shutdownGracefullyin 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 ofquietPeriodandtimeout- Returns:
- the
EventExecutorGroup.terminationFuture()
-
terminationFuture
public Future<?> terminationFuture()
Deprecated.Description copied from interface:EventExecutorGroupReturns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated.- Specified by:
terminationFuturein interfaceEventExecutorGroup
-
shutdown
@Deprecated public void shutdown()
Deprecated.- Specified by:
shutdownin interfaceEventExecutorGroup- Specified by:
shutdownin interfacejava.util.concurrent.ExecutorService- Specified by:
shutdownin classAbstractEventExecutorGroup
-
isShuttingDown
public boolean isShuttingDown()
Deprecated.Description copied from interface:EventExecutorGroupReturnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.- Specified by:
isShuttingDownin interfaceEventExecutorGroup
-
isShutdown
public boolean isShutdown()
Deprecated.- Specified by:
isShutdownin interfacejava.util.concurrent.ExecutorService
-
isTerminated
public boolean isTerminated()
Deprecated.- Specified by:
isTerminatedin interfacejava.util.concurrent.ExecutorService
-
awaitTermination
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedExceptionDeprecated.- Specified by:
awaitTerminationin interfacejava.util.concurrent.ExecutorService- Throws:
java.lang.InterruptedException
-
register
public ChannelFuture register(Channel channel)
Deprecated.Description copied from interface:EventLoopGroupRegister aChannelwith thisEventLoop. The returnedChannelFuturewill get notified once the registration was complete.- Specified by:
registerin interfaceEventLoopGroup
-
register
public ChannelFuture register(ChannelPromise promise)
Deprecated.Description copied from interface:EventLoopGroupRegister aChannelwith thisEventLoopusing aChannelFuture. The passedChannelFuturewill get notified once the registration was complete and also will get returned.- Specified by:
registerin interfaceEventLoopGroup
-
register
@Deprecated public ChannelFuture register(Channel channel, ChannelPromise promise)
Deprecated.Description copied from interface:EventLoopGroupRegister aChannelwith thisEventLoop. The passedChannelFuturewill get notified once the registration was complete and also will get returned.- Specified by:
registerin interfaceEventLoopGroup
-
-