Package adams.scripting.engine
Class DefaultMainScriptingEngine
- 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.DefaultMainScriptingEngine
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,Pausable,SizeOfHandler,Stoppable,StoppableWithFeedback,FlowContextHandler,MainScriptingEngine,RemoteScriptingEngine,RemoteCommandProcessorHandler,Serializable
public class DefaultMainScriptingEngine extends AbstractScriptingEngineEnhancer implements MainScriptingEngine
Manages worker scripting engines and sends them jobs for execution.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultMainScriptingEngine.RemoteCommandGrabberHandles the registering/deregistering of workers.
-
Field Summary
Fields Modifier and Type Field Description protected LoadBalancerm_Workersfor keeping track of workers.-
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 DefaultMainScriptingEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidderegisterWorker(Connection conn)Deregisters a worker with the given connection.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.voidkillWorkers()Kills all workers registered.protected StringpreExecute()Hook method which gets called just before the base engine is executed.voidregisterWorker(Connection conn)Registers a worker with the given connection.protected voidreset()Resets the scheme.StringsendCommand(RemoteCommand cmd)Sends the command to a worker.voidsetLoggingLevel(LoggingLevel value)Sets the logging level.-
Methods inherited from class adams.scripting.engine.AbstractScriptingEngineEnhancer
defineOptions, doExecute, executeJob, getDefaultScriptingEngine, getScriptingEngine, pauseExecution, resumeExecution, scriptingEngineTipText, setScriptingEngine, stopExecution
-
Methods inherited from class adams.scripting.engine.AbstractScriptingEngine
commandProcessorTipText, execute, forCommandLine, forName, getCommandHandler, getCommandProcessor, getDefaultCommandHandler, getDefaultCommandProcessor, getDefaultPermissionHandler, getDefaultRequestHandler, getDefaultResponseHandler, getFlowContext, getPermissionHandler, getRemoteScriptingEngineHandler, getRequestHandler, getResponseHandler, 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, 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, defineOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.core.Pausable
isPaused, pauseExecution, resumeExecution
-
Methods inherited from interface adams.scripting.processor.RemoteCommandProcessorHandler
getCommandProcessor, setCommandProcessor
-
Methods inherited from interface adams.scripting.engine.RemoteScriptingEngine
execute, executeJob, getCommandHandler, getFlowContext, getPermissionHandler, getRemoteScriptingEngineHandler, getRequestHandler, getResponseHandler, isRunning, permissionHandlerTipText, requestHandlerTipText, responseHandlerTipText, setCommandHandler, setFlowContext, setPermissionHandler, setRemoteScriptingEngineHandler, setRequestHandler, setResponseHandler
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
Methods inherited from interface adams.core.StoppableWithFeedback
isStopped
-
-
-
-
Field Detail
-
m_Workers
protected LoadBalancer m_Workers
for keeping track of workers.
-
-
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
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractScriptingEngine
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
setLoggingLevel
public void setLoggingLevel(LoggingLevel value)
Sets the logging level.- Specified by:
setLoggingLevelin interfaceLoggingLevelHandler- Overrides:
setLoggingLevelin classAbstractOptionHandler- Parameters:
value- the level
-
registerWorker
public void registerWorker(Connection conn)
Registers a worker with the given connection.- Specified by:
registerWorkerin interfaceMainScriptingEngine- Parameters:
conn- the connection of the worker
-
deregisterWorker
public void deregisterWorker(Connection conn)
Deregisters a worker with the given connection.- Specified by:
deregisterWorkerin interfaceMainScriptingEngine- Parameters:
conn- the connection of the worker
-
killWorkers
public void killWorkers()
Kills all workers registered.- Specified by:
killWorkersin interfaceMainScriptingEngine
-
sendCommand
public String sendCommand(RemoteCommand cmd)
Sends the command to a worker.- Specified by:
sendCommandin interfaceMainScriptingEngine- Parameters:
cmd- the command to send- Returns:
- null if successful, otherwise error message
-
preExecute
protected String preExecute()
Description copied from class:AbstractScriptingEngineEnhancerHook method which gets called just before the base engine is executed.
Default implementation does nothing.- Overrides:
preExecutein classAbstractScriptingEngineEnhancer- Returns:
- null if successful, otherwise error message
-
-