public interface CommandTarget
The CommandTarget interface declares one method, executeCommand(). The command package provides an implementation of this interface in the com.ibm.websphere.command.LocalTarget class. This class can be used when the client and server reside in the same JVM. For convenience, this target's name is aliased to the global (public static) variable LOCAL in the TargetableCommandImpl class.
Applications that need to run commands remotely must override this local implementation of the CommandTarget interface. An implementation of the executeCommand() method has three tasks:
true, the target must return a copy of the command to the client with the get accessor methods loaded.
The CommandTarget interface can be implemented in a variety of ways. One technique makes the target object a client-side adapter that deals with the server's protocol. A technique that offers more transparent local/remote communication makes the target a server-side object with a client-side stub. An example of this technique uses an enterprise bean's remote interface as the target. In this case, the target can be used to run the command in the same server as another object.
TargetableCommand executeCommand(TargetableCommand command) throws java.rmi.RemoteException, CommandException
command- The targetable command to be run.
false, this method can return null as a performance optimization.
java.rmi.RemoteException- The superclass for all remote exceptions. This type is thrown in case a remote server (like an EJB server) throws an RMI remote exception.
CommandException- The superclass for all command exceptions.