org.apache.excalibur.event.command
Class TPCThreadManager
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.excalibur.event.command.AbstractThreadManager
org.apache.excalibur.event.command.TPCThreadManager
- All Implemented Interfaces:
- Disposable, Initializable, LogEnabled, Parameterizable, java.lang.Runnable, ThreadManager
- public final class TPCThreadManager
- extends AbstractThreadManager
- implements Parameterizable
This is a ThreadManager that uses a certain number of threads per processor. The number of threads in the pool is a direct proportion to the number of processors. The size of the thread pool is (processors threads-per-processor) + 1
- Author:
| Fields inherited from interface org.apache.excalibur.event.command.ThreadManager |
ROLE |
| Method Summary |
protected void |
doDispose()
|
void |
initialize()
Set up the ThreadManager. |
void |
parameterize(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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_threadPool
private PooledExecutor m_threadPool
-
m_processors
private int m_processors
-
m_threadsPerProcessor
private int m_threadsPerProcessor
-
m_keepAliveTime
private int m_keepAliveTime
-
m_hardShutdown
private boolean m_hardShutdown
-
TPCThreadManager
public TPCThreadManager()
parameterize
public void parameterize(Parameters parameters)
throws ParameterException
-
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 |
-
- Specified by:
parameterize in interface Parameterizable
-
- Parameters:
parameters - The Parameters object
- Throws:
ParameterException - if there is a problem with the parameters.
initialize
public void initialize()
throws java.lang.Exception
- Description copied from class:
AbstractThreadManager
-
Set up the ThreadManager. All required parameters must have already been set.
-
- Specified by:
initialize in interface Initializable
- Overrides:
initialize in class AbstractThreadManager
-
- Throws:
java.lang.Exception - if there is any problem setting up the ThreadManager
doDispose
protected final void doDispose()
-
- Overrides:
doDispose in class AbstractThreadManager
-
Please see keelframework.org for information about new Keel releases.