atg.integrations
Class BaseCommandHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.integrations.BaseCommandHandler
All Implemented Interfaces:
CommandHandler, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class BaseCommandHandler
extends GenericService
implements CommandHandler

This class is the implementaion of CommandHandler interface that calls the nextCommandHandler if it is defined, or will executes the Command object passed if it is not..


Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
BaseCommandHandler()
           
 
Method Summary
 CommandResult executeCommand(Command pCommand, java.lang.Object pInput)
          Checks to see if nextCommandHandler is set.
 CommandHandler getNextCommandHandler()
          Returns Next Command Handler to invoke in the command invocation chain.
 void setNextCommandHandler(CommandHandler pNextCommandHandler)
          Sets Next CommandHandler in the command invocation chain to invoke
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

BaseCommandHandler

public BaseCommandHandler()
Method Detail

getNextCommandHandler

public CommandHandler getNextCommandHandler()
Returns Next Command Handler to invoke in the command invocation chain. If this is set, then it will be called. If it is not, then the Command is executed.

Specified by:
getNextCommandHandler in interface CommandHandler
Returns:
the NextCommandHandler

setNextCommandHandler

public void setNextCommandHandler(CommandHandler pNextCommandHandler)
Sets Next CommandHandler in the command invocation chain to invoke


executeCommand

public CommandResult executeCommand(Command pCommand,
                                    java.lang.Object pInput)
                             throws CommandInvocationException,
                                    CommandTimeoutException,
                                    InvalidInputException
Checks to see if nextCommandHandler is set. If it is, then nextCommandHandler.executeCommand() is called. If it is not, then this method will call the execute method on the command. In either case, pInput is the input to the method, and a CommandResult is returned.

Specified by:
executeCommand in interface CommandHandler
Parameters:
pCommand - the Command to invoke with the given input.
pInput - the input Map to the Command
Returns:
the CommandResult from invoking nextCommandHandler.executeCommand() or Command.execute()
Throws:
CommandInvocationException - if any error occurs or exception is thrown while executing the Command.
CommandTimeoutException - if timeout occurs while invoking the command.
InvalidInputException - if input object passed is invalid.