com.ibm.websphere.command
Interface Command
All Superinterfaces:
java.io.Serializable
All known subinterfaces:
All known implementing classes:
- public interface Command
- extends java.io.Serializable
- They provide a simple, uniform way to call business logic, regardless of the programming style used for the business logic (for example, enterprise beans, JDBC, stored procedures, connectors, file access).
- They reduce the number of messages used when a client interacts with a remote server, often replacing several messages that do small pieces of work with a single message that does all of them.
- They provide local-remote transparency; the client-side command code is independent of whether the command is executed in the client's JVM or a remote JVM.
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 |
---|---|
|
serialVersionUID
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
execute()
Executes the task encapsulated by this command.
|
|
isReadyToCallExecute()
Indicates if all required input properties have been set.
|
|
reset()
Sets the output properties to the values they had before the
the execute() method was run.
|
Field Detail
serialVersionUID
- static final long serialVersionUID
See Also:
Method Detail
execute
- void execute()
- throws CommandException
Throws:
CommandException
- The superclass for all command exceptions.
Specifically, UnsetInputPropertiesException is thrown if the
isReadyToCallExecute() method returns false
. isReadyToCallExecute
- 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
- 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.
false
.This method is implemented in the TargetableCommandImpl class.