|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.excalibur.event.command.AbstractThreadManager
public abstract class AbstractThreadManager
Abstract base class for a ThreadManager that has a single ThreadPool for all pipelines
| Nested Class Summary | |
|---|---|
static class |
AbstractThreadManager.PipelineRunner
The PipelineRunner class pulls all the events from the Source, and puts them in the EventHandler. |
| Field Summary | |
|---|---|
private boolean |
m_done
Whether we are done or not |
private EDU.oswego.cs.dl.util.concurrent.Executor |
m_executor
The ThreadPool we are using |
private boolean |
m_initialized
Whether this class has been initialized or not |
private org.apache.commons.collections.StaticBucketMap |
m_pipelines
The pipelines we are managing |
private long |
m_sleepTime
The number of milliseconds to sleep before runngin again: 1000 (1 sec.) |
| Fields inherited from interface org.apache.excalibur.event.command.ThreadManager |
|---|
ROLE |
| Constructor Summary | |
|---|---|
AbstractThreadManager()
|
|
| Method Summary | |
|---|---|
void |
deregister(org.apache.excalibur.event.command.EventPipeline pipeline)
Deregister an EventPipeline with the ThreadManager |
void |
deregisterAll()
Deregisters all EventPipelines from this ThreadManager |
void |
dispose()
Get rid of the ThreadManager. |
protected void |
doDispose()
|
protected long |
getSleepTime()
Get the current amount of sleep time. |
void |
initialize()
Set up the ThreadManager. |
protected boolean |
isInitialized()
Return whether the thread manager has been initialized or not |
void |
register(org.apache.excalibur.event.command.EventPipeline pipeline)
Register an EventPipeline with the ThreadManager. |
void |
run()
The code that is run in the background to manage the ThreadPool and the EventPipelines |
protected void |
setExecutor(EDU.oswego.cs.dl.util.concurrent.Executor executor)
Set the executor we are using |
protected void |
setSleepTime(long sleepTime)
Set the amount of time to sleep between checks on the queue |
| 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 |
| Methods inherited from interface org.apache.excalibur.event.command.ThreadManager |
|---|
|
| Field Detail |
|---|
private final org.apache.commons.collections.StaticBucketMap m_pipelines
private EDU.oswego.cs.dl.util.concurrent.Executor m_executor
private volatile boolean m_done
private long m_sleepTime
private volatile boolean m_initialized
| Constructor Detail |
|---|
public AbstractThreadManager()
| Method Detail |
|---|
protected boolean isInitialized()
protected void setSleepTime(long sleepTime)
sleepTime - Number of millisecondsprotected long getSleepTime()
protected void setExecutor(EDU.oswego.cs.dl.util.concurrent.Executor executor)
executor - to use
public void initialize()
throws java.lang.Exception
initialize in interface org.apache.avalon.framework.activity.Initializablejava.lang.Exception - if there is any problem setting up the ThreadManagerpublic 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 we are de-registeringpublic void deregisterAll()
deregisterAll in interface org.apache.excalibur.event.command.ThreadManagerpublic void dispose()
dispose in interface org.apache.avalon.framework.activity.Disposableprotected void doDispose()
public void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||