Examples of RMDBeanMgr


Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

   
    ConfigurationContext configurationContext = rmMsgCtx.getConfigurationContext();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(
              configurationContext, configurationContext.getAxisConfiguration());
   
    RMDBeanMgr rmdMgr = storageManager.getRMDBeanMgr();
    RMDBean rmdBean = rmdMgr.retrieve(sequenceId);
    String outBoundInternalSequence = rmdBean.getOutboundInternalSequence();
   
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
    RMSBean findBean = new RMSBean ();
    findBean.setInternalSequenceID(outBoundInternalSequence);
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

   
    try {
      transaction = storageManager.getTransaction();
   
      // Check that both the Sequence header and message body have been secured properly
      RMDBeanMgr mgr = storageManager.getRMDBeanMgr();
      RMDBean bean = mgr.retrieve(sequenceId);
     
      if(bean != null && bean.getSecurityTokenData() != null) {
        SecurityManager secManager = SandeshaUtil.getSecurityManager(rmMsgCtx.getConfigurationContext());
       
        QName seqName = new QName(rmMsgCtx.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.SEQUENCE);
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

          .getProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID);
      service = null;
      if (sequenceID != null) {

        //If this is the RMD of the sequence
        RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();
        RMDBean rmdFindBean = new RMDBean();
        rmdFindBean.setSequenceID(sequenceID);

        RMDBean rmdBean = rmdBeanMgr.findUnique(rmdFindBean);
        if (rmdBean != null) {

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

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

      String sequenceId, RMMsgContext terminateRMMsg) throws SandeshaException {

    if (log.isDebugEnabled())
      log.debug("Enter: TerminateSeqMsgProcessor::setUpHighestMsgNumbers, " + sequenceId);

    RMDBeanMgr mgr = storageManager.getRMDBeanMgr();
    RMDBean bean = mgr.retrieve(sequenceId);

    long highestInMsgNo = bean.getHighestInMessageNumber();

    // following will be valid only for the server side, since the obtained
    // int. seq ID is only valid there.
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

    blockForPause();
    try{
      //get all invoker beans for the sequence
      InvokerBeanMgr storageMapMgr = storageManager
          .getInvokerBeanMgr();
      RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();
      RMDBean rMDBean = rmdBeanMgr.retrieve(sequenceID);
     
      if (rMDBean != null) {
       
        //The outOfOrder window is the set of known sequence messages (including those
        //that are missing) at the time the button is pressed.
        long firstMessageInOutOfOrderWindow = rMDBean.getNextMsgNoToProcess();
     
        InvokerBean selector = new InvokerBean();
        selector.setSequenceID(sequenceID);
        Iterator stMapIt = storageMapMgr.find(selector).iterator();
       
        long highestMsgNumberInvoked = 0;
        Transaction transaction = null;
       
        //invoke each bean in turn.
        //NOTE: here we are breaking ordering
        while(stMapIt.hasNext()){
          //invoke the app
          try{
            transaction = storageManager.getTransaction();
            InvokerBean invoker = (InvokerBean)stMapIt.next();
           
            // start a new worker thread and let it do the invocation.
            String workId = sequenceID + "::" + invoker.getMsgNo(); //creating a workId to uniquely identify the
             //piece of work that will be assigned to the Worker.
           
            String messageContextKey = invoker.getMessageContextRefKey();
            InvokerWorker worker = new InvokerWorker(context,
                messageContextKey,
                true); //want to ignore the enxt msg number
           
            worker.setLock(getWorkerLock());
            worker.setWorkId(workId);
           
            //before we execute we need to set the
           
            threadPool.execute(worker);
         
            //adding the workId to the lock after assigning it to a thread makes sure
            //that all the workIds in the Lock are handled by threads.
            getWorkerLock().addWork(workId);

            long msgNumber = invoker.getMsgNo();
            //if necessary, update the "next message number" bean under this transaction
            if(msgNumber>highestMsgNumberInvoked){
              highestMsgNumberInvoked = invoker.getMsgNo();
              rMDBean.setNextMsgNoToProcess(highestMsgNumberInvoked+1);
             
              if(allowLaterDeliveryOfMissingMessages){
                //we also need to update the sequence OUT_OF_ORDER_RANGES property
                //so as to include our latest view of this outOfOrder range.
                //We do that here (rather than once at the end) so that we reamin
                //transactionally consistent
                Range r = new Range(firstMessageInOutOfOrderWindow,highestMsgNumberInvoked);
                   
                RangeString rangeString = null;
                if(rMDBean.getOutOfOrderRanges()==null){
                  //insert a new blank one one
                  rangeString = new RangeString();
                }
                else{
                  rangeString = rMDBean.getOutOfOrderRanges();
                }
                //update the range String with the new value
                rangeString.addRange(r);
                rMDBean.setOutOfOrderRanges(rangeString);
              }
             
              rmdBeanMgr.update(rMDBean);
            }
           
            if(transaction != null && transaction.isActive()) transaction.commit();
            transaction = null;
          }
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

   
    boolean sleep = false;
    Transaction transaction = null;

    try {
      RMDBeanMgr nextMsgMgr = storageManager.getRMDBeanMgr();

      InvokerBeanMgr storageMapMgr = storageManager
          .getInvokerBeanMgr();

      transaction = storageManager.getTransaction();
     
      // Pick a sequence using a round-robin approach
      ArrayList allSequencesList = getSequences();
      int size = allSequencesList.size();
      log.debug("Choosing one from " + size + " sequences");
      if(nextIndex >= size) {
        nextIndex = 0;

        // We just looped over the set of sequences. If we didn't process any
        // messages on this loop then we sleep before the next one
        if(size == 0 || !processedMessage) {
          sleep = true;
        }
        processedMessage = false;
       
        if (log.isDebugEnabled()) log.debug("Exit: Invoker::internalRun, looped over all sequences, sleep " + sleep);
        return sleep;
      }

      SequenceEntry entry = (SequenceEntry) allSequencesList.get(nextIndex++);
      String sequenceId = entry.getSequenceId();
      log.debug("Chose sequence " + sequenceId);

      RMDBean nextMsgBean = nextMsgMgr.retrieve(sequenceId);
      if (nextMsgBean == null) {
        log.debug("Next message not set correctly. Removing invalid entry.");

        stopThreadForSequence(sequenceId, entry.isRmSource());
        allSequencesList = getSequences();
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

     
      if (toEPR!=null)
        rMDBean.setToAddress(toEPR.getAddress());
     
      rMDBean.setServerCompletedMessages(new RangeString());
      RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();

      // Store the security token for the offered sequence
      rMDBean.setSecurityTokenData(rmsBean.getSecurityTokenData());
     
      rMDBean.setLastActivatedTime(System.currentTimeMillis());
     
      rmdBeanMgr.insert(rMDBean);
      SandeshaUtil.startWorkersForSequence(configCtx, rMDBean);
    }
   
    rmsBean.setLastActivatedTime(System.currentTimeMillis());
    rmsBeanMgr.update(rmsBean);
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

    rmsBean.setLastActivatedTime(System.currentTimeMillis());

    //adding a MakeConnection for the response sequence if needed.
    if (rmsBean.getOfferedSequence() != null) {

      RMDBeanMgr rMDBeanMgr = storageManager.getRMDBeanMgr();
      RMDBean rMDBean = rMDBeanMgr.retrieve(outSequenceId);
     
      if (rMDBean!=null && rMDBean.isPollingMode()) {
        PollingManager manager = storageManager.getPollingManager();
        if(manager != null) manager.schedulePollingRequest(rMDBean.getSequenceID(), false);
      }
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

    //adding a MakeConnection for the response sequence if needed.
    String offeredSequenceId = SandeshaUtil.getSequenceProperty(sequencePropertyKey,
        Sandesha2Constants.SequenceProperties.OFFERED_SEQUENCE, storageManager);
    if (offeredSequenceId!=null) {

      RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();
      RMDBean rmdBean = rmdBeanMgr.retrieve(outSequenceId);
     
      if (rmdBean!=null && rmdBean.isPollingMode())
        SandeshaUtil.shedulePollingRequest(offeredSequenceId, configCtx);
     
    }
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr

     
      //if PollingMode is true, starting the pollingmanager.
      if (pollingMode)
        SandeshaUtil.startPollingManager(configCtx);
     
      RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();
      rmdBeanMgr.insert(rmdBean);

      String rmSpecVersion = createSeqResponseRMMsgCtx.getRMSpecVersion();

      SequencePropertyBean specVersionBean = new SequencePropertyBean(offeredSequenceId,
          Sandesha2Constants.SequenceProperties.RM_SPEC_VERSION, rmSpecVersion);
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.