Package adams.scripting.engine
Class ForwardingScriptingEngine
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,Pausable
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,FlowContextHandler
,RemoteScriptingEngine
,RemoteCommandProcessorHandler
,Serializable
public class ForwardingScriptingEngine extends AbstractScriptingEngineEnhancer
Simply forwards incoming commands to the specified connection. TODO: directory for failed commands, reset failed commands on startup- Version:
- $Revision$
- 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
ForwardingScriptingEngine.RemoteCommandGrabber
Simply used to grab the remote commands from the base scripting engine.
-
Field Summary
Fields Modifier and Type Field Description protected Connection
m_Forward
the connection to forward the commands to.-
Fields inherited from class adams.scripting.engine.AbstractScriptingEngineEnhancer
m_ScriptingEngine
-
Fields inherited from class adams.scripting.engine.AbstractScriptingEngine
m_CommandHandler, m_CommandProcessor, m_FlowContext, m_Paused, m_PermissionHandler, m_RemoteScriptingEngineHandler, m_RequestHandler, m_ResponseHandler, m_Running, m_Stopped
-
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 ForwardingScriptingEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected String
doExecute()
Executes the scripting engine.String
forward(RemoteCommand cmd)
Forwards a command.String
forwardTipText()
Returns the tip text for this property.Connection
getForward()
Returns the connection to forward the commands to.String
globalInfo()
Returns a string describing the object.void
pauseExecution()
Pauses the execution.void
resumeExecution()
Resumes the execution.void
setForward(Connection value)
Sets the connection to forward the commands to.void
stopExecution()
Stops the execution.-
Methods inherited from class adams.scripting.engine.AbstractScriptingEngineEnhancer
executeJob, getDefaultScriptingEngine, getScriptingEngine, preExecute, scriptingEngineTipText, setScriptingEngine
-
Methods inherited from class adams.scripting.engine.AbstractScriptingEngine
commandProcessorTipText, execute, forCommandLine, forName, getCommandHandler, getCommandProcessor, getDefaultCommandHandler, getDefaultCommandProcessor, getDefaultPermissionHandler, getDefaultRequestHandler, getDefaultResponseHandler, getFlowContext, getPermissionHandler, getRemoteScriptingEngineHandler, getRequestHandler, getResponseHandler, initialize, isPaused, isRunning, isStopped, permissionHandlerTipText, requestHandlerTipText, responseHandlerTipText, runScriptingEngine, runScriptingEngine, setCommandHandler, setCommandProcessor, setFlowContext, setPermissionHandler, setRemoteScriptingEngineHandler, setRequestHandler, setResponseHandler
-
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_Forward
protected Connection m_Forward
the connection to forward the commands to.
-
-
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 classAbstractScriptingEngineEnhancer
-
setForward
public void setForward(Connection value)
Sets the connection to forward the commands to.- Parameters:
value
- the connection
-
getForward
public Connection getForward()
Returns the connection to forward the commands to.- Returns:
- the connection
-
forwardTipText
public String forwardTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
forward
public String forward(RemoteCommand cmd)
Forwards a command.- Parameters:
cmd
- the command to forward- Returns:
- null if successful, otherwise error message
-
doExecute
protected String doExecute()
Executes the scripting engine.- Overrides:
doExecute
in classAbstractScriptingEngineEnhancer
- Returns:
- error message in case of failure to start up or run, otherwise null
-
pauseExecution
public void pauseExecution()
Pauses the execution.- Specified by:
pauseExecution
in interfacePausable
- Overrides:
pauseExecution
in classAbstractScriptingEngineEnhancer
-
resumeExecution
public void resumeExecution()
Resumes the execution.- Specified by:
resumeExecution
in interfacePausable
- Overrides:
resumeExecution
in classAbstractScriptingEngineEnhancer
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceStoppable
- Overrides:
stopExecution
in classAbstractScriptingEngineEnhancer
-
-