public interface Command
extends java.io.Serializable
The Command interface is extended by both the TargetableCommand and CompensableCommand interfaces, which offer additional features. The TargetableCommandImpl abstract class, which implements many of the features of the TargetableCommand interface, provides a runtime for command execution.
Modifier and Type | Field and Description |
---|---|
static long |
serialVersionUID |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Executes the task encapsulated by this command.
|
boolean |
isReadyToCallExecute()
Indicates if all required input properties have been set.
|
void |
reset()
Sets the output properties to the values they had before the
the execute() method was run.
|
static final long serialVersionUID
void execute() throws CommandException
false
.
This method is implemented in the TargetableCommandImpl class.
CommandException
- The superclass for all command exceptions.
Specifically, UnsetInputPropertiesException is thrown if the
isReadyToCallExecute() method returns false
.boolean isReadyToCallExecute()
The programmer must determine the conditions under which a command is considered ready to run and implement this abstract method appropriately.
true
if the command is ready to execute.void reset()
The programmer must determine how to reset the input properties and implement this abstract method accordingly.