com.ibm.websphere.command
Interface CompensableCommand
All Superinterfaces:
Command, java.io.Serializable
- public interface CompensableCommand
- extends Command
The CompensableCommand interface defines one method, getCompensatingCommand(), which returns the compensating command associated with a command. The application programmer must implement both this method and the compensating command itself as part of implementing a compensable command.
A client that wants to reverse a compensable command calls the compensating command like this:
myCommand.getCompensatingCommand().performExecute();
Field Summary
Fields inherited from interface com.ibm.websphere.command.Command |
---|
serialVersionUID |
Method Summary
Modifier and Type | Method and Description |
---|---|
getCompensatingCommand()
Retrieves the compensating command associated with the command.
|
Methods inherited from interface com.ibm.websphere.command.Command |
---|
execute, isReadyToCallExecute, reset |
Method Detail
getCompensatingCommand
- Command getCompensatingCommand( )
- throws CommandException
Returns:
The compensating command associated with the command.
Throws:
CommandException
- The superclass for all command exceptions. Specifically,
UnavailableCompensatingCommandException is thrown if there is no
compensating command associated with the command.
The application programmer implements the getCompensatingCommand method as part of writing a compensable command. For a compensating command whose input properties are the output properties of the original command, the following implementation is sufficient: