public class CompoundCommand extends ExecutableCommandWrapper
A group of commands used to minimize the number of executions between a Java program and the Integrity server.
A compound command might be used to group the execution of nested commands, to minimize the communication between the Java program and the Integrity server and to improve performances.
This compound command will automatically decide which set of commands can be grouped together. For example, commands that modify the fields of the
same Item
can be grouped together for a unique execution.
If nested commands cannot be grouped, they will be executed sequentially. So using a CompoundCommand
even in that case would not
introduce extra overhead.
Constructor and Description |
---|
CompoundCommand()
Instantiates an empty compound command.
|
CompoundCommand(List<ExecutableCommand> commands)
Instantiates an command that wraps the specified list of commands.
|
Modifier and Type | Method and Description |
---|---|
void |
add(ExecutableCommand command)
Wraps a command in the compound command.
|
void |
addAll(List<ExecutableCommand> commands)
Wraps commands in the compound command.
|
execute
public CompoundCommand()
public CompoundCommand(List<ExecutableCommand> commands)
commands
- the commands to wrap in the compound command.public void add(ExecutableCommand command)
command
- the command to be wrapped.public void addAll(List<ExecutableCommand> commands)
commands
- the commands to be wrapped.