Class NioClientBossPool
- java.lang.Object
-
- org.jboss.netty.channel.socket.nio.AbstractNioBossPool<NioClientBoss>
-
- org.jboss.netty.channel.socket.nio.NioClientBossPool
-
- All Implemented Interfaces:
BossPool<NioClientBoss>
,NioSelectorPool
,ExternalResourceReleasable
public class NioClientBossPool extends AbstractNioBossPool<NioClientBoss>
HoldsNioClientBoss
instances to use
-
-
Field Summary
Fields Modifier and Type Field Description private ThreadNameDeterminer
determiner
private boolean
stopTimer
private Timer
timer
-
Constructor Summary
Constructors Constructor Description NioClientBossPool(java.util.concurrent.Executor bossExecutor, int bossCount)
Create a new instance using a newHashedWheelTimer
and noThreadNameDeterminer
NioClientBossPool(java.util.concurrent.Executor bossExecutor, int bossCount, Timer timer, ThreadNameDeterminer determiner)
Create a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NioClientBoss
newBoss(java.util.concurrent.Executor executor)
Create a newBoss
which uses the givenExecutor
to service IOvoid
releaseExternalResources()
Releases the external resources that this object depends on.void
shutdown()
Shutdown theNioSelectorPool
and all internal created resources-
Methods inherited from class org.jboss.netty.channel.socket.nio.AbstractNioBossPool
init, nextBoss, rebuildSelectors
-
-
-
-
Field Detail
-
determiner
private final ThreadNameDeterminer determiner
-
timer
private final Timer timer
-
stopTimer
private boolean stopTimer
-
-
Constructor Detail
-
NioClientBossPool
public NioClientBossPool(java.util.concurrent.Executor bossExecutor, int bossCount, Timer timer, ThreadNameDeterminer determiner)
Create a new instance- Parameters:
bossExecutor
- the Executor to use for server theNioClientBoss
bossCount
- the number ofNioClientBoss
instances thisNioClientBossPool
will holdtimer
- the Timer to use for handle connect timeoutsdeterminer
- theThreadNameDeterminer
to use for name the threads. Usenull
if you not want to set one explicit.
-
NioClientBossPool
public NioClientBossPool(java.util.concurrent.Executor bossExecutor, int bossCount)
Create a new instance using a newHashedWheelTimer
and noThreadNameDeterminer
- Parameters:
bossExecutor
- the Executor to use for server theNioClientBoss
bossCount
- the number ofNioClientBoss
instances thisNioClientBoss
will hold
-
-
Method Detail
-
newBoss
protected NioClientBoss newBoss(java.util.concurrent.Executor executor)
Description copied from class:AbstractNioBossPool
Create a newBoss
which uses the givenExecutor
to service IO- Specified by:
newBoss
in classAbstractNioBossPool<NioClientBoss>
- Parameters:
executor
- theExecutor
to use- Returns:
- worker the new
Boss
-
shutdown
public void shutdown()
Description copied from interface:NioSelectorPool
Shutdown theNioSelectorPool
and all internal created resources- Specified by:
shutdown
in interfaceNioSelectorPool
- Overrides:
shutdown
in classAbstractNioBossPool<NioClientBoss>
-
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
- Overrides:
releaseExternalResources
in classAbstractNioBossPool<NioClientBoss>
-
-