WB - The WaveBean type used for this command (by default you can use the WaveBean interface)public abstract class AbstractMultiCommand<WB extends WaveBean> extends AbstractBaseCommand<WB> implements MultiCommand<WB>, WaveListener
| Modifier and Type | Field and Description |
|---|---|
private AtomicBoolean |
cancelRequested
Cancellation has been requested.
|
private List<Class<? extends Command>> |
commandList
The list of command that will be chained.
|
private int |
commandRunIndex
The index of the last command performed.
|
private static Boolean |
DEFAULT_SEQUENTIAL_VALUE
The default sequential value, could be overridden by annotation or constructor argument.
|
private List<Wave> |
pendingWaves
The list of pending waves triggered by each command when launched in parallel.
|
private AtomicBoolean |
running
The command is running.
|
private boolean |
sequential
Flag that indicate if commands must be run sequentially(true) or in parallel(false).
|
private Wave |
waveSource
The source wave that trigger this command.
|
PROCESS_WAVE_METHOD_NAMECALL_ANNOTATED_METHOD_ERROR, COMMAND_NOT_FOUND_ERROR, COMMAND_NOT_FOUND_MESSAGE, COMPONENT_INJECTION_FAILURE, CUSTOM_METHOD_NOT_FOUND, LISTEN_WAVE_TYPE, MODEL_NOT_FOUND_ERROR, MODEL_NOT_FOUND_MESSAGE, NO_WAVE_LISTENER, NOTIFIER_CONSUMES, SEND_WAVE, SERVICE_NOT_FOUND_ERROR, SERVICE_NOT_FOUND_MESSAGE, UNLISTEN_WAVE_TYPE, USE_DEFAULT_WAVE_HANDLER, WAVE_BEAN_CREATION_ERROR, WAVE_DISPATCH_ERROR, WAVE_HANDLING_ERROR, WAVE_LOST, WAVE_LOST_CONTEXT, WAVE_SENDING_ERROR| Constructor and Description |
|---|
AbstractMultiCommand(boolean sequential)
Default Constructor.
|
AbstractMultiCommand(RunType runInto)
Default Constructor.
|
AbstractMultiCommand(RunType runInto,
boolean sequential)
Default Constructor.
|
AbstractMultiCommand(RunType runInto,
RunnablePriority priority,
boolean sequential)
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCommandClass(Class<? extends Command> commandClass)
Add a command to the queue.
|
void |
afterPerform(Wave wave)
Actions to perform after the command into the executor thread.
|
void |
beforePerform(Wave wave)
Actions to perform before the command into the executor thread.
|
protected abstract void |
initCommand()
Custom method used to initialize the command.
|
private void |
initSequential(Boolean sequential)
Define the sequential value.
|
boolean |
isRunning() |
protected boolean |
isSequential() |
protected abstract void |
manageSubCommand()
This method must be used to add sub command by calling
addCommandClass(Class). |
protected void |
perform(Wave wave)
Perform the command code.
|
void |
ready()
The component is now ready to do custom initialization tasks.
|
protected void |
setSequential(boolean sequential) |
void |
waveCancelled(Wave wave)
The wave has just been cancelled.
|
void |
waveConsumed(Wave wave)
The wave has just been consumed.
|
void |
waveCreated(Wave wave)
The wave has just been created.
|
void |
waveDestroyed(Wave wave)
The wave has just been destroyed.
|
void |
waveFailed(Wave wave)
The wave processing has failed.
|
void |
waveProcessed(Wave wave)
The wave is being processed.
|
void |
waveSent(Wave wave)
The wave has just been sent to the notifier.
|
finalize, fireConsumed, fireFailed, getRunInto, getRunnablePriority, getWaveBean, innerRun, processWave, run, runattachUi, callCommand, callCommand, getReturnCommand, getReturnWaveType, listen, listen, listen, registerCallback, registerCallback, registerCallback, release, returnData, sendWave, sendWave, setup, unlistengetCommand, getFirstKeyPart, getKey, getListKeyPart, getLocalFacade, getModel, getSecondKeyPart, getService, getThirdKeyPart, setKey, setLocalFacadeclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetWaveBeangetReturnCommand, getReturnWaveType, listen, listen, listen, registerCallback, registerCallback, registerCallback, sendWave, sendWave, unlistengetKey, getLocalFacade, release, setKey, setLocalFacade, setupattachUi, getModelgetService, returnDatacallCommand, callCommand, getCommandprivate static final Boolean DEFAULT_SEQUENTIAL_VALUE
private final AtomicBoolean running
private final List<Class<? extends Command>> commandList
private final List<Wave> pendingWaves
private boolean sequential
private int commandRunIndex
private Wave waveSource
private final AtomicBoolean cancelRequested
public AbstractMultiCommand(RunType runInto)
runInto - The run into thread typepublic AbstractMultiCommand(boolean sequential)
sequential - indicate if commands must be run sequentially(true) or in parallel(false)public AbstractMultiCommand(RunType runInto, boolean sequential)
runInto - The run into thread typesequential - indicate if commands must be run sequentially(true) or in parallel(false)public AbstractMultiCommand(RunType runInto, RunnablePriority priority, boolean sequential)
runInto - The run into thread typepriority - the runnable prioritysequential - indicate if commands must be run sequentially(true) or in parallel(false)private void initSequential(Boolean sequential)
sequential - the constructor parameterprotected boolean isSequential()
protected void setSequential(boolean sequential)
sequential - The sequential to set.public final void ready()
throws CoreException
ready in class AbstractWaveReady<Command>CoreException - if an error occurredprotected abstract void initCommand()
protected abstract void manageSubCommand()
addCommandClass(Class).public void beforePerform(Wave wave)
beforePerform in class AbstractBaseCommand<WB extends WaveBean>wave - the wave that triggered this commandpublic void afterPerform(Wave wave)
afterPerform in class AbstractBaseCommand<WB extends WaveBean>wave - the wave that triggered this commandpublic boolean isRunning()
protected void perform(Wave wave)
perform in class AbstractBaseCommand<WB extends WaveBean>wave - the wave that contain data to be processedpublic void waveConsumed(Wave wave)
waveConsumed in interface WaveListenerwave - the consumed wavepublic void waveFailed(Wave wave)
waveFailed in interface WaveListenerwave - the failed wavepublic void waveCancelled(Wave wave)
waveCancelled in interface WaveListenerwave - the cancelled wavepublic void waveDestroyed(Wave wave)
waveDestroyed in interface WaveListenerwave - the destroyed wavepublic void waveCreated(Wave wave)
waveCreated in interface WaveListenerwave - the created wavepublic void waveSent(Wave wave)
waveSent in interface WaveListenerwave - the sent wavepublic void waveProcessed(Wave wave)
waveProcessed in interface WaveListenerwave - the processed wavepublic void addCommandClass(Class<? extends Command> commandClass)
addCommandClass in interface MultiCommand<WB extends WaveBean>commandClass - the class of the command to addCopyright © 2011–2014 JRebirth OSS. All rights reserved.