|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CompensableCommand
The CompensableCommand interface allows you to make a command reversible. When you make a command compensable, you associate a second command with it. The second command compensates for the effects of the first command by undoing its work as completely as possible.
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 | |
---|---|
Command |
getCompensatingCommand()
Retrieves the compensating command associated with the command. |
Methods inherited from interface com.ibm.websphere.command.Command |
---|
execute, isReadyToCallExecute, reset |
Method Detail |
---|
Command getCompensatingCommand() throws CommandException
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:
Command command = new MyCompensatingCommand(); command.setInputPropertyX(outputPropertyP); return command;
CommandException
- The superclass for all command exceptions. Specifically,
UnavailableCompensatingCommandException is thrown if there is no
compensating command associated with the command.
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |