org.neo.swarm.util.threads
Interface ThreadPool

All Known Implementing Classes:
OswegoThreadPool

public interface ThreadPool

Represents a generic threadpool implementation Exposes a set of thread related parameters to allow the pool to be managed.

Author:
navery

Method Summary
 void execute(java.lang.Runnable unitOfWork)
          Execute a Runnable impl using an internal thread
 int getMaximumPoolSize()
          The max available pool size.
 int getMinimumPoolSize()
          Minimum available pool size.
 int getPoolSize()
          Current number of threads in use.
 void setMaximumPoolSize(int poolSize)
          Set max thread limit, must also support dynamic resizing of the pool.
 void setMinimumPoolSize(int poolSize)
          Set min thread limit.
 void shutdown(int timeout)
          Timeout of 0 kills all threads, pending or executing, Greater values will allow the incoming queue to be processed, however blocked threads may cause an issue.
 

Method Detail

execute

public void execute(java.lang.Runnable unitOfWork)
             throws java.lang.InterruptedException
Execute a Runnable impl using an internal thread

Parameters:
unitOfWork -
Throws:
java.lang.InterruptedException

getMaximumPoolSize

public int getMaximumPoolSize()
The max available pool size.

Returns:

getMinimumPoolSize

public int getMinimumPoolSize()
Minimum available pool size.

Returns:

getPoolSize

public int getPoolSize()
Current number of threads in use.

Returns:

setMaximumPoolSize

public void setMaximumPoolSize(int poolSize)
Set max thread limit, must also support dynamic resizing of the pool.

Parameters:
poolSize -

setMinimumPoolSize

public void setMinimumPoolSize(int poolSize)
Set min thread limit.

Parameters:
poolSize -

shutdown

public void shutdown(int timeout)
Timeout of 0 kills all threads, pending or executing, Greater values will allow the incoming queue to be processed, however blocked threads may cause an issue. Oswego allows a Blocker handler to be used.

Parameters:
timeout -


Copyright © 2001-2004 SWARM-ONE -First Generation (S)calable(W)ide(AR)ea(M)esh. All Rights Reserved.