Package org.apache.sandesha2.workers

Examples of org.apache.sandesha2.workers.SandeshaThread


     
      //setting a dummy property been to stop Sandesha2 from throwing exceptions.
      SandeshaPolicyBean policyBean = new SandeshaPolicyBean ();
      axisConfiguration.addParameter(new Parameter (Sandesha2Constants.SANDESHA_PROPERTY_BEAN,policyBean));
     
      InMemoryStorageManager storageManager = new InMemoryStorageManager (configurationContext);
     
      Transaction transaction = storageManager.getTransaction();
     
      RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
     
      RMSBean rmsBean = new RMSBean ();
      RMSBean duplicateRMSBean = new RMSBean ();
     
      rmsBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
View Full Code Here


    rmdBean.setSequenceID(seqID);
    rmdBean.setToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setAcksToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setReplyToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmdBean.setServerCompletedMessages(new RangeString());
    // Flag that the sequence is closed.
    rmdBean.setClosed(true);
   
    // Create a transaction and insert the RMSBean
    Transaction tran = storageManager.getTransaction();
View Full Code Here

    rmsBean.setInternalSequenceID(SandeshaUtil.getInternalSequenceID(seqID, null));
    rmsBean.setToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setAcksToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setReplyToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmsBean.setClientCompletedMessages(new RangeString());
    rmsBean.setNextMessageNumber(1);
   
    // Create a transaction and insert the RMSBean
    Transaction tran = storageManager.getTransaction();
   
View Full Code Here

    rmsBean.setInternalSequenceID(SandeshaUtil.getInternalSequenceID(seqID, null));
    rmsBean.setToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setAcksToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setReplyToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmsBean.setClientCompletedMessages(new RangeString());
    rmsBean.setNextMessageNumber(4);
    rmsBean.setHighestOutMessageNumber(3);
   
    SenderBean bean1 = getSenderBean(seqID, 1, 1);
    SenderBean bean2 = getSenderBean(seqID, 0, 2);
View Full Code Here

      }
    }
   
    // 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) {
View Full Code Here

      log.debug("Enter: SandeshaUtil::startWorkersForSequence, sequence " + sequence);
   
    StorageManager mgr = getSandeshaStorageManager(context, context.getAxisConfiguration());
    boolean polling = sequence.isPollingMode();
   
    SandeshaThread sender = mgr.getSender();
    SandeshaThread invoker = mgr.getInvoker();
    SandeshaThread pollMgr = mgr.getPollingManager();
   
    // Only start the polling manager if we are configured to use MakeConnection
    if(polling && pollMgr == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.makeConnectionDisabled);
      throw new SandeshaException(message);
    }

    if(sequence instanceof RMSBean) {
      // We pass in the internal sequence id for internal sequences.
      String sequenceId = ((RMSBean)sequence).getInternalSequenceID();
      sender.runThreadForSequence(context, sequenceId, true);
      if(polling) pollMgr.runThreadForSequence(context, sequenceId, true);
    } else {
      String sequenceId = sequence.getSequenceID();
      sender.runThreadForSequence(context, sequenceId, false);
      if(invoker != null) invoker.runThreadForSequence(context, sequenceId, false);
      if(polling) pollMgr.runThreadForSequence(context, sequenceId, false);
    }
   
    if (log.isDebugEnabled()) log.debug("Exit: SandeshaUtil::startWorkersForSequence");
  }
View Full Code Here

 
  public void commit() {
    releaseLocks();
    if(sentMessages) manager.getSender().wakeThread();
    if(receivedMessages) {
      SandeshaThread invoker = manager.getInvoker();
      if(invoker != null) invoker.wakeThread();
    }
    active = false;
  }
View Full Code Here

    if(log.isDebugEnabled()) log.debug("Entry: SandeshaModule::shutdown, " + configurationContext);
    StorageManager storageManager = SandeshaUtil.
      getSandeshaStorageManager(configurationContext, configurationContext.getAxisConfiguration());

    if (storageManager!=null) {
      SandeshaThread sender = storageManager.getSender();
      SandeshaThread invoker = storageManager.getInvoker();
      SandeshaThread pollingManager = storageManager.getPollingManager();
     
      //stopping threads.
      if (sender!=null)
        sender.stopRunning();
      if (invoker!=null)
        invoker.stopRunning();
      if (pollingManager!=null)
        pollingManager.stopRunning();
     
      //shutting down the storage manager.
      storageManager.shutdown();
    }
   
View Full Code Here

    if(log.isDebugEnabled()) log.debug("Entry: SandeshaModule::shutdown, " + configurationContext);
    StorageManager storageManager = SandeshaUtil.
      getSandeshaStorageManager(configurationContext, configurationContext.getAxisConfiguration());

    if (storageManager!=null) {
      SandeshaThread sender = storageManager.getSender();
      SandeshaThread invoker = storageManager.getInvoker();
      SandeshaThread pollingManager = storageManager.getPollingManager();
     
      //stopping threads.
      if (sender!=null)
        sender.stopRunning();
      if (invoker!=null)
        invoker.stopRunning();
      if (pollingManager!=null)
        pollingManager.stopRunning();
     
      //shutting down the storage manager.
      storageManager.shutdown();
    }
   
View Full Code Here

 
  public void shutdown(){
    //shutdown the running threads
    getSender().stopRunning();
   
    SandeshaThread thread = getInvoker();
    if(thread != null) thread.stopRunning();
   
    thread = getPollingManager();
    if(thread != null) thread.stopRunning();
   
    //removing the reference to the configuration context
    context=null;
  }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.workers.SandeshaThread

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.