|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.messaging.SourceSinkTemplate atg.b2bcommerce.approval.MessagePipelineMapper
public class MessagePipelineMapper
This class executes a Pipeline chain upon receipt of a JMS message. It is designed to execute the chain in its own transaction. If an exception occurs, then an error chain is executed rather than throwing the exception back to the messaging system which would then resend it.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
protected static java.util.ResourceBundle |
sResourceBundle
Resource Bundle |
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 | |
---|---|
MessagePipelineMapper()
Creates a new MessagePipelineMapper instance. |
Method Summary | |
---|---|
protected void |
executeErrorChain(javax.jms.ObjectMessage pMessage,
java.lang.String pMessageType,
java.lang.String pPortName,
java.lang.Object pParams)
This method is executed when a fatal error occurs. |
PipelineManager |
getApprovalPipelineManager()
Returns property approvalPipelineManager |
protected java.lang.String |
getErrorPipelineIdForMessage(javax.jms.ObjectMessage pMessage,
java.lang.String pMessageType,
java.lang.String pPortName)
This method is used to obtain the error pipeline chain that should be executed if the execution for a given incoming message fails. |
java.util.Properties |
getMessageTypeToChainNameMap()
Return the MessageTypeToChainNameMap property. |
java.util.Properties |
getMessageTypeToErrorChainNameMap()
Return the MessageTypeToErrorChainNameMap property. |
protected java.lang.String |
getPipelineIdForMessage(javax.jms.ObjectMessage pMessage,
java.lang.String pMessageType,
java.lang.String pPortName)
This method is used to obtain the pipeline chain that should be executed for a given incoming message. |
protected java.util.Map |
getPipelineParamsForMessage(javax.jms.ObjectMessage pMessage,
java.lang.String pMessageType,
java.lang.String pPortName)
This method is responsible for populating a Map with the appropriate information on what data should be passed to a pipline chain. |
javax.transaction.TransactionManager |
getTransactionManager()
Returns property transactionManager |
protected void |
handleObjectMessage(javax.jms.ObjectMessage pMessage,
java.lang.String pMessageType,
java.lang.String pPortName,
java.lang.Object pParams)
make a call to the appropriate method to handle the type of message that we have. |
protected boolean |
processPipelineErrors(PipelineResult pResult)
This method processes the pipeline result error messages. |
void |
receiveMessage(java.lang.String pPortName,
javax.jms.Message pMessage)
This method is called when an ApprovalUpdateMessage is sent to it. |
void |
setApprovalPipelineManager(PipelineManager pApprovalPipelineManager)
Sets property approvalPipelineManager |
void |
setMessageTypeToChainNameMap(java.util.Properties pMessageTypeToChainNameMap)
Set the MessageTypeToChainNameMap property. |
void |
setMessageTypeToErrorChainNameMap(java.util.Properties pMessageTypeToErrorChainNameMap)
Set the MessageTypeToErrorChainNameMap property. |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets property transactionManager |
Methods inherited from class atg.commerce.messaging.SourceSinkTemplate |
---|
getDelayOnSendRetry, getMessageSourceContext, getMessageSourceName, isAllowMessageSending, sendCommerceMessage, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setMessageSourceContext, setMessageSourceName, startMessageSource, stopMessageSource |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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 |
---|
public static java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
Constructor Detail |
---|
public MessagePipelineMapper()
MessagePipelineMapper
instance.
Creates a new HashMap for the messageTypeToChainNameMap
property.
Method Detail |
---|
public java.util.Properties getMessageTypeToChainNameMap()
public void setMessageTypeToChainNameMap(java.util.Properties pMessageTypeToChainNameMap)
pMessageTypeToChainNameMap
- public java.util.Properties getMessageTypeToErrorChainNameMap()
public void setMessageTypeToErrorChainNameMap(java.util.Properties pMessageTypeToErrorChainNameMap)
pMessageTypeToErrorChainNameMap
- public PipelineManager getApprovalPipelineManager()
public void setApprovalPipelineManager(PipelineManager pApprovalPipelineManager)
pApprovalPipelineManager
- the value to set for property approvalPipelineManagerpublic javax.transaction.TransactionManager getTransactionManager()
getTransactionManager
in class SourceSinkTemplate
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
setTransactionManager
in class SourceSinkTemplate
pTransactionManager
- the value to set for property transactionManagerpublic void receiveMessage(java.lang.String pPortName, javax.jms.Message pMessage) throws javax.jms.JMSException
receiveMessage
in interface MessageSink
receiveMessage
in class SourceSinkTemplate
javax.jms.JMSException
protected void handleObjectMessage(javax.jms.ObjectMessage pMessage, java.lang.String pMessageType, java.lang.String pPortName, java.lang.Object pParams) throws RunProcessException
pMessage
- an ObjectMessage
valuepPortName
- a String
value
RunProcessException
protected void executeErrorChain(javax.jms.ObjectMessage pMessage, java.lang.String pMessageType, java.lang.String pPortName, java.lang.Object pParams)
pMessage
- an ObjectMessage
valuepMessageType
- a String
valuepPortName
- a String
valueprotected java.lang.String getPipelineIdForMessage(javax.jms.ObjectMessage pMessage, java.lang.String pMessageType, java.lang.String pPortName)
The way that this method works is that it determins a pipeline chain to execute based upon the String in the pMessageType parameter. This by default is the JMSType of the ObjectMessage. This class maintains a Map of messageType to chain names. The key into this map should be the JMSType of the particular message. So, if a message of type atg.commerce.order.SubmitOrder comes into
pMessage
- an ObjectMessage
valuepMessageType
- a String
valuepPortName
- a String
value
String
valueprotected java.lang.String getErrorPipelineIdForMessage(javax.jms.ObjectMessage pMessage, java.lang.String pMessageType, java.lang.String pPortName)
pMessage
- an ObjectMessage
valuepMessageType
- a String
valuepPortName
- a String
value
String
valueprotected java.util.Map getPipelineParamsForMessage(javax.jms.ObjectMessage pMessage, java.lang.String pMessageType, java.lang.String pPortName)
pMessage
- an ObjectMessage
valuepMessageType
- a String
valuepPortName
- a String
value
Map
valueprotected boolean processPipelineErrors(PipelineResult pResult)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |