com.maverick.nio
Class SelectorThreadPool

java.lang.Object
  extended by com.maverick.nio.SelectorThreadPool

public class SelectorThreadPool
extends java.lang.Object

Maintains a pool of SelectoThreads increasing the pool when required and always maintaining the minimum number of permanent threads required.

Author:
Lee David Painter

Constructor Summary
SelectorThreadPool(SelectorThreadImpl impl, int permanentThreads, int maximumChannels, int idleServicePeriod, int inactivePeriodsPerIdleEvent, java.nio.channels.spi.SelectorProvider selectorProvider)
          Construct a thread pool.
 
Method Summary
 SelectorThread selectNextThread()
          Select the next available thread with the minimum load.
 void shutdown()
          Shutdown all threads in the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectorThreadPool

public SelectorThreadPool(SelectorThreadImpl impl,
                          int permanentThreads,
                          int maximumChannels,
                          int idleServicePeriod,
                          int inactivePeriodsPerIdleEvent,
                          java.nio.channels.spi.SelectorProvider selectorProvider)
                   throws java.io.IOException
Construct a thread pool.

Parameters:
impl - SelectorThreadImpl
permanentThreads - int
maximumChannels - int
idleServicePeriod - int
inactivePeriodsPerIdleEvent - int
selectorProvider - SelectorProvider
Throws:
java.io.IOException
Method Detail

shutdown

public void shutdown()
Shutdown all threads in the pool.


selectNextThread

public SelectorThread selectNextThread()
                                throws java.io.IOException
Select the next available thread with the minimum load.

Returns:
SelectorThread
Throws:
java.io.IOException


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.