Package adams.multiprocess
Class RemoteCommandJobRunner
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,Pausable,QuickInfoSupporter,SizeOfHandler,JobRunner,Serializable
public class RemoteCommandJobRunner extends AbstractMetaJobRunner
Utilizes the remote command framework for sending jobs to a remote machine.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteCommandJobRunner.RemoteCommandGrabberHandles the job response.
-
Field Summary
Fields Modifier and Type Field Description protected Connectionm_RequestConnectionthe connection to use for sending the command.protected Connectionm_ResponseConnectionthe connection to use for sending back the response.protected JobRunnerm_ResponseJobRunnerthe response JobRunner object.protected RemoteScriptingEnginem_ResponseScriptingEnginethe scriping engine to use for listening for the response.-
Fields inherited from class adams.multiprocess.AbstractMetaJobRunner
m_ActualJobRunner, m_JobCompleteListeners, m_JobRunner, m_Jobs
-
Fields inherited from class adams.multiprocess.AbstractJobRunner
m_FlowContext, m_Paused, m_Running, m_Terminating
-
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 RemoteCommandJobRunner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete(Job j, JobResult jr)Ignored.voiddefineOptions()Adds options to the internal list of options.protected StringdoStart()Performing actual start up.protected StringdoStop()Performing actual stop.protected StringdoTerminate(boolean wait)Performing actual terminate up.protected ConnectiongetDefaultRequestConnection()Returns the default connection for sending the request.protected ConnectiongetDefaultResponseConnection()Returns the default connection for sending the response back.protected RemoteScriptingEnginegetDefaultResponseScriptingEngine()Returns the default connection for sending the response back.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.ConnectiongetRequestConnection()Returns the connection to use for sending the request.ConnectiongetResponseConnection()Returns the connection to use for sending the response back.JobRunnergetResponseJobRunner()Returns the JobRunner sent back as response.RemoteScriptingEnginegetResponseScriptingEngine()Returns the connection to use for sending the response back.StringglobalInfo()Returns a string describing the object.StringrequestConnectionTipText()Returns the tip text for this property.StringresponseConnectionTipText()Returns the tip text for this property.StringresponseScriptingEngineTipText()Returns the tip text for this property.voidsetRequestConnection(Connection value)Sets the connection to use for sending the request.voidsetResponseConnection(Connection value)Sets the connection to use for sending the response back.voidsetResponseJobRunner(JobRunner value)Sets the JobRunner sent back as response.voidsetResponseScriptingEngine(RemoteScriptingEngine value)Sets the scripting engine to use for listening for the results.-
Methods inherited from class adams.multiprocess.AbstractMetaJobRunner
add, add, addJobCompleteListener, cleanUp, clear, getDefaultJobRunner, getJobRunner, getJobs, getTransferJobCompleteListeners, initialize, jobRunnerTipText, newActualJobRunner, preStart, removeJobCompleteListener, setJobRunner
-
Methods inherited from class adams.multiprocess.AbstractJobRunner
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, 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_RequestConnection
protected Connection m_RequestConnection
the connection to use for sending the command.
-
m_ResponseConnection
protected Connection m_ResponseConnection
the connection to use for sending back the response.
-
m_ResponseScriptingEngine
protected RemoteScriptingEngine m_ResponseScriptingEngine
the scriping engine to use for listening for the response.
-
m_ResponseJobRunner
protected JobRunner m_ResponseJobRunner
the response JobRunner object.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractMetaJobRunner
-
getDefaultRequestConnection
protected Connection getDefaultRequestConnection()
Returns the default connection for sending the request.- Returns:
- the connection
-
setRequestConnection
public void setRequestConnection(Connection value)
Sets the connection to use for sending the request.- Parameters:
value- the connection
-
getRequestConnection
public Connection getRequestConnection()
Returns the connection to use for sending the request.- Returns:
- the connection
-
requestConnectionTipText
public String requestConnectionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultResponseConnection
protected Connection getDefaultResponseConnection()
Returns the default connection for sending the response back.- Returns:
- the connection
-
setResponseConnection
public void setResponseConnection(Connection value)
Sets the connection to use for sending the response back.- Parameters:
value- the connection
-
getResponseConnection
public Connection getResponseConnection()
Returns the connection to use for sending the response back.- Returns:
- the connection
-
responseConnectionTipText
public String responseConnectionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultResponseScriptingEngine
protected RemoteScriptingEngine getDefaultResponseScriptingEngine()
Returns the default connection for sending the response back.- Returns:
- the connection
-
setResponseScriptingEngine
public void setResponseScriptingEngine(RemoteScriptingEngine value)
Sets the scripting engine to use for listening for the results.- Parameters:
value- the engine
-
getResponseScriptingEngine
public RemoteScriptingEngine getResponseScriptingEngine()
Returns the connection to use for sending the response back.- Returns:
- the connection
-
responseScriptingEngineTipText
public String responseScriptingEngineTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setResponseJobRunner
public void setResponseJobRunner(JobRunner value)
Sets the JobRunner sent back as response.- Parameters:
value- the job runner
-
getResponseJobRunner
public JobRunner getResponseJobRunner()
Returns the JobRunner sent back as response.- Returns:
- the job runner, null if not available
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractMetaJobRunner- Returns:
- null if no info available, otherwise short string
-
doStart
protected String doStart()
Performing actual start up. Only gets executed ifAbstractMetaJobRunner.preStart()was successful.- Specified by:
doStartin classAbstractJobRunner- Returns:
- null if successful, otherwise error message
- See Also:
AbstractMetaJobRunner.preStart()
-
doStop
protected String doStop()
Performing actual stop.- Specified by:
doStopin classAbstractJobRunner- Returns:
- null if successful, otherwise error message
-
doTerminate
protected String doTerminate(boolean wait)
Performing actual terminate up.- Specified by:
doTerminatein classAbstractJobRunner- Parameters:
wait- whether to wait for the jobs to finish- Returns:
- null if successful, otherwise error message
-
-