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 class
RemoteCommandJobRunner.RemoteCommandGrabber
Handles the job response.
-
Field Summary
Fields Modifier and Type Field Description protected Connection
m_RequestConnection
the connection to use for sending the command.protected Connection
m_ResponseConnection
the connection to use for sending back the response.protected JobRunner
m_ResponseJobRunner
the response JobRunner object.protected RemoteScriptingEngine
m_ResponseScriptingEngine
the 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
-
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 void
complete(Job j, JobResult jr)
Ignored.void
defineOptions()
Adds options to the internal list of options.protected String
doStart()
Performing actual start up.protected String
doStop()
Performing actual stop.protected String
doTerminate(boolean wait)
Performing actual terminate up.protected Connection
getDefaultRequestConnection()
Returns the default connection for sending the request.protected Connection
getDefaultResponseConnection()
Returns the default connection for sending the response back.protected RemoteScriptingEngine
getDefaultResponseScriptingEngine()
Returns the default connection for sending the response back.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.Connection
getRequestConnection()
Returns the connection to use for sending the request.Connection
getResponseConnection()
Returns the connection to use for sending the response back.JobRunner
getResponseJobRunner()
Returns the JobRunner sent back as response.RemoteScriptingEngine
getResponseScriptingEngine()
Returns the connection to use for sending the response back.String
globalInfo()
Returns a string describing the object.String
requestConnectionTipText()
Returns the tip text for this property.String
responseConnectionTipText()
Returns the tip text for this property.String
responseScriptingEngineTipText()
Returns the tip text for this property.void
setRequestConnection(Connection value)
Sets the connection to use for sending the request.void
setResponseConnection(Connection value)
Sets the connection to use for sending the response back.void
setResponseJobRunner(JobRunner value)
Sets the JobRunner sent back as response.void
setScriptingEngine(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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in 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
-
setScriptingEngine
public void setScriptingEngine(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:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in 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:
doStart
in classAbstractJobRunner
- Returns:
- null if successful, otherwise error message
- See Also:
AbstractMetaJobRunner.preStart()
-
doStop
protected String doStop()
Performing actual stop.- Specified by:
doStop
in classAbstractJobRunner
- Returns:
- null if successful, otherwise error message
-
doTerminate
protected String doTerminate(boolean wait)
Performing actual terminate up.- Specified by:
doTerminate
in classAbstractJobRunner
- Parameters:
wait
- whether to wait for the jobs to finish- Returns:
- null if successful, otherwise error message
-
-