public final class TPSPThreadManager
extends java.lang.Object
implements org.apache.excalibur.event.command.ThreadManager
ThreadManager which provides a threadpool per
Sink per EventPipeline. ::NOTE:: This is not
tested yet!| Modifier and Type | Class and Description |
|---|---|
protected static class |
TPSPThreadManager.SourceDequeueInterceptor
This is used to plug into Queues so that we can intercept calls to the dequeue operation.
|
protected static class |
TPSPThreadManager.SourceRunner
The SourceRunner is used to dequeue events one at a time.
|
| Modifier and Type | Field and Description |
|---|---|
private int |
m_margin |
private int |
m_maxThreadsPerPool |
private org.apache.commons.collections.StaticBucketMap |
m_pipelines |
private int |
m_threshold |
| Constructor and Description |
|---|
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,
int threshold)
Constructor provides a specified number of threads per processor.
|
TPSPThreadManager(int maxThreadPerPool,
int threshold,
int margin)
Constructor provides a specified number of threads per processor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deregister(org.apache.excalibur.event.command.EventPipeline pipeline)
Deregister an EventPipeline with the ThreadManager
|
void |
deregisterAll()
Deregisters all EventPipelines from this ThreadManager
|
void |
register(org.apache.excalibur.event.command.EventPipeline pipeline)
Register an EventPipeline with the ThreadManager.
|
private final org.apache.commons.collections.StaticBucketMap m_pipelines
private final int m_maxThreadsPerPool
private final int m_threshold
private final int m_margin
public TPSPThreadManager()
public TPSPThreadManager(int maxThreadPerPool,
int threshold)
maxThreadPerPool - The number of processors in the machinethreshold - The number of events before a new thread is startedpublic TPSPThreadManager(int maxThreadPerPool,
int threshold,
int margin)
maxThreadPerPool - The number of processors in the machinethreshold - The number of events before a new thread is startedmargin - The number of events +/- the threshold for thread evaluationpublic void register(org.apache.excalibur.event.command.EventPipeline pipeline)
register in interface org.apache.excalibur.event.command.ThreadManagerpipeline - The pipeline we are registeringpublic void deregister(org.apache.excalibur.event.command.EventPipeline pipeline)
deregister in interface org.apache.excalibur.event.command.ThreadManagerpipeline - The pipeline to unregisterpublic void deregisterAll()
deregisterAll in interface org.apache.excalibur.event.command.ThreadManager