public class OneThreadPolicy extends AbstractThreadPolicy
| Modifier and Type | Field and Description |
|---|---|
private EDU.oswego.cs.dl.util.concurrent.ThreadFactory |
m_factory |
private java.lang.Thread |
m_runner |
| Constructor and Description |
|---|
OneThreadPolicy() |
| Modifier and Type | Method and Description |
|---|---|
EventPipelineRunner |
createRunner(EventPipeline pipeline)
Create the
EventPipelineRunner that will be used to get
events from the Sources to the EventHandler. |
protected void |
process(java.util.Collection pipelines)
Do the actual management logic that needs to be done in each time
through the main loop.
|
void |
setThreadFactory(EDU.oswego.cs.dl.util.concurrent.ThreadFactory factory)
Set the ThreadFactory for the policy to use.
|
protected void |
startLoop()
Provide a hook to do further initialization when we start the
management loop.
|
java.lang.String |
toString() |
endLoop, executeLoop, isRunning, run, terminateLoopprivate EDU.oswego.cs.dl.util.concurrent.ThreadFactory m_factory
private java.lang.Thread m_runner
public void setThreadFactory(EDU.oswego.cs.dl.util.concurrent.ThreadFactory factory)
ThreadPolicyfactory - the factory to usepublic EventPipelineRunner createRunner(EventPipeline pipeline)
ThreadPolicyEventPipelineRunner that will be used to get
events from the Sources to the EventHandler.pipeline - the pipeline to runprotected void startLoop()
throws java.lang.InterruptedException
AbstractThreadPolicyAbstractThreadPolicy.run() method. This object is Runnable
so you can pass it in to a new thread.startLoop in class AbstractThreadPolicyjava.lang.InterruptedException - if the calling thread is interruptedprotected void process(java.util.Collection pipelines)
throws java.lang.Exception
AbstractThreadPolicyprocess in class AbstractThreadPolicypipelines - The pipelines to managejava.lang.Exception - if there is a problem or the thread is
interruptedpublic java.lang.String toString()
toString in class java.lang.Object