Package adams.multiprocess
Interface JobRunner<T extends Job>
-
- All Superinterfaces:
CleanUpHandler,Destroyable,OptionHandler,Pausable,QuickInfoSupporter
- All Known Implementing Classes:
AbstractJobRunner,AbstractMetaJobRunner,LocalJobRunner,RemoteCommandJobRunner,ScpJobRunner,ScpJobRunner.RemoteJobRunner,SerializingJobRunner
public interface JobRunner<T extends Job> extends Pausable, OptionHandler, CleanUpHandler, QuickInfoSupporter
Interface for runners that execute jobs.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(JobList<T> jobs)Adds the jobs to the execution queue.voidadd(T job)Adds the job to the execution queue.voidaddJobCompleteListener(JobCompleteListener l)Adds the listener.voidclear()Clears all jobs.voidcomplete(T j, JobResult jr)Job is complete, so check for more to add..ActorgetFlowContext()Return the flow context, if any.List<T>getJobs()Returns the list of queued jobs.booleanisPaused()Returns whether the object is currently paused.booleanisRunning()Returns whether the job are being executed.voidpauseExecution()Pauses the execution.voidremoveJobCompleteListener(JobCompleteListener l)Removes the listener.voidresumeExecution()Resumes the execution.voidsetFlowContext(Actor value)Sets the flow context, if any.voidstart()Starts the execution of jobs.voidstop()Stops the execution after all currently queued jobs have been executed.voidterminate()Stops the execution immediately.voidterminate(boolean wait)Stops the execution immediately.-
Methods inherited from interface adams.core.CleanUpHandler
cleanUp
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, defineOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.core.QuickInfoSupporter
getQuickInfo
-
-
-
-
Method Detail
-
addJobCompleteListener
void addJobCompleteListener(JobCompleteListener l)
Adds the listener.- Parameters:
l- the listener to add
-
removeJobCompleteListener
void removeJobCompleteListener(JobCompleteListener l)
Removes the listener.- Parameters:
l- the listener to remove
-
clear
void clear()
Clears all jobs.
-
add
void add(T job)
Adds the job to the execution queue.- Parameters:
job- the job to add
-
add
void add(JobList<T> jobs)
Adds the jobs to the execution queue.- Parameters:
jobs- the jobs to add
-
start
void start()
Starts the execution of jobs.
-
stop
void stop()
Stops the execution after all currently queued jobs have been executed.
-
terminate
void terminate()
Stops the execution immediately. Waits for the jobs to finish.
-
terminate
void terminate(boolean wait)
Stops the execution immediately.- Parameters:
wait- whether to wait for the jobs to finish
-
complete
void complete(T j, JobResult jr)
Job is complete, so check for more to add..- Parameters:
j- jobjr- job result
-
isRunning
boolean isRunning()
Returns whether the job are being executed.- Returns:
- true if jobs are being executed
-
pauseExecution
void pauseExecution()
Pauses the execution.- Specified by:
pauseExecutionin interfacePausable
-
isPaused
boolean isPaused()
Returns whether the object is currently paused.
-
resumeExecution
void resumeExecution()
Resumes the execution.- Specified by:
resumeExecutionin interfacePausable
-
setFlowContext
void setFlowContext(Actor value)
Sets the flow context, if any.- Parameters:
value- the context
-
getFlowContext
Actor getFlowContext()
Return the flow context, if any.- Returns:
- the context, null if none available
-
-