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 PausableFixedThreadPoolExecutor
m_Executor
the executor service to use for parallel execution.protected int
m_MaxConcurrentJobs
the 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 void
defineOptions()
Adds options to the internal list of options.void
executeJob(CallableWithResult<String> job)
Queues the job in the execution pipeline.int
getMaxConcurrentJobs()
Returns the maximum number of concurrent jobs to execute.String
maxConcurrentJobsTipText()
Returns the tip text for this property.void
pauseExecution()
Pauses the execution.void
resumeExecution()
Resumes the execution.void
setMaxConcurrentJobs(int value)
Sets the maximum number of concurrent jobs to execute.void
stopExecution()
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:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractScriptingEngine
-
setMaxConcurrentJobs
public void setMaxConcurrentJobs(int value)
Sets the maximum number of concurrent jobs to execute.- Specified by:
setMaxConcurrentJobs
in interfaceJobQueueHandler
- Parameters:
value
- the number of jobs
-
getMaxConcurrentJobs
public int getMaxConcurrentJobs()
Returns the maximum number of concurrent jobs to execute.- Specified by:
getMaxConcurrentJobs
in interfaceJobQueueHandler
- Returns:
- the number of jobs
-
maxConcurrentJobsTipText
public String maxConcurrentJobsTipText()
Returns the tip text for this property.- Specified by:
maxConcurrentJobsTipText
in 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:
executeJob
in interfaceRemoteScriptingEngine
- Overrides:
executeJob
in classAbstractScriptingEngine
- Parameters:
job
- the job to queue
-
pauseExecution
public void pauseExecution()
Pauses the execution.- Specified by:
pauseExecution
in interfacePausable
- Overrides:
pauseExecution
in classAbstractScriptingEngine
-
resumeExecution
public void resumeExecution()
Resumes the execution.- Specified by:
resumeExecution
in interfacePausable
- Overrides:
resumeExecution
in classAbstractScriptingEngine
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceStoppable
- Overrides:
stopExecution
in classAbstractScriptingEngine
-
-