public abstract class ActionExecutor extends Object
ActionWorker.| Modifier and Type | Field and Description |
|---|---|
protected Set<ActionWorker<?,?>> |
tasks
current tasks
|
protected PropertyChangeListener |
workerListener
the listener of running action
|
| Constructor and Description |
|---|
ActionExecutor() |
| Modifier and Type | Method and Description |
|---|---|
ActionWorker<?,?> |
addAction(String actionLabel,
Runnable action)
Add an new action to perform.
|
Runnable |
createRunnable(Object methodContainer,
String methodName,
Object... arguments)
Creates a runnable instance (via a Proxy) to a method given by his name
(
methodName) to invoke on methodcontainer with given
arguments. |
int |
getNbActions() |
Set<ActionWorker<?,?>> |
getTasks() |
abstract void |
onActionCancel(ActionWorker<?,?> source)
Hook when a action has been canceled.
|
abstract void |
onActionEnd(ActionWorker<?,?> source)
Hook when a action has end with no failure or cancel.
|
abstract void |
onActionFail(ActionWorker<?,?> source)
Hook when a action has failed.
|
abstract void |
onActionStart(ActionWorker<?,?> source)
Hook when a action is about to start.
|
abstract void |
onAfterAction(ActionWorker<?,?> source)
Hook atfer action is consumed.
|
void |
terminatesAndWaits()
Ask the thread to stop.
|
protected final Set<ActionWorker<?,?>> tasks
protected final PropertyChangeListener workerListener
public abstract void onActionStart(ActionWorker<?,?> source)
source - the action worker containing the action to performpublic abstract void onActionFail(ActionWorker<?,?> source)
source - the action worker containing the action to performpublic abstract void onActionCancel(ActionWorker<?,?> source)
source - the action worker containing the action to performpublic abstract void onActionEnd(ActionWorker<?,?> source)
source - the action worker containing the action to performpublic abstract void onAfterAction(ActionWorker<?,?> source)
source - the action worker containing the action to performpublic ActionWorker<?,?> addAction(String actionLabel, Runnable action)
actionLabel - the name of the action to performaction - the action to performpublic void terminatesAndWaits()
public int getNbActions()
public Set<ActionWorker<?,?>> getTasks()
public Runnable createRunnable(Object methodContainer, String methodName, Object... arguments)
methodName) to invoke on methodcontainer with given
arguments.
This is a great feature to create runnable code with a real context.methodContainer - the container of the method to invokemethodName - the name of the method to invokearguments - parameters to pass to method to invke.Copyright © 2008–2017 Ultreia.io. All rights reserved.