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 classForwardingScriptingEngine.RemoteCommandGrabberSimply used to grab the remote commands from the base scripting engine.
-
Field Summary
Fields Modifier and Type Field Description protected Connectionm_Forwardthe 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 voiddefineOptions()Adds options to the internal list of options.protected StringdoExecute()Executes the scripting engine.Stringforward(RemoteCommand cmd)Forwards a command.StringforwardTipText()Returns the tip text for this property.ConnectiongetForward()Returns the connection to forward the commands to.StringglobalInfo()Returns a string describing the object.voidpauseExecution()Pauses the execution.voidresumeExecution()Resumes the execution.voidsetForward(Connection value)Sets the connection to forward the commands to.voidstopExecution()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:
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 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:
doExecutein classAbstractScriptingEngineEnhancer- Returns:
- error message in case of failure to start up or run, otherwise null
-
pauseExecution
public void pauseExecution()
Pauses the execution.- Specified by:
pauseExecutionin interfacePausable- Overrides:
pauseExecutionin classAbstractScriptingEngineEnhancer
-
resumeExecution
public void resumeExecution()
Resumes the execution.- Specified by:
resumeExecutionin interfacePausable- Overrides:
resumeExecutionin classAbstractScriptingEngineEnhancer
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceStoppable- Overrides:
stopExecutionin classAbstractScriptingEngineEnhancer
-
-