Package adams.scripting.engine
Class AbstractScriptingEngineWithJobQueue
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.scripting.engine.AbstractScriptingEngine
-
- adams.scripting.engine.AbstractScriptingEngineWithJobQueue
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,Pausable,SizeOfHandler,Stoppable,StoppableWithFeedback,FlowContextHandler,JobQueueHandler,RemoteScriptingEngine,RemoteCommandProcessorHandler,Serializable
- Direct Known Subclasses:
DefaultScriptingEngine,FileBasedScriptingEngine,ManualFeedScriptingEngine
public abstract class AbstractScriptingEngineWithJobQueue extends AbstractScriptingEngine implements JobQueueHandler
Ancestor for scripting engines that manage a job queue to restrict executions.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PausableFixedThreadPoolExecutorm_Executorthe executor service to use for parallel execution.protected intm_MaxConcurrentJobsthe number of concurrent jobs to allow.-
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 AbstractScriptingEngineWithJobQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.voidexecuteJob(CallableWithResult<String> job)Queues the job in the execution pipeline.intgetMaxConcurrentJobs()Returns the maximum number of concurrent jobs to execute.StringmaxConcurrentJobsTipText()Returns the tip text for this property.voidpauseExecution()Pauses the execution.voidresumeExecution()Resumes the execution.voidsetMaxConcurrentJobs(int value)Sets the maximum number of concurrent jobs to execute.voidstopExecution()Stops the execution.-
Methods inherited from class adams.scripting.engine.AbstractScriptingEngine
commandProcessorTipText, doExecute, 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
-
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_MaxConcurrentJobs
protected int m_MaxConcurrentJobs
the number of concurrent jobs to allow.
-
m_Executor
protected PausableFixedThreadPoolExecutor m_Executor
the executor service to use for parallel execution.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractScriptingEngine
-
setMaxConcurrentJobs
public void setMaxConcurrentJobs(int value)
Sets the maximum number of concurrent jobs to execute.- Specified by:
setMaxConcurrentJobsin interfaceJobQueueHandler- Parameters:
value- the number of jobs
-
getMaxConcurrentJobs
public int getMaxConcurrentJobs()
Returns the maximum number of concurrent jobs to execute.- Specified by:
getMaxConcurrentJobsin interfaceJobQueueHandler- Returns:
- the number of jobs
-
maxConcurrentJobsTipText
public String maxConcurrentJobsTipText()
Returns the tip text for this property.- Specified by:
maxConcurrentJobsTipTextin interfaceJobQueueHandler- Returns:
- tip text for this property suitable for displaying in the gui
-
executeJob
public void executeJob(CallableWithResult<String> job)
Queues the job in the execution pipeline.- Specified by:
executeJobin interfaceRemoteScriptingEngine- Overrides:
executeJobin classAbstractScriptingEngine- Parameters:
job- the job to queue
-
pauseExecution
public void pauseExecution()
Pauses the execution.- Specified by:
pauseExecutionin interfacePausable- Overrides:
pauseExecutionin classAbstractScriptingEngine
-
resumeExecution
public void resumeExecution()
Resumes the execution.- Specified by:
resumeExecutionin interfacePausable- Overrides:
resumeExecutionin classAbstractScriptingEngine
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceStoppable- Overrides:
stopExecutionin classAbstractScriptingEngine
-
-