Package org.jboss.messaging.core

Examples of org.jboss.messaging.core.Delivery


   {
      if (trace) {log.trace(this + " cancelDelivery " + cancel); }
     
      try
      {
         Delivery del = cancelDeliveryInternal(cancel);
        
         //Prompt delivery
         promptDelivery((Channel)del.getObserver());
      }
      catch (Throwable t)
      {
         throw ExceptionUtil.handleJMSInvocation(t, this + " cancelDelivery");
      }    
View Full Code Here


         {
            Cancel cancel = (Cancel)cancels.get(i);      
           
            if (trace) { log.trace(this + " cancelling delivery " + cancel.getDeliveryId()); }
                       
            Delivery del = cancelDeliveryInternal(cancel);
           
            channels.add(del.getObserver());
         }
                             
         // need to prompt delivery for all affected channels
        
         promptDelivery(channels);
View Full Code Here

           
            Iterator iter3 = acks.iterator();
           
            while (iter2.hasNext())
            {
               Delivery del = (Delivery)iter2.next();
              
               DeliveryRecovery info = (DeliveryRecovery)iter3.next();
              
               long deliveryId = info.getDeliveryID();
              
View Full Code Here

      //might get changed after the client has sent the cancel - and we don't want to end up cancelling
      //back to the original queue
      boolean reachedMaxDeliveryAttempts =
         cancel.isReachedMaxDeliveryAttempts() || cancel.getDeliveryCount() >= maxDeliveryAttempts;
                   
      Delivery del = rec.del;  
        
      if (!expired && !reachedMaxDeliveryAttempts)
      {
         //Normal cancel back to the queue
        
         del.getReference().setDeliveryCount(cancel.getDeliveryCount());
        
         //Do we need to set a redelivery delay?
        
         if (rec.redeliveryDelay != 0)
         {
            del.getReference().setScheduledDeliveryTime(System.currentTimeMillis() + rec.redeliveryDelay);
         }
        
         del.cancel();
      }
      else
      {                 
         if (expired)
         {
View Full Code Here

                  {
                     //It's a local binding so we pass the message on to the subscription

                     LocalClusteredQueue queue = (LocalClusteredQueue)binding.getQueue();

                     Delivery del = queue.handleFromCluster(ref);

                     if (trace)
                     {
                        log.trace(this.currentNodeId + " queue " + queue.getName() + " handled reference from cluster " + del);
                     }
View Full Code Here

            {
               ClusterRouter router = (ClusterRouter)i.next();

               if (trace) { log.trace(this + " sending " + ref + " to " + router); }

               Delivery del = router.handle(null, ref, tx);

               if (del != null && del.isSelectorAccepted())
               {
                  routed = true;

                  Queue queue = (Queue)del.getObserver();

                  if (queue.isClustered())
                  {
                     ClusteredQueue cq = (ClusteredQueue)queue;
                    
View Full Code Here

      if (localQueue != null)
      {
         // The only time the local queue won't accept is if the selector doesn't match, in which
         // case it won't match at any other nodes too so no point in trying them

         Delivery del = localQueue.handle(observer, ref, tx);

         if (trace) { log.trace(this + " routed to local queue, it returned " + del); }

         return del;
      }
      else
      {
         // There is no local shared queue. We round robin among the rest.

         if (!nonLocalQueues.isEmpty())
         {
            ClusteredQueue queue = (ClusteredQueue)nonLocalQueues.get(target);

            Delivery del = queue.handle(observer, ref, tx);

            if (trace) { log.trace(this + " routed to remote queue, it returned " + del); }

            incTarget();
View Full Code Here

   {
      if (trace) { log.trace(this + " handling " + ref + " from cluster"); }

      if (filter != null && !filter.accept(ref.getMessage()))
      {
         Delivery del = new SimpleDelivery(this, ref, true, false);
        
         if (trace) { log.trace(this + " " + ref + " rejected by filter"); }
        
         return del;
      }
View Full Code Here

     
      public void run()
      {
         try
         {
            Delivery del = null;
           
            //We only get the delivery if receiversReady = false so as not to steal messages that
            //might be consumed by local receivers           
            if (!receiversReady)
            {                 
               MessageReference ref;
              
               synchronized (refLock)
               {
                  ref = removeFirstInMemory();
                 
                  if (ref != null)
                  {
                     del = new SimpleDelivery(LocalClusteredQueue.this, ref);
                    
                     deliveringCount.increment();
                  }                                       
               }                   
            }
           
            if (trace) { log.trace("PullMessagesRunnable got " + del); }
           
            if (del != null)
            {           
               PullMessageResultRequest response =
                  new PullMessageResultRequest(LocalClusteredQueue.this.nodeId, txId.getTxId(),
                                               name,
                                               del.getReference().getMessage());
                       
               if (!del.getReference().getMessage().isReliable() || !recoverable)
               {
                  //We can ack it now
                  del.acknowledge(null);
               }
               else
               {
                  //Add this to the holding area
                  tx.setReliableDelivery(del);
View Full Code Here

              
            try
            {
               ref = ms.reference(message);
              
               Delivery delRet = handleInternal(null, ref, tx, true);

               if (delRet == null || !delRet.isSelectorAccepted())
               {
                  //This should never happen
                  throw new IllegalStateException("Queue did not accept reference!");
               }           
            }
            finally
            {
               if (ref != null)
               {
                  ref.releaseMemoryReference();
               }
            }
                      
            //Acknowledge on the remote queue stub
            Delivery del = new SimpleDelivery(remoteQueue, ref);
           
            del.acknowledge(tx);       
                       
            //For testing to simulate failures
            if (failBeforeCommit)
            {
               throw new Exception("Test failure before commit");
View Full Code Here

TOP

Related Classes of org.jboss.messaging.core.Delivery

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.