Package adams.scripting.engine
Class ManualFeedScriptingEngine
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,Pausable
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,FlowContextHandler
,JobQueueHandler
,RemoteScriptingEngine
,RemoteCommandProcessorHandler
,Serializable
public class ManualFeedScriptingEngine extends AbstractScriptingEngineWithJobQueue
Scripting engine that gets commands fed programmatically.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
addCommand(RemoteCommand)
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_MaxCommands
the maximum number of commands to allow in queue.protected BlockingQueue<RemoteCommand>
m_Queue
the queue to add the commands to.-
Fields inherited from class adams.scripting.engine.AbstractScriptingEngineWithJobQueue
m_Executor, m_MaxConcurrentJobs
-
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 ManualFeedScriptingEngine()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCommand(RemoteCommand cmd)
Adds the command to the queue.void
defineOptions()
Adds options to the internal list of options.protected String
doExecute()
Executes the scripting engine.int
getMaxCommands()
Returns the maximum number of commands allowed in the queue.String
globalInfo()
Returns a string describing the object.protected void
handleCommand(RemoteCommand cmd)
Handles the command.static void
main(String[] args)
Starts the scripting engine from commandline.String
maxCommandsTipText()
Returns the tip text for this property.void
setMaxCommands(int value)
Sets the maximum number of commands allowed in the queue.-
Methods inherited from class adams.scripting.engine.AbstractScriptingEngineWithJobQueue
executeJob, getMaxConcurrentJobs, maxConcurrentJobsTipText, pauseExecution, resumeExecution, setMaxConcurrentJobs, 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, 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
-
Methods inherited from interface adams.scripting.processor.RemoteCommandProcessorHandler
getCommandProcessor, setCommandProcessor
-
Methods inherited from interface adams.scripting.engine.RemoteScriptingEngine
execute, getCommandHandler, getFlowContext, getPermissionHandler, getRemoteScriptingEngineHandler, getRequestHandler, getResponseHandler, isRunning, permissionHandlerTipText, requestHandlerTipText, responseHandlerTipText, setCommandHandler, setFlowContext, setPermissionHandler, setRemoteScriptingEngineHandler, setRequestHandler, setResponseHandler
-
Methods inherited from interface adams.core.StoppableWithFeedback
isStopped
-
-
-
-
Field Detail
-
m_Queue
protected BlockingQueue<RemoteCommand> m_Queue
the queue to add the commands to.
-
m_MaxCommands
protected int m_MaxCommands
the maximum number of commands to allow in queue.
-
-
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 classAbstractScriptingEngineWithJobQueue
-
setMaxCommands
public void setMaxCommands(int value)
Sets the maximum number of commands allowed in the queue.- Parameters:
value
- the maximum
-
getMaxCommands
public int getMaxCommands()
Returns the maximum number of commands allowed in the queue.- Returns:
- the maximum
-
maxCommandsTipText
public String maxCommandsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
addCommand
public void addCommand(RemoteCommand cmd)
Adds the command to the queue.- Parameters:
cmd
- the command to add
-
handleCommand
protected void handleCommand(RemoteCommand cmd)
Handles the command.- Parameters:
cmd
- the command to handle
-
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
-
main
public static void main(String[] args)
Starts the scripting engine from commandline.- Parameters:
args
- additional options for the scripting engine
-
-