Package org.apache.sandesha2

Examples of org.apache.sandesha2.RMMsgContext


            String key = stMapBean.getMessageContextRefKey();


            MessageContext msgToInvoke = storageManager.retrieveMessageContext(key,context);

            RMMsgContext rmMsg = MsgInitializer
                .initializeMessage(msgToInvoke);
            Sequence seq = (Sequence) rmMsg
                .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);

            long msgNo = seq.getMessageNumber().getMessageNumber();

            try {
              //Invoking the message.

              //currently Transaction based invocation can be supplied only for the in-only case.
             
              if (!AxisOperationFactory.MEP_URI_IN_ONLY.equals(msgToInvoke.getAxisOperation().getMessageExchangePattern())) {
                invocationTransaction.commit();
              }
             
              new AxisEngine (msgToInvoke.getConfigurationContext())
                  .resume(msgToInvoke);
              invoked = true;
             
              if (!AxisOperationFactory.MEP_URI_IN_ONLY.equals(msgToInvoke.getAxisOperation().getMessageExchangePattern())) {
                invocationTransaction = storageManager.getTransaction();
              }           

              storageMapMgr.delete(key);
            } catch (AxisFault e) {
              throw new SandeshaException(e);
            }

            //undating the next msg to invoke


            if (rmMsg.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {
              Sequence sequence = (Sequence) rmMsg
                  .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
              if (sequence.getLastMessage() != null) {
               
                TerminateManager.cleanReceivingSideAfterInvocation(context, sequenceId);
               
View Full Code Here


      log.debug(message);
      throw new SandeshaException (message);
    }
   
    FaultManager faultManager = new FaultManager();
    RMMsgContext faultMessageContext = faultManager.checkForUnknownSequence(terminateSeqRMMsg,sequenceId);
    if (faultMessageContext != null) {
      ConfigurationContext configurationContext = terminateSeqMsg.getConfigurationContext();
      AxisEngine engine = new AxisEngine(configurationContext);
     
      try {
        engine.sendFault(faultMessageContext.getMessageContext());
      } catch (AxisFault e) {
        throw new SandeshaException ("Could not send the fault message",e);
      }
      return;
    }
View Full Code Here

       
        MessageContext highestInMsg = storageManager.retrieveMessageContext(highestImMsgKey,configCtx);
        MessageContext highestOutMessage = highestInMsg.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_OUT_VALUE);
       
        if (highestOutMessage!=null) {
          RMMsgContext highestOutRMMsg = MsgInitializer.initializeMessage(highestOutMessage);
          Sequence seqPartOfOutMsg = (Sequence) highestOutRMMsg.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
       
          if (seqPartOfOutMsg!=null) {
           
            //response message of the last in message can be considered as the last out message.
            highestOutMsgNo = seqPartOfOutMsg.getMessageNumber().getMessageNumber();
View Full Code Here

    ConfigurationContext configCtx = terminateSeqMsg.getConfigurationContext();
   
    MessageContext outMessage = null;
    outMessage = Utils.createOutMessageContext(terminateSeqMsg);
   
    RMMsgContext terminateSeqResponseRMMsg = RMMsgCreator
        .createTerminateSeqResponseMsg(terminateSeqRMMsg, outMessage);
   
     RMMsgContext ackRMMessage = AcknowledgementManager.generateAckMessage(terminateSeqRMMsg,sequenceID);
     SequenceAcknowledgement seqAck = (SequenceAcknowledgement) ackRMMessage.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
     terminateSeqResponseRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT,seqAck);
    
     terminateSeqResponseRMMsg.addSOAPEnvelope();
    
    
View Full Code Here

      log.debug(message);
      throw new SandeshaException(message);
    }

    FaultManager faultManager = new FaultManager();
    RMMsgContext faultMessageContext = faultManager.checkForCreateSequenceRefused(createSeqMsg);
    if (faultMessageContext != null) {
      ConfigurationContext configurationContext = createSeqMsg.getConfigurationContext();
      AxisEngine engine = new AxisEngine(configurationContext);
     
      try {
        engine.sendFault(faultMessageContext.getMessageContext());
      } catch (AxisFault e) {
        throw new SandeshaException ("Could not send the fault message",e);
      }
     
      return;
    }

    MessageContext outMessage = null;
    outMessage = Utils.createOutMessageContext(createSeqMsg)//createing a new response message.
   
    ConfigurationContext context = createSeqMsg.getConfigurationContext();
   
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context);
    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
    Transaction createSequenceTransaction = storageManager.getTransaction();   //begining of a new transaction

    try {
      String newSequenceId = SequenceManager.setupNewSequence(createSeqRMMsg)//newly created sequnceID.
     
      RMMsgContext createSeqResponse = RMMsgCreator.createCreateSeqResponseMsg(
          createSeqRMMsg, outMessage,newSequenceId);    // converting the blank out message in to a create
                                                            // sequence response.
      createSeqResponse.setFlow(MessageContext.OUT_FLOW);
     
      createSeqResponse.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE,"true")//for making sure that this wont be processed again.
      CreateSequenceResponse createSeqResPart = (CreateSequenceResponse) createSeqResponse.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);

     
      //OFFER PROCESSING
      SequenceOffer offer = createSeqPart.getSequenceOffer();
      if (offer != null) {
        Accept accept = createSeqResPart.getAccept();
        if (accept == null) {
          String message = "An accept part has not been generated for the create seq request with an offer part";
          log.debug(message);
          throw new SandeshaException(message);
        }

        String offeredSequenceID = offer.getIdentifer().getIdentifier(); //offered seq. id.
       
        boolean offerEcepted = offerAccepted (offeredSequenceID,context,createSeqRMMsg);
       
        if (offerEcepted)  {
          //Setting the CreateSequence table entry for the outgoing side.
          CreateSeqBean createSeqBean = new CreateSeqBean();
          createSeqBean.setSequenceID(offeredSequenceID);
          String outgoingSideInternalSequenceID = SandeshaUtil.getOutgoingSideInternalSequenceID(newSequenceId);
          createSeqBean.setInternalSequenceID(outgoingSideInternalSequenceID);
          createSeqBean.setCreateSeqMsgID(SandeshaUtil.getUUID()); //this is a dummy value.
       
          CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
          createSeqMgr.insert(createSeqBean);
       
          //Setting sequence properties for the outgoing sequence.
          //Only will be used by the server side response path. Will be wasted properties for the client side.
       
          //setting the out_sequence_id
          SequencePropertyBean outSequenceBean = new SequencePropertyBean();
          outSequenceBean.setName(Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
          outSequenceBean.setValue(offeredSequenceID);
          outSequenceBean.setSequenceID(outgoingSideInternalSequenceID);
          seqPropMgr.insert(outSequenceBean);

          //setting the internal_sequence_id
          SequencePropertyBean internalSequenceBean = new SequencePropertyBean();
          internalSequenceBean.setName(Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID);
          internalSequenceBean.setSequenceID(offeredSequenceID);
          internalSequenceBean.setValue(outgoingSideInternalSequenceID);
          seqPropMgr.insert(internalSequenceBean);
        } else {
          //removing the accept part.
          createSeqResPart.setAccept(null);
          createSeqResponse.addSOAPEnvelope();
        }
      }

      EndpointReference acksTo = createSeqPart.getAcksTo().getAddress().getEpr();
      if (acksTo == null || acksTo.getAddress() == null
View Full Code Here

        && "true".equals(terminated.getValue())) {
      String message = "Terminate was added previously.";
      log.info(message);
    }

    RMMsgContext terminateRMMessage = RMMsgCreator
        .createTerminateSequenceMessage(referenceMessage, outSequenceId,internalSequenceId);
    terminateRMMessage.setFlow(MessageContext.OUT_FLOW);
    terminateRMMessage.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE,"true");
   
    SequencePropertyBean toBean = seqPropMgr.retrieve(internalSequenceId,
        Sandesha2Constants.SequenceProperties.TO_EPR);

    EndpointReference toEPR = new EndpointReference ( toBean.getValue());
    if (toEPR == null) {
      String message = "To EPR has an invalid value";
      throw new SandeshaException(message);
    }

    terminateRMMessage.setTo(new EndpointReference(toEPR.getAddress()));
   
    String addressingNamespaceURI = SandeshaUtil.getSequenceProperty(internalSequenceId,Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE,configurationContext);
    String anonymousURI = SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespaceURI);
   
    String rmVersion = SandeshaUtil.getRMVersion(internalSequenceId,configurationContext);
    if (rmVersion==null)
      throw new SandeshaException ("Cant find the rmVersion of the given message");
    terminateRMMessage.setWSAAction(SpecSpecificConstants.getTerminateSequenceAction(rmVersion));
    terminateRMMessage.setSOAPAction(SpecSpecificConstants.getTerminateSequenceSOAPAction(rmVersion));

    SequencePropertyBean transportToBean = seqPropMgr.retrieve(internalSequenceId,Sandesha2Constants.SequenceProperties.TRANSPORT_TO);
    if (transportToBean!=null) {
      terminateRMMessage.setProperty(MessageContextConstants.TRANSPORT_URL,transportToBean.getValue());
    }
   
    try {
      terminateRMMessage.addSOAPEnvelope();
    } catch (AxisFault e) {
      throw new SandeshaException(e.getMessage());
    }

    String key = SandeshaUtil.getUUID();
   
    SenderBean terminateBean = new SenderBean();
    terminateBean.setMessageContextRefKey(key);

   
    storageManager.storeMessageContext(key,terminateRMMessage.getMessageContext());

   
    //Set a retransmitter lastSentTime so that terminate will be send with
    // some delay.
    //Otherwise this get send before return of the current request (ack).
    //TODO: refine the terminate delay.
    terminateBean.setTimeToSend(System.currentTimeMillis()
        + Sandesha2Constants.TERMINATE_DELAY);

    terminateBean.setMessageID(terminateRMMessage.getMessageId());
   
    //this will be set to true at the sender.
    terminateBean.setSend(true);
   
    terminateRMMessage.getMessageContext().setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING,
        Sandesha2Constants.VALUE_FALSE);
   
    terminateBean.setReSend(false);

    SenderBeanMgr retramsmitterMgr = storageManager
        .getRetransmitterBeanMgr();

    retramsmitterMgr.insert(terminateBean);
   
    SequencePropertyBean terminateAdded = new SequencePropertyBean();
    terminateAdded.setName(Sandesha2Constants.SequenceProperties.TERMINATE_ADDED);
    terminateAdded.setSequenceID(outSequenceId);
    terminateAdded.setValue("true");

    seqPropMgr.insert(terminateAdded);
   
    //This should be dumped to the storage by the sender
    TransportOutDescription transportOut = terminateRMMessage.getMessageContext().getTransportOut();
    terminateRMMessage.setProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_OUT_DESC,transportOut);
    terminateRMMessage.setProperty(Sandesha2Constants.MESSAGE_STORE_KEY,key);
    terminateRMMessage.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE,Sandesha2Constants.VALUE_TRUE);
    terminateRMMessage.getMessageContext().setTransportOut(new Sandesha2TransportOutDesc ());
    addTerminateSeqTransaction.commit();
   
      AxisEngine engine = new AxisEngine (configurationContext);
      try {
      engine.send(terminateRMMessage.getMessageContext());
    } catch (AxisFault e) {
      throw new SandeshaException (e.getMessage());
    }
     
  }
View Full Code Here

    MessageContext msgCtx = rmMsgCtx.getMessageContext();
   
    String sequenceID = closeSequence.getIdentifier().getIdentifier();
   
    FaultManager faultManager = new FaultManager();
    RMMsgContext faultMessageContext = faultManager.checkForUnknownSequence(rmMsgCtx,sequenceID);
    if (faultMessageContext != null) {
      ConfigurationContext configurationContext = msgCtx.getConfigurationContext();
      AxisEngine engine = new AxisEngine(configurationContext);
     
      try {
        engine.sendFault(faultMessageContext.getMessageContext());
      } catch (AxisFault e) {
        throw new SandeshaException ("Could not send the fault message",e);
      }
     
      return;
    }
   
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx);
   
    Transaction closeSequenceTransaction = storageManager.getTransaction();
   
    SequencePropertyBeanMgr sequencePropMgr = storageManager.getSequencePropretyBeanMgr();
    SequencePropertyBean sequenceClosedBean = new SequencePropertyBean ();
    sequenceClosedBean.setSequenceID(sequenceID);
    sequenceClosedBean.setName(Sandesha2Constants.SequenceProperties.SEQUENCE_CLOSED);
    sequenceClosedBean.setValue(Sandesha2Constants.VALUE_TRUE);
   
    sequencePropMgr.insert(sequenceClosedBean);
   
    RMMsgContext ackRMMsgCtx = AcknowledgementManager.generateAckMessage(rmMsgCtx,sequenceID);
   
    MessageContext ackMsgCtx = ackRMMsgCtx.getMessageContext();
   
    String rmNamespaceValue = rmMsgCtx.getRMNamespaceValue();
    ackRMMsgCtx.setRMNamespaceValue(rmNamespaceValue);
   

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil
        .getSOAPVersion(rmMsgCtx.getSOAPEnvelope()));
   
    //Setting new envelope
    SOAPEnvelope envelope = factory.getDefaultEnvelope();
    try {
      ackMsgCtx.setEnvelope(envelope);
    } catch (AxisFault e3) {
      throw new SandeshaException(e3.getMessage());
    }
   
    //adding the ack part to the envelope.
    SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) ackRMMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
 
    MessageContext closeSequenceMsg = rmMsgCtx.getMessageContext();
   
    MessageContext closeSequenceResponseMsg = null;
    closeSequenceResponseMsg = Utils.createOutMessageContext(closeSequenceMsg);
   
    RMMsgContext closeSeqResponseRMMsg = RMMsgCreator
        .createCloseSeqResponseMsg(rmMsgCtx, closeSequenceResponseMsg);
   
    closeSeqResponseRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT,sequenceAcknowledgement);
   
    closeSeqResponseRMMsg.setFlow(MessageContext.OUT_FLOW);
    closeSeqResponseRMMsg.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE,"true");

    closeSequenceResponseMsg.setResponseWritten(true);
   
    closeSeqResponseRMMsg.addSOAPEnvelope();
   
    AxisEngine engine = new AxisEngine (closeSequenceMsg.getConfigurationContext());
   
    try {
      engine.send(closeSequenceResponseMsg);
View Full Code Here

            .getConfigurationContext());



    FaultManager faultManager = new FaultManager();
    RMMsgContext faultMessageContext = faultManager.checkForLastMsgNumberExceeded(rmMsgCtx);
    if (faultMessageContext != null) {
      ConfigurationContext configurationContext = msgCtx.getConfigurationContext();
      AxisEngine engine = new AxisEngine(configurationContext);
     
      try {
        engine.sendFault(faultMessageContext.getMessageContext());
      } catch (AxisFault e) {
        throw new SandeshaException ("Could not send the fault message",e);
      }
     
      return;
    }
   
    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
   
    //setting acked msg no range
    Sequence sequence = (Sequence) rmMsgCtx
        .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
    String sequenceId = sequence.getIdentifier().getIdentifier();
    ConfigurationContext configCtx = rmMsgCtx.getMessageContext()
        .getConfigurationContext();
    if (configCtx == null) {
      String message = "Configuration Context is null";
      log.debug(message);
      throw new SandeshaException(message);
    }

    faultMessageContext = faultManager.checkForUnknownSequence(rmMsgCtx,sequenceId);
    if (faultMessageContext != null) {
      ConfigurationContext configurationContext = msgCtx.getConfigurationContext();
      AxisEngine engine = new AxisEngine(configurationContext);
     
      try {
        engine.send(faultMessageContext.getMessageContext());
      } catch (AxisFault e) {
        throw new SandeshaException ("Could not send the fault message",e);
      }
     
      return;
    }
   
    //setting mustUnderstand to false.
    sequence.setMustUnderstand(false);
    rmMsgCtx.addSOAPEnvelope();
   
    //throwing a fault if the sequence is closed.
    faultMessageContext = faultManager. checkForSequenceClosed(rmMsgCtx,sequenceId);
    if (faultMessageContext != null) {
      ConfigurationContext configurationContext = msgCtx.getConfigurationContext();
      AxisEngine engine = new AxisEngine(configurationContext);
     
      try {
        engine.sendFault(faultMessageContext.getMessageContext());
      } catch (AxisFault e) {
        throw new SandeshaException ("Could not send the fault message",e);
      }
     
      return;
View Full Code Here

      //setting mustundestand=false for the ackRequested header block.
      ackRequested.setMustUnderstand(false);
      rmMsgCtx.addSOAPEnvelope();
    }
   
     RMMsgContext ackRMMessage = AcknowledgementManager.generateAckMessage(rmMsgCtx,sequenceId);
   
     AxisEngine engine = new AxisEngine (configCtx);
    
     try {
      engine.send(ackRMMessage.getMessageContext());
    } catch (AxisFault e) {
      String message = "Exception thrown while trying to send the ack message";
      throw new SandeshaException (message,e);
    }
  }
View Full Code Here

        reqMsgCtx = msgContext.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
      } catch (AxisFault e) {
        throw new SandeshaException (e);
      }

      RMMsgContext requestRMMsgCtx = MsgInitializer.initializeMessage(reqMsgCtx);

      Sequence reqSequence = (Sequence) requestRMMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      if (reqSequence == null) {
        String message = "Sequence part is null";
        log.debug(message);
        throw new SandeshaException(message);
      }

      String incomingSeqId = reqSequence.getIdentifier().getIdentifier();
      if (incomingSeqId == null || incomingSeqId == "") {
        String message = "Invalid seqence Id";
        log.debug(message);
        throw new SandeshaException(message);
      }

      long requestMsgNo = reqSequence.getMessageNumber().getMessageNumber();
     
      internalSequenceId = SandeshaUtil.getOutgoingSideInternalSequenceID(incomingSeqId);
     
      //deciding weather the last message.
      String requestLastMsgNoStr = SandeshaUtil.getSequenceProperty(incomingSeqId,Sandesha2Constants.SequenceProperties.LAST_IN_MESSAGE_NO,configContext);
      if (requestLastMsgNoStr!=null) {
        long requestLastMsgNo = Long.parseLong(requestLastMsgNoStr);
        if (requestLastMsgNo==requestMsgNo)
          lastMessage = true;
      }

    } else {
      // set the internal sequence id for the client side.
      EndpointReference toEPR = msgContext.getTo();
      if (toEPR == null || toEPR.getAddress() == null || "".equals(toEPR.getAddress())) {
        String message = "TO End Point Reference is not set correctly. This is a must for the sandesha client side.";
        log.debug(message);
        throw new SandeshaException(message);
      }

      String to = toEPR.getAddress();
      String sequenceKey = (String) msgContext.getProperty(SandeshaClientConstants.SEQUENCE_KEY);
      internalSequenceId = SandeshaUtil.getInternalSequenceID(to,sequenceKey);
     
      String lastAppMessage = (String) msgContext.getProperty(SandeshaClientConstants.LAST_MESSAGE);
      if (lastAppMessage!=null && "true".equals(lastAppMessage))
        lastMessage = true;
    }

    /* checking weather the user has given the messageNumber (most of the cases this will not be the case where
       the system will generate the message numbers */

    //User should set it as a long object.
    Long messageNumberLng = (Long) msgContext.getProperty(SandeshaClientConstants.MESSAGE_NUMBER);
   
    long givenMessageNumber = -1;
    if (messageNumberLng!=null) {
      givenMessageNumber = messageNumberLng.longValue();
      if (givenMessageNumber<=0) {
        throw new SandeshaException ("The givem message number value is invalid (has to be larger than zero)");
      }
    }
   
    //the message number that was last used.
    long systemMessageNumber = getPreviousMsgNo(configContext, internalSequenceId);
   
    //The number given by the user has to be larger than the last stored number.
    if (givenMessageNumber>0 && givenMessageNumber<=systemMessageNumber) {
      String message = "The given message number is not larger than value of the last sent message.";
      throw new SandeshaException (message);
    }
   
    //Finding the correct message number.
    long messageNumber = -1;
    if (givenMessageNumber>0)          // if given message number is valid use it. (this is larger than the last stored due to the last check)
      messageNumber = givenMessageNumber;
    else if (systemMessageNumber>0) {  //if system message number is valid use it.
      messageNumber = systemMessageNumber+1;
    } else {         //This is the fist message (systemMessageNumber = -1)
      messageNumber = 1;
    }
   
    //A dummy message is a one which will not be processed as a actual application message.
    //The RM handlers will simply let these go.
    String dummyMessageString = (String) msgContext.getOptions().getProperty(SandeshaClientConstants.DUMMY_MESSAGE);
    boolean dummyMessage = false;
    if (dummyMessageString!=null && Sandesha2Constants.VALUE_TRUE.equals(dummyMessageString))
      dummyMessage = true;
   
    //saving the used message number
    if (!dummyMessage)
      setNextMsgNo(configContext,internalSequenceId,messageNumber);
     
    //set this as the response highest message.
    SequencePropertyBean responseHighestMsgBean = new SequencePropertyBean (
        internalSequenceId,
        Sandesha2Constants.SequenceProperties.HIGHEST_OUT_MSG_NUMBER,
        new Long (messageNumber).toString()
    );
    seqPropMgr.insert(responseHighestMsgBean);
   
    if (lastMessage) {
 
      SequencePropertyBean responseHighestMsgKeyBean = new SequencePropertyBean (
          internalSequenceId,
          Sandesha2Constants.SequenceProperties.HIGHEST_OUT_MSG_KEY,
          storageKey
      )
     
      SequencePropertyBean responseLastMsgKeyBean = new SequencePropertyBean (
          internalSequenceId,
          Sandesha2Constants.SequenceProperties.LAST_OUT_MESSAGE_NO,
          new Long (messageNumber).toString()
      )
     
      seqPropMgr.insert(responseHighestMsgKeyBean);
      seqPropMgr.insert(responseLastMsgKeyBean);
    }
   
    boolean sendCreateSequence = false;

    SequencePropertyBean outSeqBean = seqPropMgr.retrieve(
        internalSequenceId,
        Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);

    // setting async ack endpoint for the server side. (if present)
    if (serverSide) {
      String incomingSequenceID = SandeshaUtil
          .getServerSideIncomingSeqIdFromInternalSeqId(internalSequenceId);
      SequencePropertyBean incomingToBean = seqPropMgr.retrieve(
          incomingSequenceID,
          Sandesha2Constants.SequenceProperties.TO_EPR);
      if (incomingToBean != null) {
        String incomingTo = incomingToBean.getValue();
        msgContext.setProperty(SandeshaClientConstants.AcksTo, incomingTo);
      }
    }

   
    //FINDING THE SPEC VERSION
    String specVersion = null;
    if (msgContext.isServerSide()) {
      //in the server side, get the RM version from the request sequence.
      MessageContext requestMessageContext;
      try {
        requestMessageContext = msgContext.getOperationContext().getMessageContext(AxisOperationFactory.MESSAGE_LABEL_IN_VALUE);
      } catch (AxisFault e) {
        throw new SandeshaException (e);
      }
     
      if (requestMessageContext==null)
        throw new SandeshaException ("Request message context is null, cant find out the request side sequenceID");
     
      RMMsgContext requestRMMsgCtx = MsgInitializer.initializeMessage(requestMessageContext);
      Sequence sequence = (Sequence) requestRMMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
     
      String requestSequenceID = sequence.getIdentifier().getIdentifier();
      SequencePropertyBean specVersionBean = seqPropMgr.retrieve(requestSequenceID,Sandesha2Constants.SequenceProperties.RM_SPEC_VERSION);
      if (specVersionBean==null)
        throw new SandeshaException ("SpecVersion sequence property bean is not available for the incoming sequence. Cant find the RM version for outgoing side");
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.RMMsgContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.