Examples of RMSBean


Examples of org.apache.sandesha2.storage.beans.RMSBean

  }

  public static String getSequenceIDFromInternalSequenceID(String internalSequenceID,
      StorageManager storageManager) throws SandeshaException {

    RMSBean rMSBean = getRMSBeanFromInternalSequenceId(storageManager, internalSequenceID);

    String sequeunceID = null;
    if (rMSBean != null &&
        rMSBean.getSequenceID() != null &&
        !rMSBean.getSequenceID().equals(Sandesha2Constants.TEMP_SEQUENCE_ID))
      sequeunceID = rMSBean.getSequenceID();

    return sequeunceID;
  }
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

  }

  public static boolean isAllMsgsAckedUpto(long highestInMsgNo, String internalSequenceId,
      StorageManager storageManager) throws SandeshaException {

    RMSBean rmsBean = SandeshaUtil.getRMSBeanFromInternalSequenceId(storageManager, internalSequenceId);
   
    RangeString ackedMsgRanges = rmsBean.getClientCompletedMessages();
    long smallestMsgNo = 1;
    Range interestedRange = new Range(smallestMsgNo, highestInMsgNo);
    boolean allComplete = false;
    if(ackedMsgRanges!=null && ackedMsgRanges.isRangeCompleted(interestedRange)){
      allComplete = true;
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

    RMDBeanMgr rmdMgr = storageManager.getRMDBeanMgr();
    RMDBean rmdBean = rmdMgr.retrieve(sequenceId);
    String outBoundInternalSequence = rmdBean.getOutboundInternalSequence();
   
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
    RMSBean findBean = new RMSBean ();
    findBean.setInternalSequenceID(outBoundInternalSequence);
    RMSBean rmsBean = rmsBeanMgr.findUnique (findBean);
   
    if (rmsBean!=null && rmsBean.getLastOutMessage()<=0) {
      //there is a RMS sequence without a LastMsg entry
     
      MessageContext msgContext = rmMsgCtx.getMessageContext();
     
      AxisOperation operation = SpecSpecificConstants.getWSRMOperation(Sandesha2Constants.MessageTypes.LAST_MESSAGE,
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

 
  private void pollRMSSide(SequenceEntry entry, boolean force) throws AxisFault {
    if(log.isDebugEnabled()) log.debug("Enter: PollingManager::pollRMSSide, force: " + force);
   
    RMSBeanMgr rmsBeanManager = storageManager.getRMSBeanMgr();
    RMSBean findRMS = new RMSBean();
    findRMS.setInternalSequenceID(entry.getSequenceId());
    findRMS.setPollingMode(true);
    findRMS.setTerminated(false);
    RMSBean beanToPoll = rmsBeanManager.findUnique(findRMS);
   
    if(beanToPoll == null) {
      // This sequence must have been terminated, or deleted
      stopThreadForSequence(entry.getSequenceId(), true);
    } else {
      if (log.isDebugEnabled())
        log.debug("Polling rms " + beanToPoll);
      // The sequence is there, but we still only poll if we are expecting reply messages,
      // or if we don't have clean ack state.
      boolean cleanAcks = false;
      if (beanToPoll.getNextMessageNumber() > -1)
        cleanAcks = AcknowledgementManager.verifySequenceCompletion(beanToPoll.getClientCompletedMessages(), beanToPoll.getNextMessageNumber());
      long  repliesExpected = beanToPoll.getExpectedReplies();
      if((force ||  !cleanAcks || repliesExpected > 0) && beanToPoll.getReferenceMessageStoreKey() != null)
        pollForSequence(beanToPoll.getAnonymousUUID(), beanToPoll.getInternalSequenceID(), beanToPoll.getReferenceMessageStoreKey(), beanToPoll, entry);
    }

    if(log.isDebugEnabled()) log.debug("Exit: PollingManager::pollRMSSide");
  }
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

      // The sequence is still there, but if we have a running related sequence
      // that is not expecting replies then there is no need to poll.
      boolean doPoll = true;
      String outboundSequence = nextMsgBean.getOutboundInternalSequence();
      if(outboundSequence != null) {
        RMSBean findRMS = new RMSBean();
        findRMS.setInternalSequenceID(outboundSequence);
        findRMS.setTerminated(false);
        RMSBeanMgr mgr = storageManager.getRMSBeanMgr();
        RMSBean outbound = mgr.findUnique(findRMS);
        if(outbound != null && outbound.getExpectedReplies() == 0) {
          doPoll = false;
        }
      }
      if(force || doPoll)
        pollForSequence(null, null, nextMsgBean.getReferenceMessageKey(), nextMsgBean, entry);
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

        }

        if (service == null && rmdBean == null) {
          //If this is the RMD of the sequence
          RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
          RMSBean rmsfindBean = new RMSBean();
          rmsfindBean.setSequenceID(sequenceID);

          RMSBean rmsBean = rmsBeanMgr.findUnique(rmsfindBean);

          if (rmsBean != null) {
            String serviceName = rmsBean.getServiceName();
            if (serviceName != null) {
              service = configurationContext
                  .getAxisConfiguration().getService(
                      serviceName);
            }
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

      String rmVersion = null;
      // Check that the sequence is still valid
      boolean found = false;
      if(entry.isRmSource()) {
        RMSBean matcher = new RMSBean();
        matcher.setInternalSequenceID(sequenceId);
        matcher.setTerminated(false);
        RMSBean rms = storageManager.getRMSBeanMgr().findUnique(matcher);
        if(rms != null && !rms.isTerminated() && !rms.isTimedOut()) {
          sequenceId = rms.getSequenceID();         
          if (SequenceManager.hasSequenceTimedOut(rms, sequenceId, storageManager))         
            SequenceManager.finalizeTimedOutSequence(rms.getInternalSequenceID(), null, storageManager);
          else
            found = true;
          rmVersion = rms.getRMVersion();
        }
       
      } else {
        RMDBean matcher = new RMDBean();
        matcher.setSequenceID(sequenceId);
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

   */
  private void deleteTerminatedSequences(StorageManager storageManager) {
    if (log.isDebugEnabled())
      log.debug("Enter: Sender::deleteTerminatedSequences");

    RMSBean finderBean = new RMSBean();
    finderBean.setTerminated(true);
   
    Transaction transaction = null;
   
    try {
      transaction = storageManager.getTransaction();
     
      SandeshaPolicyBean propertyBean =
        SandeshaUtil.getPropertyBean(storageManager.getContext().getAxisConfiguration());     

      long deleteTime = propertyBean.getSequenceRemovalTimeoutInterval();
      if (deleteTime < 0)
        deleteTime = 0;

      if (deleteTime > 0) {
        // Find terminated sequences.
        List rmsBeans = storageManager.getRMSBeanMgr().find(finderBean);
       
        deleteRMSBeans(rmsBeans, propertyBean, deleteTime);
       
        finderBean.setTerminated(false);
        finderBean.setTimedOut(true);
       
        // Find timed out sequences
        rmsBeans = storageManager.getRMSBeanMgr().find(finderBean);
             
        deleteRMSBeans(rmsBeans, propertyBean, deleteTime);
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

    Iterator beans = rmsBeans.iterator();
   
    while (beans.hasNext())
    {
      RMSBean rmsBean = (RMSBean)beans.next();
      long timeNow = System.currentTimeMillis();
      long lastActivated = rmsBean.getLastActivatedTime();
      // delete sequences that have been timedout or deleted for more than
      // the SequenceRemovalTimeoutInterval
    
      if ((lastActivated + deleteTime) < timeNow) {
        if (log.isDebugEnabled())
          log.debug("Removing RMSBean " + rmsBean);
        storageManager.getRMSBeanMgr().delete(rmsBean.getCreateSeqMsgID());
      }       
    }

    if (log.isDebugEnabled())
      log.debug("Exit: Sender::deleteRMSBeans");
View Full Code Here

Examples of org.apache.sandesha2.storage.beans.RMSBean

        // Update the RMDBean
        storageManager.getRMDBeanMgr().update(bean);
       
        // If an outbound message has already gone out with that relatesTo, then we can terminate
        // right away.
        RMSBean rmsBean = SandeshaUtil.getRMSBeanFromInternalSequenceId(storageManager, responseSideInternalSequenceId);

        if(rmsBean != null) {
          String highestOutRelatesTo = rmsBean.getHighestOutRelatesTo();
          if (highestOutRelatesTo != null && highestOutRelatesTo.equals(inMsgId)) {
            highestOutMsgNo = rmsBean.getHighestOutMessageNumber();
            addResponseSideTerminate = true;
           
            // It is possible that the message has gone out, but not been acked yet. In that case
            // we can store the HIGHEST_OUT_MSG_NUMBER as the LAST_OUT_MESSAGE_NO, so that when the
            // ack arrives we will terminate the sequence
            rmsBean.setLastOutMessage(highestOutMsgNo);
            storageManager.getRMSBeanMgr().update(rmsBean);
          }
        }
      }

      // If all the out message have been acked, add the outgoing
      // terminate seq msg.
      String outgoingSequnceID = SandeshaUtil.getSequenceIDFromInternalSequenceID(responseSideInternalSequenceId, storageManager);

      if (addResponseSideTerminate && highestOutMsgNo > 0 && responseSideInternalSequenceId != null
          && outgoingSequnceID != null) {
        boolean allAcked = SandeshaUtil.isAllMsgsAckedUpto(highestOutMsgNo, responseSideInternalSequenceId, storageManager);

        if (allAcked)
        {
          RMSBean rmsBean = SandeshaUtil.getRMSBeanFromSequenceId(storageManager, outgoingSequnceID);
          if (!rmsBean.isTerminateAdded()) {
            TerminateManager.addTerminateSequenceMessage(terminateRMMsg, rmsBean.getInternalSequenceID(), outgoingSequnceID , storageManager);
            String referenceMsgKey = rmsBean.getReferenceMessageStoreKey();
            if (referenceMsgKey==null) {
              String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.referenceMessageNotSetForSequence,rmsBean.getSequenceID());
              throw new SandeshaException (message);
            }
           
            MessageContext referenceMessage = storageManager.retrieveMessageContext(referenceMsgKey, configCtx);
           
            if (referenceMessage==null) {
              String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.referencedMessageNotFound, rmsBean.getSequenceID());
              throw new SandeshaException (message);
            }
           
            //RMMsgContext referenceRMMsg = MsgInitializer.initializeMessage(referenceMessage);
                 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.