Interfaces for creating commands
The Command interface specifies the most basic aspects of a command. This interface is extended by both the TargetableCommand interface and the CompensableCommand interface, which offer additional features. To create commands for applications, :
- Define an interface that extends one or more of interfaces in the command package.
- Provide an implementation class for your interface.
In practice, most commands implement the TargetableCommand interface, which allows the command to be executed remotely. The following example shows the structure of a command interface for a targetable command:
... import com.ibm.websphere.command.*; public interface MySimpleCommand extends TargetableCommand { // Declare application methods here }The CompensableCommand interface enables the association of one command with another that can undo the work of the first. Compensable commands also typically implement the TargetableCommand interface. The following example shows the structure of a command interface for a targetable, compensable command:... import com.ibm.websphere.command.*; public interface MyCommand extends TargetableCommand, CompensableCommand { // Declare application methods here }
Related tasks
Writing command interfaces
Related Reference
TargetableCommand interface
CompensableCommand interface