public final class TPCThreadManager extends AbstractThreadManager implements org.apache.avalon.framework.parameters.Parameterizable
AbstractThreadManager.PipelineRunner| Modifier and Type | Field and Description |
|---|---|
private boolean |
m_hardShutdown |
private int |
m_keepAliveTime |
private int |
m_processors |
private EDU.oswego.cs.dl.util.concurrent.PooledExecutor |
m_threadPool |
private int |
m_threadsPerProcessor |
| Constructor and Description |
|---|
TPCThreadManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDispose() |
void |
initialize()
Set up the ThreadManager.
|
void |
parameterize(org.apache.avalon.framework.parameters.Parameters parameters)
The following parameters can be set for this class:
Name Description Default Value
processors
Number of processors (autodetected if less than one)
Results from SystemUtil.numProcessors()
threads-per-processor
Threads per processor to use (Rewritten to 1 if less than one)
1
sleep-time
Time (in milliseconds) to wait between queue pipeline processing runs
1000
keep-alive-time
Time (in milliseconds) that idle threads should remain in the threadpool
300000
force-shutdown
At shutdown time, allow currently queued tasks to finish, or immediately quit
false
|
deregister, deregisterAll, dispose, getSleepTime, isInitialized, register, run, setExecutor, setSleepTimeenableLogging, getLogger, setupLogger, setupLogger, setupLoggerprivate EDU.oswego.cs.dl.util.concurrent.PooledExecutor m_threadPool
private int m_processors
private int m_threadsPerProcessor
private int m_keepAliveTime
private boolean m_hardShutdown
public void parameterize(org.apache.avalon.framework.parameters.Parameters parameters)
throws org.apache.avalon.framework.parameters.ParameterException
| Name | Description | Default Value |
|---|---|---|
| processors | Number of processors (autodetected if less than one) | Results from SystemUtil.numProcessors() |
| threads-per-processor | Threads per processor to use (Rewritten to 1 if less than one) | 1 |
| sleep-time | Time (in milliseconds) to wait between queue pipeline processing runs | 1000 |
| keep-alive-time | Time (in milliseconds) that idle threads should remain in the threadpool | 300000 |
| force-shutdown | At shutdown time, allow currently queued tasks to finish, or immediately quit | false |
parameterize in interface org.apache.avalon.framework.parameters.Parameterizableparameters - The Parameters objectorg.apache.avalon.framework.parameters.ParameterException - if there is a problem with the parameters.public void initialize()
throws java.lang.Exception
AbstractThreadManagerinitialize in interface org.apache.avalon.framework.activity.Initializableinitialize in class AbstractThreadManagerjava.lang.Exception - if there is any problem setting up the ThreadManagerprotected final void doDispose()
doDispose in class AbstractThreadManager