Class AbstractNioBossPool<E extends Boss>
java.lang.Object
org.jboss.netty.channel.socket.nio.AbstractNioBossPool<E>
- All Implemented Interfaces:
BossPool<E>
,NioSelectorPool
,ExternalResourceReleasable
- Direct Known Subclasses:
NioClientBossPool
,NioServerBossPool
public abstract class AbstractNioBossPool<E extends Boss>
extends Object
implements BossPool<E>, ExternalResourceReleasable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Boss[]
private final Executor
private final AtomicInteger
private static final int
The boss pool raises an exception unless all boss threads start and run within this timeout (in seconds.)private final AtomicBoolean
private static final InternalLogger
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractNioBossPool
(Executor bossExecutor, int bossCount) Create a new instanceAbstractNioBossPool
(Executor bossExecutor, int bossCount, boolean autoInit) -
Method Summary
-
Field Details
-
INITIALIZATION_TIMEOUT
private static final int INITIALIZATION_TIMEOUTThe boss pool raises an exception unless all boss threads start and run within this timeout (in seconds.)- See Also:
-
logger
-
bosses
-
bossIndex
-
bossExecutor
-
initialized
-
-
Constructor Details
-
Method Details
-
init
protected void init() -
waitForBossThreads
private void waitForBossThreads() -
newBoss
-
nextBoss
Description copied from interface:BossPool
Return the nextBoss
to use -
rebuildSelectors
public void rebuildSelectors()Description copied from interface:NioSelectorPool
Replaces the currentSelector
s of theBoss
es with newSelector
s to work around the infamous epoll 100% CPU bug.- Specified by:
rebuildSelectors
in interfaceNioSelectorPool
-
releaseExternalResources
public void releaseExternalResources()Description copied from interface:ExternalResourceReleasable
Releases the external resources that this object depends on. You should not call this method if the external resources (e.g. thread pool) are in use by other objects.- Specified by:
releaseExternalResources
in interfaceExternalResourceReleasable
-
shutdown
public void shutdown()Description copied from interface:NioSelectorPool
Shutdown theNioSelectorPool
and all internal created resources- Specified by:
shutdown
in interfaceNioSelectorPool
-