This class contains the functionality which must be implemented by a runnable processor (that's a processor implementing the {@link org.jamesii.core.processor.IRunnable} interface. Runnable processorsshould use this class for this purpose! This does not only make your life easier but allows to easily exchange the implementation later on - e.g., if you require an alternative execution control.
An example on how to use this class can be found in the {@link org.jamesii.core.processor.RunnableProcessor} class.Basically there is a method in here which corresponds to a method in the IRunnable interface as can be easily seen in the following table.
IRunnable interface | Corresponding method here |
{@link org.jamesii.core.processor.IRunnable#isPausing()} | {@link #isPausing()} |
{@link org.jamesii.core.processor.IRunnable#isStopping()} | {@link #isStopping()} |
{@link org.jamesii.core.processor.IRunnable#isRunning()} | {@link #isRunning()} |
{@link org.jamesii.core.processor.IRunnable#run()} | {@link #run()} |
{@link org.jamesii.core.processor.IRunnable#run(IComputationTaskStopPolicy)} | {@link #run(IComputationTaskStopPolicy)} |
{@link org.jamesii.core.processor.IRunnable#next(int)} | {@link #next(int)} |
{@link org.jamesii.core.processor.IRunnable#pause()} | {@link #pause()} |
{@link org.jamesii.core.processor.IRunnable#stop()} | {@link #stop()} |
In addition this class provides two additional slots where hooks can be installed. One will be (if one is set) executed as soon as the simulation is no longer running, the other one can be used to observe any status {@link #getStatus()} change of the execution control.
@author Jan Himmelspach