Package org.apache.sandesha2

Examples of org.apache.sandesha2.RMMsgContext


      if(transaction != null) {
        transaction.commit();
        transaction = storageManager.getTransaction();
      }
     
      RMMsgContext rmMsg = MsgInitializer.initializeMessage(msgToInvoke);

      // Lock the RMD Bean just to avoid deadlocks
      SandeshaUtil.getRMDBeanFromSequenceId(storageManager, invokerBean.getSequenceID());
      // Depending on the transaction  support, the service will be invoked only once.
      // Therefore we delete the invoker bean and message now, ahead of time
      invokerBeanMgr.delete(messageContextKey);
      // removing the corresponding message context as well.
      storageManager.removeMessageContext(messageContextKey);

      try {

        boolean postFailureInvocation = false;

        // StorageManagers should st following property to
        // true, to indicate that the message received comes
        // after a failure.
        String postFaulureProperty = (String) msgToInvoke
            .getProperty(Sandesha2Constants.POST_FAILURE_MESSAGE);
        if (postFaulureProperty != null
            && Sandesha2Constants.VALUE_TRUE.equals(postFaulureProperty))
          postFailureInvocation = true;

        if (postFailureInvocation) {
          makeMessageReadyForReinjection(msgToInvoke);
          if (log.isDebugEnabled())
            log.debug("Receiving message, key=" + messageContextKey + ", msgCtx="
                + msgToInvoke.getEnvelope().getHeader());
          AxisEngine.receive(msgToInvoke);
        } else {
          if (log.isDebugEnabled())
            log.debug("Resuming message, key=" + messageContextKey + ", msgCtx="
                + msgToInvoke.getEnvelope().getHeader());
          msgToInvoke.setPaused(false);
          AxisEngine.resumeReceive(msgToInvoke);
        }
       
        if (transaction != null && transaction.isActive()){
          transaction.commit();
        }
      } catch (Exception e) {
        if (log.isDebugEnabled())
          log.debug("Exception :", e);
       
          if (transaction != null && transaction.isActive()){
              transaction.rollback();           
          }
          handleFault(rmMsg, e);
      }


      transaction = storageManager.getTransaction();
      
      if (rmMsg.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {
        Sequence sequence = (Sequence) rmMsg
            .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
       
        boolean highestMessage = false;
        if (sequence.getLastMessage() != null) {
          //this will work for RM 1.0 only
View Full Code Here


    OperationContext createSeqOpCtx = createSeqmsgContext.getOperationContext();
    String createSeqMsgId = SandeshaUtil.getUUID();
    createSeqmsgContext.setMessageID(createSeqMsgId);
    context.registerOperationContext(createSeqMsgId, createSeqOpCtx);

    RMMsgContext createSeqRMMsg = new RMMsgContext(createSeqmsgContext);

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmsBean.getRMVersion());

    // Decide which addressing version to use. We copy the version that the application
    // is already using (if set), and fall back to the level in the spec if that isn't
    // found.
    String addressingNamespace = (String) applicationMsgContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
    Boolean disableAddressing = (Boolean) applicationMsgContext.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
    if(addressingNamespace == null) {
      // Addressing may still be enabled, as it defaults to the final spec. The only time
      // we follow the RM spec is when addressing has been explicitly disabled.
      if(disableAddressing != null && disableAddressing.booleanValue())
        addressingNamespace = SpecSpecificConstants.getAddressingNamespace(rmNamespaceValue);
      else
        addressingNamespace = AddressingConstants.Final.WSA_NAMESPACE;
    }
   
    // If acksTo has not been set, then default to anonymous, using the correct spec level
    EndpointReference acksToEPR = null;
    String acksToAddress = rmsBean.getAcksToEPR();
    if(acksToAddress != null) {
      acksToEPR = new EndpointReference(acksToAddress);
    } else {
      acksToEPR = new EndpointReference(SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespace));
    }
   
    CreateSequence createSequencePart = new CreateSequence(rmNamespaceValue);

    // Check if this service includes 2-way operations
    boolean twoWayService = false;
    AxisService service = applicationMsgContext.getAxisService();
    if(service != null) {
      Parameter p = service.getParameter(Sandesha2Constants.SERVICE_CONTAINS_OUT_IN_MEPS);
      if(p != null && p.getValue() != null) {
        twoWayService = ((Boolean) p.getValue()).booleanValue();
      }
    }
   
    // Adding sequence offer - if present. We send an offer if the client has assigned an
    // id, or if we are using WS-RM 1.0 and the service contains out-in MEPs
    boolean autoOffer = false;
    if(Sandesha2Constants.SPEC_2005_02.NS_URI.equals(rmNamespaceValue)) {
      autoOffer = twoWayService;
    } else {
      // We also do some checking at this point to see if MakeConection is required to
      // enable WS-RM 1.1, and write a warning to the log if it has been disabled.
      SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(context.getAxisConfiguration());
      if(twoWayService && !policy.isEnableMakeConnection()) {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.makeConnectionWarning);
        log.warn(message);
      }
    }

    String offeredSequenceId = (String) applicationMsgContext.getProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID);
    if(autoOffer ||
       (offeredSequenceId != null && offeredSequenceId.length() > 0))  {
     
      if (offeredSequenceId == null || offeredSequenceId.length() == 0) {
        offeredSequenceId = SandeshaUtil.getUUID();
      }

      SequenceOffer offerPart = new SequenceOffer(rmNamespaceValue);
      Identifier identifier = new Identifier(rmNamespaceValue);
      identifier.setIndentifer(offeredSequenceId);
      offerPart.setIdentifier(identifier);
      createSequencePart.setSequenceOffer(offerPart);
     
      if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(rmNamespaceValue)) {
        // We are going to send an offer, so decide which endpoint to include
        EndpointReference offeredEndpoint = (EndpointReference) applicationMsgContext.getProperty(SandeshaClientConstants.OFFERED_ENDPOINT);
        if (offeredEndpoint==null) {
          EndpointReference replyTo = applicationMsgContext.getReplyTo()//using replyTo as the Endpoint if it is not specified
       
          if (replyTo!=null) {
            offeredEndpoint = SandeshaUtil.cloneEPR(replyTo);
          }
        }
        // Finally fall back to using an anonymous endpoint
        if (offeredEndpoint==null) {
          offeredEndpoint = new EndpointReference(SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespace));
        }
        Endpoint endpoint = new Endpoint (offeredEndpoint, rmNamespaceValue, addressingNamespace);
        offerPart.setEndpoint(endpoint);
      }
    }
   
    String to = rmsBean.getToEPR();
    String replyTo = rmsBean.getReplyToEPR();

    if (to == null) {
      String message = SandeshaMessageHelper
          .getMessage(SandeshaMessageKeys.toBeanNotSet);
      throw new SandeshaException(message);
    }

    // TODO store and retrieve a full EPR instead of just the address.
    EndpointReference toEPR = new EndpointReference(to);
    createSeqRMMsg.setTo(toEPR);

    if(replyTo != null) {
      EndpointReference replyToEPR = new EndpointReference(replyTo);
      createSeqRMMsg.setReplyTo(replyToEPR);
    }

    AcksTo acksTo = new AcksTo(acksToEPR, rmNamespaceValue, addressingNamespace);
    createSequencePart.setAcksTo(acksTo);
   
    createSeqRMMsg.setMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ, createSequencePart);

    // Find the token that should be used to secure this new sequence. If there is a token, then we
    // save it in the properties so that the caller can store the token within the create sequence
    // bean.
    SecurityManager secMgr = SandeshaUtil.getSecurityManager(context);
    SecurityToken token = secMgr.getSecurityToken(applicationMsgContext);
    if(token != null) {
      OMElement str = secMgr.createSecurityTokenReference(token, createSeqmsgContext);
      createSequencePart.setSecurityTokenReference(str);
      createSeqRMMsg.setProperty(Sandesha2Constants.MessageContextProperties.SECURITY_TOKEN, token);
     
      // If we are using token based security, and the 1.1 spec level, then we
      // should introduce a UsesSequenceSTR header into the message.
      if(createSequencePart.getNamespaceValue().equals(Sandesha2Constants.SPEC_2007_02.NS_URI)) {
        UsesSequenceSTR header = new UsesSequenceSTR(null, Sandesha2Constants.SPEC_2007_02.NS_URI);
        header.toSOAPEnvelope(createSeqmsgContext.getEnvelope());
      }

      // Ensure that the correct token will be used to secure the outbound create sequence message.
      // We cannot use the normal helper method as we have not stored the token into the sequence bean yet.
      secMgr.applySecurityToken(token, createSeqRMMsg.getMessageContext());
    }

    createSeqRMMsg.setAction(SpecSpecificConstants.getCreateSequenceAction(rmsBean.getRMVersion()));
    createSeqRMMsg.setSOAPAction(SpecSpecificConstants.getCreateSequenceSOAPAction(rmsBean.getRMVersion()));

    createSeqRMMsg.addSOAPEnvelope();
   
    return createSeqRMMsg;
  }
View Full Code Here

    // to receive terminate sequence response messages correctly
    configCtx.registerOperationContext(terminateMessage.getMessageID(), operationContext);
   
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmsBean.getRMVersion());

    RMMsgContext terminateRMMessage = MsgInitializer.initializeMessage(terminateMessage);

    if (terminateMessage == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.msgContextNotSet));

    TerminateSequence terminateSequencePart = new TerminateSequence(rmNamespaceValue);
    Identifier identifier = new Identifier(rmNamespaceValue);
    identifier.setIndentifer(rmsBean.getSequenceID());
    terminateSequencePart.setIdentifier(identifier);
    terminateRMMessage.setMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ, terminateSequencePart);

    // no need for an incoming transport for a terminate
    // message. If this is put, sender will look for an response.
    terminateMessage.setProperty(MessageContext.TRANSPORT_IN, null);
View Full Code Here

   */
  private static RMMsgContext createResponseMsg(RMMsgContext requestMsg, RMSequenceBean rmSequenceBean, IOMRMPart part,
      int messagePartId, String action) throws AxisFault {

    MessageContext outMessage = MessageContextBuilder.createOutMessageContext (requestMsg.getMessageContext());
    RMMsgContext responseRMMsg = new RMMsgContext(outMessage);
    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(requestMsg.getSOAPEnvelope()));

    String namespace = requestMsg.getRMNamespaceValue();
    responseRMMsg.setRMNamespaceValue(namespace);

    SOAPEnvelope envelope = factory.getDefaultEnvelope();
    responseRMMsg.setSOAPEnvelop(envelope);
    responseRMMsg.setMessagePart(messagePartId, part);

    outMessage.setWSAAction(action);
    outMessage.setSoapAction(action);

    responseRMMsg.addSOAPEnvelope();
    responseRMMsg.getMessageContext().setServerSide(true);

    // Ensure the correct token is used to secure the message
    secureOutboundMessage(rmSequenceBean, outMessage);
   
    return responseRMMsg;
View Full Code Here

        Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG,
        rmVersion,
        referenceMessage.getAxisService());

    MessageContext makeConnectionMessageCtx = SandeshaUtil.createNewRelatedMessageContext(referenceRMMessage,makeConnectionOperation);
    RMMsgContext makeConnectionRMMessageCtx = MsgInitializer.initializeMessage(makeConnectionMessageCtx);
   
    MakeConnection makeConnection = new MakeConnection (Sandesha2Constants.SPEC_2007_02.MC_NS_URI);
    if (makeConnectionSeqId!=null) {
      Identifier identifier = new Identifier (rmNamespaceValue);
      identifier.setIndentifer(makeConnectionSeqId);
      makeConnection.setIdentifier(identifier);
    }
   
    if (makeConnectionAnonURI!=null) {
      Address address = new Address (Sandesha2Constants.SPEC_2007_02.MC_NS_URI);
      address.setAddress (makeConnectionAnonURI);
      makeConnection.setAddress(address);
    }
   
    // Setting the addressing properties. As this is a poll we must send it to an non-anon
    // EPR, so we check both To and ReplyTo from the reference message
    EndpointReference epr = referenceMessage.getTo();
    if(epr.hasAnonymousAddress()) epr = referenceMessage.getReplyTo();
   
    makeConnectionMessageCtx.setTo(epr);
    makeConnectionMessageCtx.setWSAAction(SpecSpecificConstants.getMakeConnectionAction(rmVersion));
    makeConnectionMessageCtx.setMessageID(SandeshaUtil.getUUID());
    makeConnectionRMMessageCtx.setMessagePart(Sandesha2Constants.MessageParts.MAKE_CONNECTION,
        makeConnection);
   
    //generating the SOAP Envelope.
    makeConnectionRMMessageCtx.addSOAPEnvelope();
   
    // Secure the message using the correct token for the sequence that we are polling
    secureOutboundMessage(bean, makeConnectionMessageCtx);   
   
    return makeConnectionRMMessageCtx;
View Full Code Here

    } else if (!acksTo.hasAnonymousAddress()) {
      SandeshaPolicyBean policyBean = SandeshaUtil.getPropertyBean (msgCtx.getAxisOperation());
      long ackInterval = policyBean.getAcknowledgementInterval();
      long timeToSend = System.currentTimeMillis() + ackInterval;
     
      RMMsgContext ackRMMsgContext = AcknowledgementManager.generateAckMessage(rmMsgCtx, bean, sequenceId, storageManager,true);

      AcknowledgementManager.addAckBeanEntry(ackRMMsgContext, sequenceId, timeToSend, storageManager);
    }
   
    // If this message matches the WSRM 1.0 pattern for an empty last message (e.g.
    // the sender wanted to signal the last message, but didn't have an application
    // message to send) then we direct it to the RMMessageReceiver.
    //This is not done when LastMsg is a response - it is sent throuth the normal response flow.
    if((Sandesha2Constants.SPEC_2005_02.Actions.ACTION_LAST_MESSAGE.equals(msgCtx.getWSAAction()) ||
       Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_LAST_MESSAGE.equals(msgCtx.getSoapAction())))
    {
      if (rmMsgCtx.getRelatesTo()==null) {
        if (log.isDebugEnabled())
          log.debug("Exit: SequenceProcessor::processReliableMessage, got WSRM 1.0 lastmessage");
        msgCtx.getAxisOperation().setMessageReceiver(new RMMessageReceiver ());
      }
    }
   
    // If the storage manager has an invoker, then they may be implementing inOrder, or
    // transactional delivery. Either way, if they have one we should use it.
    SandeshaThread invoker = storageManager.getInvoker();
    if (invoker != null) {
      // Whatever the MEP, we stop processing here and the invoker will do the real work. We only
      // SUSPEND if we need to keep the backchannel open for the response... we may as well ABORT
      // to let other cases end more quickly.
      if(backchannelFree && ackBackChannel) {
        result = InvocationResponse.ABORT;
      } else {
        result = InvocationResponse.SUSPEND;
      }
      InvokerBeanMgr storageMapMgr = storageManager.getInvokerBeanMgr();

      storageManager.storeMessageContext(key, rmMsgCtx.getMessageContext());
      InvokerBean invokerBean = new InvokerBean(key, msgNo, sequenceId);
     
      ContextManager contextMgr = SandeshaUtil.getContextManager(configCtx);
      if(contextMgr != null) invokerBean.setContext(contextMgr.storeContext());

      storageMapMgr.insert(invokerBean);

      // This will avoid performing application processing more than once.
      rmMsgCtx.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");

    }

    if (transaction != null && transaction.isActive())
      transaction.commit();
   
    if (sendAck) {
      try {
        transaction = storageManager.getTransaction();
       
        RMMsgContext ackRMMsgContext = AcknowledgementManager.generateAckMessage(rmMsgCtx, bean, sequenceId, storageManager,true);
        AcknowledgementManager.sendAckNow(ackRMMsgContext);
        TransportUtils.setResponseWritten(msgCtx, true);
        if (transaction != null && transaction.isActive()) transaction.commit();
        transaction = null;
     
View Full Code Here

          throws AxisFault {

    if (log.isDebugEnabled())
      log.debug("Enter: SequenceProcessor::sendAckIfNeeded " + sequenceId);

      RMMsgContext ackRMMsgCtx = AcknowledgementManager.generateAckMessage(
          rmMsgCtx, rmdBean, sequenceId, storageManager, serverSide);

      if (anonymousAcksTo) {
        AcknowledgementManager.sendAckNow(ackRMMsgCtx);
        TransportUtils.setResponseWritten(rmMsgCtx.getMessageContext(), true);
View Full Code Here

    MessageContext applicationMsg = applicationRMMsg.getMessageContext();
    ConfigurationContext configCtx = applicationMsg.getConfigurationContext();

    // generating a new create sequeuce message.
    RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(rmsBean, applicationRMMsg);

    createSeqRMMessage.setFlow(MessageContext.OUT_FLOW);
    CreateSequence createSequencePart = (CreateSequence) createSeqRMMessage
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);

    SenderBeanMgr retransmitterMgr = storageManager.getSenderBeanMgr();

    SequenceOffer offer = createSequencePart.getSequenceOffer();
    if (offer != null) {
      String offeredSequenceId = offer.getIdentifer().getIdentifier();

      rmsBean.setOfferedSequence(offeredSequenceId);
    }

    MessageContext createSeqMsg = createSeqRMMessage.getMessageContext();
    createSeqMsg.setRelationships(null); // create seq msg does not
                        // relateTo anything
   
    String createSequenceMessageStoreKey = SandeshaUtil.getUUID(); // the key that will be used to store
                                     //the create sequence message.
   
    rmsBean.setCreateSeqMsgID(createSeqMsg.getMessageID());
    rmsBean.setCreateSequenceMsgStoreKey(createSequenceMessageStoreKey);
   
    //cloning the message and storing it as a reference.
    MessageContext clonedMessage = SandeshaUtil.cloneMessageContext(createSeqMsg);
    String clonedMsgStoreKey = SandeshaUtil.getUUID();
    storageManager.storeMessageContext(clonedMsgStoreKey, clonedMessage);
    rmsBean.setReferenceMessageStoreKey(clonedMsgStoreKey);
   
    SecurityToken token = (SecurityToken) createSeqRMMessage.getProperty(Sandesha2Constants.MessageContextProperties.SECURITY_TOKEN);
    if(token != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configCtx);
      rmsBean.setSecurityTokenData(secManager.getTokenRecoveryData(token));
    }
   
    storageManager.getRMSBeanMgr().insert(rmsBean);

    SenderBean createSeqEntry = new SenderBean();
    createSeqEntry.setMessageContextRefKey(createSequenceMessageStoreKey);
    createSeqEntry.setTimeToSend(System.currentTimeMillis());
    createSeqEntry.setMessageID(createSeqRMMessage.getMessageId());
    createSeqEntry.setInternalSequenceID(rmsBean.getInternalSequenceID());
    // this will be set to true in the sender
    createSeqEntry.setSend(true);
    // Indicate that this message is a create sequence
    createSeqEntry.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
    EndpointReference to = createSeqRMMessage.getTo();
    if (to!=null)
      createSeqEntry.setToAddress(to.getAddress());
    // If this message is targetted at an anonymous address then we must not have a transport
    // ready for it, as the create sequence is not a reply.
    if(to == null || to.hasAnonymousAddress())
View Full Code Here

            if (log.isDebugEnabled())
              log.debug("Exit: CreateSeqMsgProcessor::processInMessage " + Boolean.FALSE);       
            return false;
          }
         
          RMMsgContext requestSideRefRMMessage = MsgInitializer.initializeMessage(requestSideRefMessage);
          TerminateManager.addTerminateSequenceMessage(requestSideRefRMMessage, rmsBean.getInternalSequenceID(), rmsBean.getSequenceID(), storageManager);
        }
      }
       

      MessageContext outMessage = null;
 
      // Create the new sequence id, as well as establishing the beans that handle the
      // sequence state.
      RMDBean rmdBean = SequenceManager.setupNewSequence(createSeqRMMsg, storageManager, secManager, token);
       
      RMMsgContext createSeqResponse = RMMsgCreator.createCreateSeqResponseMsg(createSeqRMMsg, rmdBean);
      outMessage = createSeqResponse.getMessageContext();
      // Set a message ID for this Create Sequence Response message
      outMessage.setMessageID(SandeshaUtil.getUUID());
       
      createSeqResponse.setFlow(MessageContext.OUT_FLOW);
 
      // for making sure that this won't be processed again
      createSeqResponse.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
     
      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) {
          if (log.isDebugEnabled())
            log.debug(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart));
          FaultManager.makeCreateSequenceRefusedFault(createSeqRMMsg,
                                                      SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart),
                                                      new Exception());
          // Return false if an Exception hasn't been thrown.
          if (log.isDebugEnabled())
            log.debug("Exit: CreateSeqMsgProcessor::processInMessage " + Boolean.FALSE);       
          return false;
        }
 
        // offered seq id
        String offeredSequenceID = offer.getIdentifer().getIdentifier();
       
        boolean offerEcepted = offerAccepted(offeredSequenceID, context, createSeqRMMsg, storageManager);
 
        if (offerEcepted) {
          // Setting the CreateSequence table entry for the outgoing
          // side.
          RMSBean rMSBean = new RMSBean();
          rMSBean.setSequenceID(offeredSequenceID);
          String outgoingSideInternalSequenceId = SandeshaUtil
              .getOutgoingSideInternalSequenceID(rmdBean.getSequenceID());
          rMSBean.setInternalSequenceID(outgoingSideInternalSequenceId);
          // this is a dummy value
          rMSBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
           
          rMSBean.setToEPR(rmdBean.getToEPR());
          rMSBean.setAcksToEPR(rmdBean.getToEPR())// The acks need to flow back into this endpoint
          rMSBean.setReplyToEPR(rmdBean.getReplyToEPR());
          rMSBean.setLastActivatedTime(System.currentTimeMillis());
          rMSBean.setRMVersion(rmdBean.getRMVersion());
          rMSBean.setClientCompletedMessages(new RangeString());
 
          // 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.
           
          Endpoint endpoint = offer.getEndpoint();
          if (endpoint!=null) {
            // setting the OfferedEndpoint
            rMSBean.setOfferedEndPoint(endpoint.getEPR().getAddress());
          }
   
          rmdBean.setOutboundInternalSequence(outgoingSideInternalSequenceId);
          RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();
          rmdBeanMgr.update(rmdBean);
 
          // Store the inbound token (if any) with the new sequence
          rMSBean.setSecurityTokenData(rmdBean.getSecurityTokenData());
         
          // If this new sequence has anonymous acksTo, then we must poll for the acks
          // If the inbound sequence is targetted at the WSRM anonymous URI, we need to start
          // polling for this sequence.
          String acksTo = rMSBean.getAcksToEPR();
          EndpointReference reference = new EndpointReference(acksTo);
          if ((acksTo == null || reference.hasAnonymousAddress()) &&
            Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqRMMsg.getRMSpecVersion())) {
            rMSBean.setPollingMode(true);
          }
         
          // Set the SOAP Version for this sequence.
          rMSBean.setSoapVersion(SandeshaUtil.getSOAPVersion(createSeqRMMsg.getSOAPEnvelope()));
         
          if (isReplayModel(createSeqRMMsg)) {
            rMSBean.setReplayModel(true);
            rmdBean.setReplayModel(true);
          }
         
          storageManager.getRMSBeanMgr().insert(rMSBean);
         
          SandeshaUtil.startWorkersForSequence(context, rMSBean);
         
        } else {
          // removing the accept part.
          createSeqResPart.setAccept(null);
          createSeqResponse.addSOAPEnvelope();
        }
      }
             
      //TODO add createSequenceResponse message as the referenceMessage to the RMDBean.
 
View Full Code Here

        if (referenceMessage==null) {
          String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.referencedMessageNotFound, rmsBean.getSequenceID());
          throw new SandeshaException (message);
        }
       
        RMMsgContext referenceRMMsg = MsgInitializer.initializeMessage(referenceMessage);
        addTerminateSequenceMessage(referenceRMMsg, rmsBean.getInternalSequenceID(), rmsBean.getSequenceID(), storageManager);
      }
     
    }
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.