Package adams.scripting.engine
Class AbstractRemoteCommandHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.scripting.engine.AbstractRemoteCommandHandler
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,RemoteCommandHandler
,Serializable
- Direct Known Subclasses:
DefaultMainScriptingEngine.RemoteCommandGrabber
,DefaultRemoteCommandHandler
,ForwardingScriptingEngine.RemoteCommandGrabber
,RemoteCommandJobRunner.RemoteCommandGrabber
public abstract class AbstractRemoteCommandHandler extends AbstractOptionHandler implements RemoteCommandHandler
Ancestor for classes that handle remote commands within a scripting engine.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected RemoteScriptingEngine
m_Owner
the owner.-
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 AbstractRemoteCommandHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
check(RemoteCommand cmd)
Hook method for checks before handling the command.protected abstract String
doHandle(RemoteCommand cmd, RemoteCommandProcessor processor)
Handles the command.RemoteScriptingEngine
getOwner()
Returns the owning scripting engine.String
handle(RemoteCommand cmd, RemoteCommandProcessor processor)
Handles the command.void
setOwner(RemoteScriptingEngine value)
Sets the owning scripting engine.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Owner
protected RemoteScriptingEngine m_Owner
the owner.
-
-
Method Detail
-
setOwner
public void setOwner(RemoteScriptingEngine value)
Sets the owning scripting engine.- Specified by:
setOwner
in interfaceRemoteCommandHandler
- Parameters:
value
- the owner
-
getOwner
public RemoteScriptingEngine getOwner()
Returns the owning scripting engine.- Specified by:
getOwner
in interfaceRemoteCommandHandler
- Returns:
- the owner, null if none set
-
check
protected String check(RemoteCommand cmd)
Hook method for checks before handling the command.- Parameters:
cmd
- the command to handle- Returns:
- null if checks passed, otherwise error message
-
doHandle
protected abstract String doHandle(RemoteCommand cmd, RemoteCommandProcessor processor)
Handles the command.- Parameters:
cmd
- the command to handleprocessor
- the processor for formatting/parsing- Returns:
- null if successful, otherwise error message
-
handle
public String handle(RemoteCommand cmd, RemoteCommandProcessor processor)
Handles the command.- Specified by:
handle
in interfaceRemoteCommandHandler
- Parameters:
cmd
- the command to handleprocessor
- the processor for formatting/parsing- Returns:
- null if successful, otherwise error message
-
-