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, 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:
Berin Loritsch, Peter Royal

Nested Class Summary
 
Nested classes inherited from class org.apache.excalibur.event.command.AbstractThreadManager
AbstractThreadManager.PipelineRunner
 
Constructor Summary
TPCThreadManager()
           
 
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 block-timeout Time (in milliseconds) to wait for a thread to process a pipeline 1000
 
Methods inherited from class org.apache.excalibur.event.command.AbstractThreadManager
deregister, deregisterAll, dispose, getSleepTime, isInitialized, register, run, setExecutor, setSleepTime
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TPCThreadManager

public TPCThreadManager()
Method Detail

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
block-timeout Time (in milliseconds) to wait for a thread to process a pipeline 1000

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 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:
Exception - if there is any problem setting up the ThreadManager

doDispose

protected final void doDispose()
Overrides:
doDispose in class AbstractThreadManager


Copyright © 2002 Apache Avalon Project. All Rights Reserved.