Package adams.scripting.engine
Class AbstractScriptingEngineEnhancer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.scripting.engine.AbstractScriptingEngine
-
- adams.scripting.engine.AbstractScriptingEngineEnhancer
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,Pausable
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,FlowContextHandler
,RemoteScriptingEngine
,RemoteCommandProcessorHandler
,Serializable
- Direct Known Subclasses:
DefaultMainScriptingEngine
,DefaultWorkerScriptingEngine
,ForwardingScriptingEngine
public abstract class AbstractScriptingEngineEnhancer extends AbstractScriptingEngine
Ancestor for scripting engines that enhance a base one.- 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_ScriptingEngine
the base scripting engine to use.-
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 AbstractScriptingEngineEnhancer()
-
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.void
executeJob(CallableWithResult<String> job)
Executes the job.protected RemoteScriptingEngine
getDefaultScriptingEngine()
Returns the default scripting engine.RemoteScriptingEngine
getScriptingEngine()
Returns the scripting engine in use.void
pauseExecution()
Pauses the execution.protected String
preExecute()
Hook method which gets called just before the base engine is executed.void
resumeExecution()
Resumes the execution.String
scriptingEngineTipText()
Returns the tip text for this property.void
setScriptingEngine(RemoteScriptingEngine value)
Sets the scripting engine to use.void
stopExecution()
Stops the execution.-
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, globalInfo, 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_ScriptingEngine
protected RemoteScriptingEngine m_ScriptingEngine
the base scripting engine to use.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractScriptingEngine
-
getDefaultScriptingEngine
protected RemoteScriptingEngine getDefaultScriptingEngine()
Returns the default scripting engine.- Returns:
- the default
-
setScriptingEngine
public void setScriptingEngine(RemoteScriptingEngine value)
Sets the scripting engine to use.- Parameters:
value
- the scripting engine
-
getScriptingEngine
public RemoteScriptingEngine getScriptingEngine()
Returns the scripting engine in use.- Returns:
- the scripting engine
-
scriptingEngineTipText
public String scriptingEngineTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
preExecute
protected String preExecute()
Hook method which gets called just before the base engine is executed.
Default implementation does nothing.- Returns:
- null if successful, otherwise error message
-
doExecute
protected String doExecute()
Executes the scripting engine.- Specified by:
doExecute
in classAbstractScriptingEngine
- Returns:
- error message in case of failure to start up or run, otherwise null
-
executeJob
public void executeJob(CallableWithResult<String> job)
Executes the job.- Specified by:
executeJob
in interfaceRemoteScriptingEngine
- Overrides:
executeJob
in classAbstractScriptingEngine
- Parameters:
job
- the job to execute
-
pauseExecution
public void pauseExecution()
Pauses the execution.- Specified by:
pauseExecution
in interfacePausable
- Overrides:
pauseExecution
in classAbstractScriptingEngine
-
resumeExecution
public void resumeExecution()
Resumes the execution.- Specified by:
resumeExecution
in interfacePausable
- Overrides:
resumeExecution
in classAbstractScriptingEngine
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceStoppable
- Overrides:
stopExecution
in classAbstractScriptingEngine
-
-