|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.d_haven.event.command.DefaultThreadManager
public class DefaultThreadManager
The DefaultThreadManager is a very flexible implementation that should be able to solve just about any need. The ThreadManager portion of code manages the list of registered pipelines while the actual process of making events go through the pipeline is performed by the ThreadPolicy. The DefaultThreadManager will run all the events through all the pipelines in one background thread. If you supply a different ThreadPolicy, it will obey those rules.
Field Summary | |
---|---|
private java.util.List |
m_pipelines
|
private ThreadPolicy |
m_policy
|
Constructor Summary | |
---|---|
DefaultThreadManager()
Create the DefaultThreadManager using the OneThreadPolicy as the way to run events through the pipelines. |
|
DefaultThreadManager(ThreadPolicy policy)
Create the DefaultThreadManager using the ThreadPolicy of your choice. |
Method Summary | |
---|---|
java.util.Collection |
getRegisteredPipelines()
Return a copy of all the pipelines registered at this point. |
void |
register(EventPipeline pipeline)
Register an EventPipeline with the ThreadManager. |
void |
stop()
Stop the ThreadManager from running the pipelines. |
java.lang.String |
toString()
|
void |
unregister(EventPipeline pipeline)
Unregister an EventPipeline with the ThreadManager. |
void |
unregisterAll()
Unregisters all EventPipelines from this ThreadManager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final java.util.List m_pipelines
private final ThreadPolicy m_policy
Constructor Detail |
---|
public DefaultThreadManager()
public DefaultThreadManager(ThreadPolicy policy)
policy
- the ThreadPolicy
to useMethod Detail |
---|
public java.util.Collection getRegisteredPipelines()
getRegisteredPipelines
in interface ThreadManager
public void register(EventPipeline pipeline)
register
in interface ThreadManager
pipeline
- The pipeline to registerpublic void unregister(EventPipeline pipeline)
unregister
in interface ThreadManager
pipeline
- The pipeline to unregisterpublic void unregisterAll()
unregisterAll
in interface ThreadManager
public void stop()
stop
in interface ThreadManager
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |