| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CommandHandler
A CommandHandler is an interface that allows an implementing class to
 either process a Command and input to the Command before it
 is executed, or after it is executed. 
 CommandHandlers can be chained together to achieve layered services,
 by configuring #getNextCommandHandler()
 with the next Command Handler to invoke and invoking
 NextCommandHandlerexecuteCommand() of the NextCommandHandler in the
 executeCommand() method.
 
 If CommandHandler is doing pre processing then it should
 do it before invoking the NextCommandHandler, and if it is
 doing post processing it should do it after invoking the
 NextCommandHandler
 
 CommandHandlers can take either a Map or List as input to their
 executeCommand() method.
At the end of any configured chain of CommandHandlers must be a CommandHandler that is capable of executing the Command that was passed to it. That is, there is a CommandHandler that actually executes the Command object.
Examples of CommandHandlers are: post processing by moving data from a results bucket to an exceptions bucket, caching command calls, and auditing.
| Field Summary | |
|---|---|
static java.lang.String | 
CLASS_VERSION
 | 
| Method Summary | |
|---|---|
 CommandResult | 
executeCommand(Command pCommand,
               java.lang.Object pInput)
Process the Command and input to the Command before
 or after invoking the NextCommandHandler. | 
 CommandHandler | 
getNextCommandHandler()
Returns Next CommandHandler in the command invocation chain to invoke.  | 
| Field Detail | 
|---|
static final java.lang.String CLASS_VERSION
| Method Detail | 
|---|
CommandHandler getNextCommandHandler()
CommandHandler is the end of command invocation chain
 then this property is not expected to be set.
CommandResult executeCommand(Command pCommand,
                             java.lang.Object pInput)
                             throws CommandInvocationException,
                                    CommandTimeoutException,
                                    InvalidInputException
Command and input to the Command before
 or after invoking the NextCommandHandler. If this is the
 end of the invocation chain then this CommandHandler is
 expected to execute the Command directly.
  If this CommandHandler is doing pre processing then
 it should do it before invoking the executeCommand()
 of the NextCommandHandler, and if it is doing post
 processing it should do it after invoking the executeCommand()
 of the NextCommandHandler
pCommand - the command to execute.pInput - the input to the command
CommandInvocationException - if any error occurs, or any exception
  is thrown while executing the Command.
CommandTimeoutException - if timeout occurs while invoking the command.
InvalidInputException - if input object passed is invalid.
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||