The atg.integrations.Command
interface is a generic representation of a command. You create specific commands by implementing this interface.
The Command
interface has two methods for executing commands, execute()
and invokeRPC()
. Both of these methods take a java.lang.Object
as input (to be as generic as possible), and return a CommandResult
. The execute()
method is the one actually called by an application. Invoking this method sets off a chain of actions that ultimately results in the invokeRPC()
method being executed. The invokeRPC()
method does the actual work of making a call to the remote system. Note, however, that applications should not call this method directly, as the processing of commands is based on the assumption that execute()
is called first.
The Command.execute()
method must implement the following logic:
If the
Command
points to aCommandHandler
(that is, if theCommand.commandHandler
property is not null), pass theCommand
and its input to thatCommandHandler
by calling theCommandHandler.executeCommand()
method.If the
Command
does not point to aCommandHandler
, call theCommand.invokeRPC()
method.