Package adams.multiprocess
Class AbstractMetaJobRunner
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.multiprocess.AbstractJobRunner
-
- adams.multiprocess.AbstractMetaJobRunner
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,Pausable
,QuickInfoSupporter
,SizeOfHandler
,JobRunner
,Serializable
- Direct Known Subclasses:
RemoteCommandJobRunner
,ScpJobRunner
,ScpJobRunner.RemoteJobRunner
,SerializingJobRunner
public abstract class AbstractMetaJobRunner extends AbstractJobRunner
Ancestor for meta-jobrunners, that wrap around a base jobrunner.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JobRunner
m_ActualJobRunner
the actual jobrunner.protected HashSet<JobCompleteListener>
m_JobCompleteListeners
call when job complete.protected JobRunner
m_JobRunner
the base jobrunner to use.protected List<Job>
m_Jobs
the list of jobs.-
Fields inherited from class adams.multiprocess.AbstractJobRunner
m_FlowContext, m_Paused, m_Running
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractMetaJobRunner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Job job)
Adds the job to the execution queue.void
add(JobList jobs)
Adds the jobs to the execution queue.void
addJobCompleteListener(JobCompleteListener l)
Adds the listener.void
cleanUp()
Cleans up data structures, frees up memory.void
clear()
Clears all jobs.void
defineOptions()
Adds options to the internal list of options.protected JobRunner
getDefaultJobRunner()
Returns the default jobrunner.JobRunner
getJobRunner()
Returns the base jobrunner.List<T>
getJobs()
Returns the list of queued jobs.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.protected boolean
getTransferJobCompleteListeners()
Returns whether to transfer the listeners to the actual job runner.protected void
initialize()
Initializes the members.String
jobRunnerTipText()
Returns the tip text for this property.protected JobRunner
newActualJobRunner()
Returns an instance of the actual job runner to use.protected String
preStart()
Before actual start up.void
removeJobCompleteListener(JobCompleteListener l)
Removes the listener.void
setJobRunner(JobRunner value)
Sets the base jobrunner.-
Methods inherited from class adams.multiprocess.AbstractJobRunner
doStart, doStop, doTerminate, getFlowContext, isPaused, isRunning, pauseExecution, postStart, postStop, postTerminate, preStop, preTerminate, resumeExecution, setFlowContext, start, stop, terminate, terminate
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_JobRunner
protected JobRunner m_JobRunner
the base jobrunner to use.
-
m_JobCompleteListeners
protected transient HashSet<JobCompleteListener> m_JobCompleteListeners
call when job complete.
-
m_ActualJobRunner
protected JobRunner m_ActualJobRunner
the actual jobrunner.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractJobRunner
-
getDefaultJobRunner
protected JobRunner getDefaultJobRunner()
Returns the default jobrunner.- Returns:
- the jobrunner
-
setJobRunner
public void setJobRunner(JobRunner value)
Sets the base jobrunner.- Parameters:
value
- the jobrunner
-
getJobRunner
public JobRunner getJobRunner()
Returns the base jobrunner.- Returns:
- the jobrunner
-
jobRunnerTipText
public String jobRunnerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Returns:
- null if no info available, otherwise short string
-
clear
public void clear()
Clears all jobs.
-
add
public void add(Job job)
Adds the job to the execution queue.- Parameters:
job
- the job to add
-
add
public void add(JobList jobs)
Adds the jobs to the execution queue.- Parameters:
jobs
- the jobs to add
-
addJobCompleteListener
public void addJobCompleteListener(JobCompleteListener l)
Adds the listener.- Parameters:
l
- the listener to add
-
removeJobCompleteListener
public void removeJobCompleteListener(JobCompleteListener l)
Removes the listener.- Parameters:
l
- the listener to remove
-
newActualJobRunner
protected JobRunner newActualJobRunner()
Returns an instance of the actual job runner to use.- Returns:
- the job runner to use
-
getTransferJobCompleteListeners
protected boolean getTransferJobCompleteListeners()
Returns whether to transfer the listeners to the actual job runner.- Returns:
- true if to transfer
- See Also:
addJobCompleteListener(JobCompleteListener)
,removeJobCompleteListener(JobCompleteListener)
-
preStart
protected String preStart()
Before actual start up.- Overrides:
preStart
in classAbstractJobRunner
- Returns:
- null if successful, otherwise error message
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceCleanUpHandler
- Overrides:
cleanUp
in classAbstractJobRunner
-
-