Extending this class gives all command services the same interface, which is how the {@link CommandProcessor} canbe extended to execute arbitrary commands.
All command services are registered with the {@link CommandServiceDirectoryMBean command service directory}, which allows the command processor to find this service and its supported commands easily.
Note that subclasses do not need define their own MBean interface; they need only inherit this service's MBean interface in order to plug into the command processor infrastructure.
This class is typically used to process requests of the same kind of command, or perhaps different versions of the same kind of command. To facilitate easier support for multiple commands, see {@link MultipleCommandService}. Use that class if a command service expects to process many different kinds of commands. That is not to say direct subclasses of this class cannot support multiple commands - they can. However, it typically will involve the execute method containing a series of if-then-else
statements to check the instanceof
value of the incoming {@link Command} object.
|
|