|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ICommandPipe
An interface describing the unit responsible for the execution of commands.
Commands can be executed synchronously and asynchronously by calling
execute(ICommand) and executeAsync(ICommand) methods
respectively. These methods return objects of type
ICommandExecutionContainer which are responsible for management of
the command runtime information.
It is only possible for a pipe to execute one command in any moment of time. The other commands will be added to the queue and wait until the slot for the active command will be free.
| Method Summary | ||
|---|---|---|
void |
addStateListener(ICommandStateListener listener)
Adds a state listener to the command pipe. |
|
void |
cancelAll()
Cancels all command execution container which are currently executed or queued. |
|
void |
cancelAllAsync()
See cancelAllAsync(ICancelListener). |
|
void |
cancelAllAsync(ICancelListener listener)
Cancels all command execution container which are currently executed or queued. |
|
void |
cancelAsync(ICommandExecutionContainer<?,?,?> container)
Cancels the given command execution container. |
|
void |
cancelAsync(ICommandExecutionContainer<?,?,?> container,
ICancelListener listener)
Cancels the given command execution container. |
|
|
canExecute(T command)
Tests if a command can be executed by this command pipe. |
|
|
execute(T command)
Executes the given command synchronously. |
|
|
executeAsync(T command)
Executes the given command asynchronously. |
|
ICommandExecutionContainer<?,?,?> |
getActive()
Returns the command execution container which is currently executed. |
|
List<ICommandExecutionContainer<?,?,?>> |
getAll()
Returns all command execution containers which are currently executed or queued. |
|
void |
removeStateListener(ICommandStateListener listener)
Removes the given state listener from the command pipe. |
|
| Method Detail |
|---|
<T extends ICommand<T,E>,E extends ICommandExecutionContainer<T,?,?>> boolean canExecute(T command)
T - type of the command to execute.E - type of the execution container for the executed command.command - A command.
<T extends ICommand<T,E>,E extends ICommandExecutionContainer<T,?,?>> E executeAsync(T command)
The method returns immediately, in other words, the method does not wait for the execution of the container.
T - type of the command to execute.E - type of the execution container for the executed command.command - The command which should be executed.
<T extends ICommand<T,E>,E extends ICommandExecutionContainer<T,?,?>> E execute(T command)
The method returns when the command execution container is finished.
T - type of the command to execute.E - type of the execution container for the executed command.command - The command which should be executed.
List<ICommandExecutionContainer<?,?,?>> getAll()
Please note: This function only delivers a snapshot in time, in other words, the container list might change immediately after or even during the function call.
ICommandExecutionContainer<?,?,?> getActive()
void cancelAsync(ICommandExecutionContainer<?,?,?> container)
The method returns immediately, in other words, the method does not wait for the container to finish.
container - The command execution container which should be cancelled.
void cancelAsync(ICommandExecutionContainer<?,?,?> container,
ICancelListener listener)
The method returns immediately, in other words, the method does not wait for the container to finish.
container - The command execution container which should be cancelled.listener - A listener which is called (asynchronous) when the container
is finished.void cancelAllAsync()
cancelAllAsync(ICancelListener).
void cancelAllAsync(ICancelListener listener)
listener - A listener which is called (asynchronous) when all currently
executed and queued container are finished.void cancelAll()
void addStateListener(ICommandStateListener listener)
listener - A state listener which is called (asynchronous) whenever a
command execution container changes its state.void removeStateListener(ICommandStateListener listener)
listener - The state listener which has to be removed from the command
pipe.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||