public void setupReplyMessage ( BaseMessage messageReply , BaseMessage messageOut , String strMessageInfoType , String strMessageProcessType ) { if ( messageReply != null ) // No reply if null. { TrxMessageHeader trxMessageHeaderIncomming = null ; if ( messageOut != null ) trxMessageHeaderIncomming = ( TrxMessageHeader ) messageOut . getMessageHeader ( ) ; if ( trxMessageHeaderIncomming != null ) { TrxMessageHeader replyHeader = ( TrxMessageHeader ) messageReply . getMessageHeader ( ) ; if ( replyHeader == null ) messageReply . setMessageHeader ( replyHeader = new TrxMessageHeader ( null , null ) ) ; replyHeader . putAll ( trxMessageHeaderIncomming . createReplyHeader ( ) ) ; if ( strMessageInfoType != null ) ( ( TrxMessageHeader ) messageReply . getMessageHeader ( ) ) . put ( TrxMessageHeader . MESSAGE_INFO_TYPE , strMessageInfoType ) ; // Make sure this is seen as a reply if ( strMessageProcessType != null ) ( ( TrxMessageHeader ) messageReply . getMessageHeader ( ) ) . put ( TrxMessageHeader . MESSAGE_PROCESS_TYPE , strMessageProcessType ) ; // Make sure this is seen as a reply if ( ( ( TrxMessageHeader ) messageReply . getMessageHeader ( ) ) . getMessageInfoMap ( ) != null ) ( ( TrxMessageHeader ) messageReply . getMessageHeader ( ) ) . getMessageInfoMap ( ) . remove ( TrxMessageHeader . MESSAGE_PROCESSOR_CLASS ) ; // The reply never uses the message in's processor Record recMessageProcessInfo = this . getRecord ( MessageProcessInfoModel . MESSAGE_PROCESS_INFO_FILE ) ; if ( recMessageProcessInfo == null ) recMessageProcessInfo = Record . makeRecordFromClassName ( MessageProcessInfoModel . THICK_CLASS , this ) ; this . addMessageTransportType ( messageReply ) ; // This will insure I get the transport properties ( ( MessageProcessInfoModel ) recMessageProcessInfo ) . setupMessageHeaderFromCode ( messageReply , null , null ) ; } if ( strMessageInfoType != null ) ( ( TrxMessageHeader ) messageReply . getMessageHeader ( ) ) . put ( TrxMessageHeader . MESSAGE_INFO_TYPE , strMessageInfoType ) ; // Make sure this is seen as a reply if ( strMessageProcessType != null ) ( ( TrxMessageHeader ) messageReply . getMessageHeader ( ) ) . put ( TrxMessageHeader . MESSAGE_PROCESS_TYPE , strMessageProcessType ) ; // Make sure this is seen as a reply } }
Set up a message header for this reply using the message header for the original message .