org.openeai.jms.consumer.commands
Class RequestCommandImpl

java.lang.Object
  |
  +--org.openeai.OpenEaiObject
        |
        +--org.openeai.jms.consumer.commands.ConsumerCommand
              |
              +--org.openeai.jms.consumer.commands.RequestCommandImpl
Direct Known Subclasses:
EnterpriseApplicationServiceCommand, EnterpriseRequestProxyCommand, FailureRequestCommand

public class RequestCommandImpl
extends ConsumerCommand

The "default" anscestor of all RequestCommands that are executed by a PointToPointConsumer.

Organizations can add an additional layer between this class and the command implementations they develop or they can even eliminate the use of this class altogether. This class provides many useful convenience methods that are commonly needed by all RequestCommand implementations. Additional common routines will be added to this layer as time goes by...

Version:
3.0 beta2 - 28 January 2003

Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
ConsumerCommand, RequestCommand, SyncCommandImpl, SyncCommand

Field Summary
 
Fields inherited from class org.openeai.jms.consumer.commands.ConsumerCommand
CREATE_ACTION, DELETE_ACTION, MESSAGE_ACTION, MESSAGE_CATEGORY, MESSAGE_OBJECT, MESSAGE_RELEASE, MESSAGE_TYPE, QUERY_ACTION, UPDATE_ACTION
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
RequestCommandImpl()
           
RequestCommandImpl(CommandConfig cConfig)
          Default constructor behavior that will apply to all RequestCommand implementations.
 
Method Summary
 java.lang.String buildReplyDocument(org.jdom.Element senderControlArea, org.jdom.Document replyDoc)
          This method is used to build a standard reply document that contains data specified by the command returning the reply (during it's 'execute' method execution).
protected  java.lang.String buildReplyDocumentWithErrors(org.jdom.Element senderControlArea, org.jdom.Document replyDoc, java.util.List errors)
          This method is used to build a reply document that contains error specified by the command returning the reply (during it's 'execute' method execution).
protected  java.lang.String buildReplyDocumentWithErrors(org.jdom.Element senderControlArea, org.jdom.Document replyDoc, java.util.List errors, java.lang.Throwable e)
          This method is used to build a reply document that contains error specified by the command returning the reply (during it's 'execute' method execution).
protected  javax.jms.Message getMessage(javax.jms.TextMessage msg, java.lang.String replyContents)
          Adds the supplied reply contents to the supplied message, and returns the message.
 
Methods inherited from class org.openeai.jms.consumer.commands.ConsumerCommand
addAppConfig, buildError, convertToString, generateRelease, getAppConfig, getAppConfigs, getControlArea, getInboundXmlValidation, getMessageAction, getMessageBody, getMessageCategory, getMessageDumpDirectory, getMessageObject, getMessageRelease, getMessageType, getMsgComponents, getOutboundXmlValidation, initializeInput, setAppConfig, setInboundXmlValidation, setMessageDumpDirectory, setMsgComponents, setOutboundXmlValidation, setWriteToFile, writeMessageToFile, writeToFile
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestCommandImpl

public RequestCommandImpl()

RequestCommandImpl

public RequestCommandImpl(CommandConfig cConfig)
                   throws java.lang.InstantiationException
Default constructor behavior that will apply to all RequestCommand implementations. This is the constructor called by AppConfig/ConsumerConfig during gateway initialization. Calls the ConsumerCommand constructor.

Throws:
java.lang.InstantiationException - if errors occur during initialization.
Method Detail

getMessage

protected final javax.jms.Message getMessage(javax.jms.TextMessage msg,
                                             java.lang.String replyContents)
                                      throws CommandException
Adds the supplied reply contents to the supplied message, and returns the message.

Parameters:
msg - the message to which reply contents are to be added
replyContents - the reply contents to add to the message
CommandException

buildReplyDocumentWithErrors

protected final java.lang.String buildReplyDocumentWithErrors(org.jdom.Element senderControlArea,
                                                              org.jdom.Document replyDoc,
                                                              java.util.List errors)
This method is used to build a reply document that contains error specified by the command returning the reply (during it's 'execute' method execution). This is the data (containing the error(s)) that will be returned to the requesting application.


buildReplyDocumentWithErrors

protected final java.lang.String buildReplyDocumentWithErrors(org.jdom.Element senderControlArea,
                                                              org.jdom.Document replyDoc,
                                                              java.util.List errors,
                                                              java.lang.Throwable e)
This method is used to build a reply document that contains error specified by the command returning the reply (during it's 'execute' method execution). This is the data (containing the error(s)) that will be returned to the requesting application. This method also accepts an Exception that can be passed that will be 'appended' to the list of errors being returned in the reply document. This method should be used if an Exception is caught during the 'execution' of the command.


buildReplyDocument

public final java.lang.String buildReplyDocument(org.jdom.Element senderControlArea,
                                                 org.jdom.Document replyDoc)
This method is used to build a standard reply document that contains data specified by the command returning the reply (during it's 'execute' method execution). This is the data that will be returned to the requesting application. It 'augments' the current contents of the reply document passed in with dynamic ControlAreaReply information.



Copyright © 2002, OpenEAI Software Foundation