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 Connection
m_Main
the connection to the main engine node.protected Connection
m_Worker
the 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 void
defineOptions()
Adds options to the internal list of options.protected Connection
getDefaultMain()
Returns the default connection for the main.protected RemoteScriptingEngine
getDefaultScriptingEngine()
Returns the default scripting engine.protected Connection
getDefaultWorker()
Returns the default connection for the worker.Connection
getMain()
Returns the connection for communicating with the main engine.Connection
getWorker()
Returns the connection that the main uses for communicating with the worker.String
globalInfo()
Returns a string describing the object.String
mainTipText()
Returns the tip text for this property.protected String
preExecute()
Hook method which gets called just before the base engine is executed.void
setMain(Connection value)
Sets the connection for communicating with the main engine.void
setWorker(Connection value)
Sets the connection that the main uses for communicating with the worker.void
stopExecution()
Stops the scripting engine and deregisters with the master.String
workerTipText()
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:
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
-
getDefaultScriptingEngine
protected RemoteScriptingEngine getDefaultScriptingEngine()
Returns the default scripting engine.- Overrides:
getDefaultScriptingEngine
in 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:
setMain
in interfaceWorkerScriptingEngine
- Parameters:
value
- the connection
-
getMain
public Connection getMain()
Returns the connection for communicating with the main engine.- Specified by:
getMain
in interfaceWorkerScriptingEngine
- Returns:
- the connection
-
mainTipText
public String mainTipText()
Returns the tip text for this property.- Specified by:
mainTipText
in 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:
setWorker
in interfaceWorkerScriptingEngine
- Parameters:
value
- the connection
-
getWorker
public Connection getWorker()
Returns the connection that the main uses for communicating with the worker.- Specified by:
getWorker
in interfaceWorkerScriptingEngine
- Returns:
- the connection
-
workerTipText
public String workerTipText()
Returns the tip text for this property.- Specified by:
workerTipText
in 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:
preExecute
in classAbstractScriptingEngineEnhancer
- Returns:
- null if successful, otherwise error message
-
stopExecution
public void stopExecution()
Stops the scripting engine and deregisters with the master.- Specified by:
stopExecution
in interfaceStoppable
- Overrides:
stopExecution
in classAbstractScriptingEngineEnhancer
-
-