Examples of SandeshaThread


Examples of org.apache.sandesha2.workers.SandeshaThread

     
      if(appMsgProcTran != null && createSeqRMMessage.getMessageId() != null && !storageManager.hasUserTransaction(createSeqMsg)) {

        // Lock the sender bean before we insert it, if we are planning to send it ourselves
        String workId = createSeqEntry.getMessageID() + createSeqEntry.getTimeToSend();
        SandeshaThread sender = storageManager.getSender();

        ConfigurationContext context = createSeqMsg.getConfigurationContext();
        WorkerLock lock = sender.getWorkerLock();
   
        SenderWorker worker = new SenderWorker(context, createSeqEntry, rmsBean.getRMVersion());
        worker.setLock(lock);
        worker.setWorkId(workId);
        // Actually take the lock
View Full Code Here

Examples of org.apache.sandesha2.workers.SandeshaThread

    // Lock the sender bean before we insert it, if we are planning to send it ourselves
    SenderWorker worker = null;
    if(sendingNow) {
      String workId = appMsgEntry.getMessageID() + appMsgEntry.getTimeToSend();
      SandeshaThread sender = storageManager.getSender();
      ConfigurationContext context = msg.getConfigurationContext();
      WorkerLock lock = sender.getWorkerLock();
     
      worker = new SenderWorker(context, appMsgEntry, rmsBean.getRMVersion());
      worker.setLock(lock);
      worker.setWorkId(workId);
      // Actually take the lock
View Full Code Here

Examples of org.apache.sandesha2.workers.SandeshaThread

      // Commit the current transaction, so that the SenderWorker can do it's own locking
      // this transaction should be commited out before gettting the worker lock.
      // otherwise a dead lock can happen.
      if (transaction != null && transaction.isActive()) transaction.commit();

      SandeshaThread sender = storageManager.getSender();
      WorkerLock lock = sender.getWorkerLock();

      String workId = matchingMessage.getMessageID();
      SenderWorker worker = new SenderWorker(pollMessage.getConfigurationContext(), matchingMessage, pollMessage.getRMSpecVersion());
      worker.setLock(lock);
      worker.setWorkId(workId);
View Full Code Here

Examples of org.apache.sandesha2.workers.SandeshaThread

      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 (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("Exit: SandeshaUtil::startWorkersForSequence");
  }
View Full Code Here

Examples of org.apache.sandesha2.workers.SandeshaThread

 
    if (sequenceExists && !storageManager.hasUserTransaction(msgContext)) {

      String workId = msgContext.getMessageID()
          + senderBean.getTimeToSend();
      SandeshaThread sender = storageManager.getSender();
      WorkerLock lock = sender.getWorkerLock();

      SenderWorker worker = new SenderWorker(configurationContext,
          senderBean, rmsBean.getRMVersion());
      worker.setLock(lock);
      worker.setWorkId(workId);
View Full Code Here

Examples of org.apache.sandesha2.workers.SandeshaThread

 
  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

Examples of org.apache.sandesha2.workers.SandeshaThread

    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();
     
      //ensure the storage managers are nullified
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.