org.apache.excalibur.event.command
Class TPSPThreadManager

java.lang.Object
  |
  +--org.apache.excalibur.event.command.TPSPThreadManager
All Implemented Interfaces:
Runnable, ThreadManager

public final class TPSPThreadManager
extends Object
implements Runnable, ThreadManager

This is a ThreadManager which provides a threadpool per Sink per EventPipeline. ::NOTE:: This is not implemented yet!

Author:
Berin Loritsch

Nested Class Summary
static class TPSPThreadManager.PipelineRunner
          The PipelineRunner will run the pipelines
 
Constructor Summary
TPSPThreadManager()
          The default constructor assumes there is a system property named "os.arch.cpus" that has a default for the number of CPUs on a system.
TPSPThreadManager(int maxThreadPerPool, long sleepTime)
          Constructor provides a specified number of threads per processor.
 
Method Summary
 void deregister(EventPipeline pipeline)
          Deregister an EventPipeline with the ThreadManager
 void deregisterAll()
          Deregisters all EventPipelines from this ThreadManager
 void register(EventPipeline pipeline)
          Register an EventPipeline with the ThreadManager.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TPSPThreadManager

public TPSPThreadManager()
                  throws Exception
The default constructor assumes there is a system property named "os.arch.cpus" that has a default for the number of CPUs on a system. Otherwise, the value is 1.

Throws:
Exception - if there is any problems creating the ThreadManager

TPSPThreadManager

public TPSPThreadManager(int maxThreadPerPool,
                         long sleepTime)
                  throws Exception
Constructor provides a specified number of threads per processor. If either value is less then one, then the value is rewritten as one.

Parameters:
maxThreadPerPool - The number of processors in the machine
sleepTime - The number of milliseconds to wait between cycles
Throws:
Exception - when there is a problem creating the ThreadManager
Method Detail

register

public void register(EventPipeline pipeline)
Register an EventPipeline with the ThreadManager.

Specified by:
register in interface ThreadManager
Parameters:
pipeline - The pipeline we are registering

deregister

public void deregister(EventPipeline pipeline)
Deregister an EventPipeline with the ThreadManager

Specified by:
deregister in interface ThreadManager
Parameters:
pipeline - The pipeline to unregister

deregisterAll

public void deregisterAll()
Deregisters all EventPipelines from this ThreadManager

Specified by:
deregisterAll in interface ThreadManager

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2002 Apache Avalon Project. All Rights Reserved.