Examples of NextMsgBean


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

    if (timedOutBean!=null) {
      return SequenceReport.SEQUENCE_STATUS_TIMED_OUT;
    }
   
    NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
    NextMsgBean nextMsgBean = nextMsgMgr.retrieve(sequenceID);
   
    if (nextMsgBean!=null) {
      return SequenceReport.SEQUENCE_STATUS_ESTABLISHED;
    }
   
View Full Code Here

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

   
    if (toBean!=null)
      seqPropMgr.insert(toBean);

    NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
    nextMsgMgr.insert(new NextMsgBean(sequenceId, 1)); // 1 will be the next
   
    // message to invoke. This will apply for only in-order invocations.

    SandeshaUtil.startSenderForTheSequence(configurationContext,sequenceId);
   
View Full Code Here

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

      acksToBean.setSequenceID(offeredSequenceId);
      acksToBean.setValue(acksToEPR.getAddress());

      sequencePropMgr.insert(acksToBean);

      NextMsgBean nextMsgBean = new NextMsgBean();
      nextMsgBean.setSequenceID(offeredSequenceId);
      nextMsgBean.setNextMsgNoToProcess(1);

      NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
      nextMsgMgr.insert(nextMsgBean);
     
      String rmSpecVersion = createSeqResponseRMMsgCtx.getRMSpecVersion();
View Full Code Here

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

  public static void terminateReceivingSide (ConfigurationContext configContext, String sequenceID) throws SandeshaException {
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext);
    NextMsgBeanMgr nextMsgBeanMgr = storageManager.getNextMsgBeanMgr();
   
    //removing nextMsgMgr entries
    NextMsgBean findNextMsgBean = new NextMsgBean ();
    findNextMsgBean.setSequenceId(sequenceID);
    Collection collection = nextMsgBeanMgr.find(findNextMsgBean);
    Iterator iterator = collection.iterator();
    while (iterator.hasNext()) {
      NextMsgBean nextMsgBean = (NextMsgBean) iterator.next();
      nextMsgBeanMgr.delete(nextMsgBean.getSequenceId());
    }
   
    boolean inOrderInvocation = PropertyManager.getInstance().isInOrderInvocation();
    if(inOrderInvocation) {
      terminateAfterInvocation(configContext,sequenceID);
View Full Code Here

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

    sendAckIfNeeded(rmMsgCtx, messagesStr);

    //  Pause the messages bean if not the right message to invoke.
    NextMsgBeanMgr mgr = storageManager.getNextMsgBeanMgr();
    NextMsgBean bean = mgr.retrieve(sequenceId);

    if (bean == null)
      throw new SandeshaException("Error- The sequence does not exist");

    InvokerBeanMgr storageMapMgr = storageManager.getStorageMapBeanMgr();

    long nextMsgno = bean.getNextMsgNoToProcess();

    if (msgCtx.isServerSide()) {
      boolean inOrderInvocation = PropertyManager.getInstance().isInOrderInvocation();
      if (inOrderInvocation) {
        //pause the message
View Full Code Here

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

      acksToBean.setSequenceId(offeredSequenceId);
      acksToBean.setValue(acksToEPR);

      sequencePropMgr.insert(acksToBean);

      NextMsgBean nextMsgBean = new NextMsgBean();
      nextMsgBean.setSequenceId(offeredSequenceId);
      nextMsgBean.setNextMsgNoToProcess(1);

      NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
      nextMsgMgr.insert(nextMsgBean);
    }
View Full Code Here

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

        Iterator it = collection.iterator();
        while (it.hasNext()) {

          //checking weather a incoming sequence with the given id
          // exists.
          NextMsgBean nextMsgBean = (NextMsgBean) it.next();
          String sequenceId = nextMsgBean.getSequenceId();
          if (sequenceId.equals(offeredSequenceId)) {
            refuseSequence = true;
            reason = "A sequence with offered sequenceId, already axists";
          }
View Full Code Here

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

    Iterator it = coll.iterator();

    boolean validSequence = false;

    while (it.hasNext()) {
      NextMsgBean nextMsgBean = (NextMsgBean) it.next();
      String tempId = nextMsgBean.getSequenceId();
      if (tempId.equals(sequenceId)) {
        validSequence = true;
        break;
      }
    }
View Full Code Here

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

    seqPropMgr.insert(toBean);
    seqPropMgr.insert(replyToBean);
    seqPropMgr.insert(acksToBean);

    NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
    nextMsgMgr.insert(new NextMsgBean(sequenceId, 1)); // 1 will be the next
    // message to invoke
    //this will apply for only in-order invocations.

    return sequenceId;
  }
View Full Code Here

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

        currentIteration: while (seqPropIt.hasNext()) {

          String sequenceId = (String) seqPropIt.next();

          NextMsgBean nextMsgBean = nextMsgMgr.retrieve(sequenceId);
          if (nextMsgBean == null)
            throw new SandeshaException(
                "Next message not set correctly");

          long nextMsgno = nextMsgBean.getNextMsgNoToProcess();
          if (nextMsgno <= 0)
            throw new SandeshaException(
                "Invalid messaage number for the nextMsgNo");

          Iterator stMapIt = storageMapMgr.find(
              new InvokerBean(null, nextMsgno, sequenceId))
              .iterator();

          while (stMapIt.hasNext()) {

            InvokerBean stMapBean = (InvokerBean) stMapIt
                .next();
            String key = stMapBean.getKey();

            MessageContext msgToInvoke = SandeshaUtil
                .getStoredMessageContext(key);

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

            try {
              //Invoking the message.
              new AxisEngine(msgToInvoke.getConfigurationContext())
                  .receive(msgToInvoke);

              ServiceContext serviceContext = msgToInvoke
                  .getServiceContext();
              Object debug = null;
              if (serviceContext != null) {
                debug = msgToInvoke
                    .getProperty(Sandesha2ClientAPI.SANDESHA_DEBUG_MODE);
                if (debug != null && "on".equals(debug)) {
                  System.out
                      .println("DEBUG: Invoker invoking a '"
                          + SandeshaUtil
                              .getMessageTypeString(rmMsg
                                  .getMessageType())
                          + "' message.");
                }
              }

              //deleting the message entry.
              storageMapMgr.delete(key);

            } catch (AxisFault e) {
              throw new SandeshaException(e.getMessage());
            }

            //undating the next mst to invoke
            nextMsgno++;
            stMapIt = storageMapMgr
                .find(
                    new InvokerBean(null, nextMsgno,
                        sequenceId)).iterator();

            //terminate (AfterInvocation)
            if (rmMsg.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {
              Sequence sequence = (Sequence) rmMsg
                  .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
              if (sequence.getLastMessage() != null) {
                TerminateManager.terminateAfterInvocation(
                    context, sequenceId);
               
                //exit from current iteration. (since an entry was removed)
                break currentIteration;
              }
            }
          }

          nextMsgBean.setNextMsgNoToProcess(nextMsgno);
          nextMsgMgr.update(nextMsgBean);

        }
      } catch (SandeshaException e1) {
        // TODO Auto-generated catch block
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.