Package adams.scripting.engine
Class DefaultWorkerScriptingEngine
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.scripting.engine.AbstractScriptingEngine
-
- adams.scripting.engine.AbstractScriptingEngineEnhancer
-
- adams.scripting.engine.DefaultWorkerScriptingEngine
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,Pausable,SizeOfHandler,Stoppable,StoppableWithFeedback,FlowContextHandler,RemoteScriptingEngine,WorkerScriptingEngine,RemoteCommandProcessorHandler,Serializable
public class DefaultWorkerScriptingEngine extends AbstractScriptingEngineEnhancer implements WorkerScriptingEngine
Registers itself with a main engine for executing jobs.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Connectionm_Mainthe connection to the main engine node.protected Connectionm_Workerthe connection for communicating with the worker.-
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 DefaultWorkerScriptingEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected ConnectiongetDefaultMain()Returns the default connection for the main.protected RemoteScriptingEnginegetDefaultScriptingEngine()Returns the default scripting engine.protected ConnectiongetDefaultWorker()Returns the default connection for the worker.ConnectiongetMain()Returns the connection for communicating with the main engine.ConnectiongetWorker()Returns the connection that the main uses for communicating with the worker.StringglobalInfo()Returns a string describing the object.StringmainTipText()Returns the tip text for this property.protected StringpreExecute()Hook method which gets called just before the base engine is executed.voidsetMain(Connection value)Sets the connection for communicating with the main engine.voidsetWorker(Connection value)Sets the connection that the main uses for communicating with the worker.voidstopExecution()Stops the scripting engine and deregisters with the master.StringworkerTipText()Returns the tip text for this property.-
Methods inherited from class adams.scripting.engine.AbstractScriptingEngineEnhancer
doExecute, executeJob, getScriptingEngine, pauseExecution, resumeExecution, 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_Main
protected Connection m_Main
the connection to the main engine node.
-
m_Worker
protected Connection m_Worker
the connection for communicating with the worker.
-
-
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
-
getDefaultScriptingEngine
protected RemoteScriptingEngine getDefaultScriptingEngine()
Returns the default scripting engine.- Overrides:
getDefaultScriptingEnginein classAbstractScriptingEngineEnhancer- Returns:
- the default
-
getDefaultMain
protected Connection getDefaultMain()
Returns the default connection for the main.- Returns:
- the default
-
setMain
public void setMain(Connection value)
Sets the connection for communicating with the main engine.- Specified by:
setMainin interfaceWorkerScriptingEngine- Parameters:
value- the connection
-
getMain
public Connection getMain()
Returns the connection for communicating with the main engine.- Specified by:
getMainin interfaceWorkerScriptingEngine- Returns:
- the connection
-
mainTipText
public String mainTipText()
Returns the tip text for this property.- Specified by:
mainTipTextin interfaceWorkerScriptingEngine- Returns:
- tip text for this property suitable for displaying in the gui
-
getDefaultWorker
protected Connection getDefaultWorker()
Returns the default connection for the worker.- Returns:
- the default
-
setWorker
public void setWorker(Connection value)
Sets the connection that the main uses for communicating with the worker.- Specified by:
setWorkerin interfaceWorkerScriptingEngine- Parameters:
value- the connection
-
getWorker
public Connection getWorker()
Returns the connection that the main uses for communicating with the worker.- Specified by:
getWorkerin interfaceWorkerScriptingEngine- Returns:
- the connection
-
workerTipText
public String workerTipText()
Returns the tip text for this property.- Specified by:
workerTipTextin interfaceWorkerScriptingEngine- 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.
Registers with the main.- Overrides:
preExecutein classAbstractScriptingEngineEnhancer- Returns:
- null if successful, otherwise error message
-
stopExecution
public void stopExecution()
Stops the scripting engine and deregisters with the master.- Specified by:
stopExecutionin interfaceStoppable- Overrides:
stopExecutionin classAbstractScriptingEngineEnhancer
-
-