|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjconch.pipeline.impl.ExecutorThreadingModel
public class ExecutorThreadingModel
A wrapper around ThreadingModel which allows the user to leverage the
Executor API, and its myriad extensions. This class launches a
seperate thread to monitor the pipeline stage it is wrapping and populate the
executor, which means there can be multiple instances of this class in a
pipeline which execute asynchronously.
This class is thread safe: the state may be modified safely during execution.
This class is somewhat optimized for a common case: finalize() will
detect if a ThreadPoolExecutor is being used and will call
ThreadPoolExecutor.shutdown() to enable an orderly shutdown.
| Constructor Summary | |
|---|---|
ExecutorThreadingModel(Executor impl)
Constructor. |
|
| Method Summary | |
|---|---|
void |
execute(PipelineStage toRun)
Delegates the execution of the argument to the underlying executor. |
protected void |
finalize()
|
long |
getSpawnPeriod()
Gets the period between executor calls for instance. |
void |
setSpawnDelay(long spawnDelay)
Sets the period between executor calls for instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExecutorThreadingModel(Executor impl)
impl - The underlying implementation for execution.
org.apache.commons.lang.NullArgumentException - If the argument is null.| Method Detail |
|---|
public void execute(PipelineStage toRun)
PipelineStage.execute() is wrapped in its own
Runnable that is passed to the Executor implementation
provided.
execute in interface ThreadingModeltoRun - The stage to execute.
org.apache.commons.lang.NullArgumentException - If the argument is null.public long getSpawnPeriod()
public void setSpawnDelay(long spawnDelay)
spawnDelay - the new spawn period
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||