|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.runtime.swing.application.ActionExecutor
public abstract class ActionExecutor
Executor of ActionWorker.
| Field Summary | |
|---|---|
protected Set<ActionWorker<?,?>> |
tasks
current tasks |
protected PropertyChangeListener |
workerListener
the listener of running action |
| Constructor Summary | |
|---|---|
ActionExecutor()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Set<ActionWorker<?,?>> tasks
protected final PropertyChangeListener workerListener
| Constructor Detail |
|---|
public ActionExecutor()
| Method Detail |
|---|
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 perform
public ActionWorker<?,?> addAction(String actionLabel,
Runnable action)
actionLabel - the name of the action to performaction - the action to perform
public void terminatesAndWaits()
throws InterruptedException
InterruptedException - if something wrong while waiting end of
executorpublic 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||