TargetableCommand interface
The TargetableCommand interface extends the Command interface and provides for remote execution of commands.
Most commands will be targetable commands. The TargetableCommand interface declares several additional methods:
- setCommandTarget
This method allows you to specify the target object to a command.
- setCommandTargetName
This method allows you to specify the target by name to a command
- getCommandTarget
This method returns the target object of the command.
- getCommandTargetName
This method returns the name of the target object of the command.
- hasOutputProperties
This method indicates whether the command has output that must be copied back to the client. (The implementation class also provides a method, setHasOutputProperties, for setting the output of this method. By default, hasOutputProperties returns true.)
- setOutputProperties
This method saves output values from the command for return to the client.
- performExecute
This method encapsulates the application-specific work. It is called for you by the execute method declared in the Command interface.
With the exception of the performExecute method, which implement, all of these methods are implemented in the TargetableCommandImpl class. This class also implements the execute method declared in the Command interface.
Sub-topics
Command interface example application
Related tasks
Writing command interfaces
Reference topic