public abstract class AbstractActionEngine extends java.lang.Object implements ActionEngine
ActionEngine that is designed to be used with
ExecutorService. This is a convenience class for creating an ActionEngine. awaitResumed()).TERMINATION_TIMEOUT,
DefaultActionBindings| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ExecutorService |
executorService
Executor service to be used for action scheduling.
|
static long |
TERMINATION_TIMEOUT
How long the engine will wait until it times out and interrupts running threads on shutdown
(configured via
jalse.actions.termination_timeout system property). |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractActionEngine(java.util.concurrent.ExecutorService executorService)
Creates a new instance of AbstractActionEngine with the supplied executor service.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
awaitResumed()
Will wait until the engine has resumed (or stopped).
|
ActionBindings |
getBindings()
Bindings for this engine.
|
boolean |
isPaused()
Whether the engine is paused.
|
boolean |
isStopped()
Whether the engine is stopped.
|
void |
pause()
Pauses action processing.
|
void |
resume()
Resumes performing actions.
|
void |
stop()
Permanently stops the engine.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewContext, putInBindings, removeFromBindings, schedule, schedulepublic static long TERMINATION_TIMEOUT
jalse.actions.termination_timeout system property).protected final java.util.concurrent.ExecutorService executorService
protected AbstractActionEngine(java.util.concurrent.ExecutorService executorService)
executorService - Service to use.Actions.requireNotShutdown(ExecutorService)protected void awaitResumed()
throws java.lang.InterruptedException
java.lang.InterruptedException - If the current thread was interrupted.public ActionBindings getBindings()
ActionEnginegetBindings in interface ActionEnginepublic boolean isPaused()
ActionEngineisPaused in interface ActionEnginepublic boolean isStopped()
ActionEngineisStopped in interface ActionEnginepublic void pause()
ActionEnginepause in interface ActionEnginepublic void resume()
ActionEngineresume in interface ActionEnginepublic void stop()
ActionEnginestop in interface ActionEngine