com.ibm.websphere.command

Interface Command

All Superinterfaces:
java.io.Serializable
All known subinterfaces:
CacheableCommand, CompensableCommand, TargetableCommand
All known implementing classes:
CacheableCommandImpl, TargetableCommandImpl

  1. public interface Command
  2. extends java.io.Serializable
The Command interface defines the client side for fundamental command functionality. A command encapsulates the set of operations that makes up a business task. Commands provide the following advantages over conventional client-server interaction:

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.


Field Summary

Modifier and Type Field and Description
  1. static
  2. long
serialVersionUID

Method Summary

Modifier and Type Method and Description
  1. void
execute()
Executes the task encapsulated by this command.
  1. boolean
isReadyToCallExecute()
Indicates if all required input properties have been set.
  1. void
reset()
Sets the output properties to the values they had before the the execute() method was run.

Field Detail

serialVersionUID

  1. static final long serialVersionUID
See Also:

Method Detail

execute

  1. void execute()
  2. throws CommandException
Executes the task encapsulated by this command. This method calls the isReadyToCallExecute() method and throws UnsetInputPropertiesException if the isReadyToCallExecute() method returns false.

This method is implemented in the TargetableCommandImpl class.

Throws:
CommandException - The superclass for all command exceptions. Specifically, UnsetInputPropertiesException is thrown if the isReadyToCallExecute() method returns false.

isReadyToCallExecute

  1. boolean isReadyToCallExecute()
Indicates if all required input properties have been set. The isReadyToCall() method is called in the client-side JVM by the execute() before the command is given to the target server to run, but an application programmer can also call this method.

The programmer must determine the conditions under which a command is considered ready to run and implement this abstract method appropriately.

Returns:
The value true if the command is ready to execute.

reset

  1. void reset()
Sets the output properties to the values they had before the the execute() method was run. After calling the reset() method, the methods to get output properties no longer work, but the isReadyToCallExecute() method returns true. The reset() method provides a convenient and efficient way to reuse a command instance after changing some input properties or the target.

The programmer must determine how to reset the input properties and implement this abstract method accordingly.