Package org.jboss.messaging.core.impl

Examples of org.jboss.messaging.core.impl.SimpleDelivery


         Queue queue = binding.queue;

         if (trace) log.trace("Destination for message[ID=" + ref.getMessage().getMessageID() + "] is: " + queue);

         //Create a new delivery - note that it must have a delivery observer otherwise acknowledge will fail
         Delivery del = new SimpleDelivery(queue, ref, true, true);

         if (trace) log.trace("Acknowledging..");

         try
         {
           // The actual jmx queue may not have been deployed yet, so we need to the core queue if so,
            // or the acknowledge will have no effect

            boolean deactivate = false;

            if (!queue.isActive())
            {
              queue.activate();

              deactivate = true;
            }

            del.acknowledge(tx);

            if (deactivate)
            {
              queue.deactivate();
            }
View Full Code Here


                    
                     ReferenceInfo mInfo = refInfoMap.get(m.getMessageID());
                     mref.setDeliveryCount(mInfo.getDeliveryCount());
                     mref.setScheduledDeliveryTime(mInfo.getScheduledDelivery());
                    
                     Delivery del = new SimpleDelivery(ch, mref, true, true);
                     del.cancel();
                  }
               }
            }
         }
View Full Code Here

            return null;
         }
        
         assertEquals(refs[consumeCount + count].getMessage().getMessageID(), ref.getMessage().getMessageID());
        
         SimpleDelivery del = new SimpleDelivery(observer, ref);
        
         dels[count] = del;
        
         count++;
        
View Full Code Here

         if (count == numToCancel)
         {
            return null;
         }
        
         SimpleDelivery del = new SimpleDelivery(observer, ref);
        
         toCancel[count] = del;                 
        
         count++;        
        
View Full Code Here

         return null;
      }

      if (ref.getMessage().isExpired())
      {
         SimpleDelivery delivery = new SimpleDelivery(observer, ref, true, false);

         try
         {
            sessionEndpoint.expireDelivery(delivery, expiryQueue);
         }
         catch (Throwable t)
         {
            log.error("Failed to expire delivery: " + delivery, t);
         }

         return delivery;
      }
     
      if (preserveOrdering && remote)
      {
        //If the header exists it means the message has already been sucked once - so reject.
       
        if (ref.getMessage().getHeader(Message.CLUSTER_SUCKED) != null)
        {
          if (trace) { log.trace("Message has already been sucked once - not sucking again"); }
         
          return null;
        }           
      }

      synchronized (startStopLock)
      {
         // If the consumer is stopped then we don't accept the message, it should go back into the
         // queue for delivery later.
         if (!started)
         {
            if (trace) { log.trace(this + " NOT started!"); }

            return null;
         }
        
         if (trace) { log.trace(this + " has startStopLock lock, preparing the message for delivery"); }

         Message message = ref.getMessage();
        
         boolean selectorRejected = !this.accept(message);
        
         SimpleDelivery delivery = new SimpleDelivery(observer, ref, !selectorRejected, false);

         if (selectorRejected)
         {
            return delivery;
         }
        
         if (noLocal)
         {
            String conId = ((JBossMessage) message).getConnectionID();

            if (trace) { log.trace("message connection id: " + conId + " current connection connection id: " + sessionEndpoint.getConnectionEndpoint().getConnectionID()); }

            if (sessionEndpoint.getConnectionEndpoint().getConnectionID().equals(conId))
            {
              if (trace) { log.trace("Message from local connection so rejecting"); }
             
              try
               {
                 delivery.acknowledge(null);
               }
               catch (Throwable t)
               {
                 log.error("Failed to acknowledge delivery", t);
                
View Full Code Here

         Queue queue = binding.queue;

         if (trace) log.trace("Destination for message[ID=" + ref.getMessage().getMessageID() + "] is: " + queue);

         //Create a new delivery - note that it must have a delivery observer otherwise acknowledge will fail
         Delivery del = new SimpleDelivery(queue, ref, true, true);

         if (trace) log.trace("Acknowledging..");

         try
         {
           // The actual jmx queue may not have been deployed yet, so we need to the core queue if so,
            // or the acknowledge will have no effect

            boolean deactivate = false;

            if (!queue.isActive())
            {
              queue.activate();

              deactivate = true;
            }

            del.acknowledge(tx);

            if (deactivate)
            {
              queue.deactivate();
            }
View Full Code Here

            return null;
         }

         assertEquals(refs[consumeCount + count].getMessage().getMessageID(), ref.getMessage().getMessageID());

         SimpleDelivery del = new SimpleDelivery(observer, ref);

         dels[count] = del;

         count++;
View Full Code Here

         if (count == numToCancel)
         {
            return null;
         }

         SimpleDelivery del = new SimpleDelivery(observer, ref);

         toCancel[count] = del;

         count++;
View Full Code Here

         return null;
      }

      if (ref.getMessage().isExpired())
      {
         SimpleDelivery delivery = new SimpleDelivery(observer, ref, true, false);

         try
         {
            sessionEndpoint.expireDelivery(delivery, expiryQueue);
         }
         catch (Throwable t)
         {
            log.error("Failed to expire delivery: " + delivery, t);
         }

         return delivery;
      }
     
      if (preserveOrdering && remote)
      {
        //If the header exists it means the message has already been sucked once - so reject.
       
        if (ref.getMessage().getHeader(Message.CLUSTER_SUCKED) != null)
        {
          if (trace) { log.trace("Message has already been sucked once - not sucking again"); }
         
          return null;
        }           
      }

      synchronized (startStopLock)
      {
         // If the consumer is stopped then we don't accept the message, it should go back into the
         // queue for delivery later.
         if (!started)
         {
            if (trace) { log.trace(this + " NOT started!"); }

            return null;
         }
        
         if (trace) { log.trace(this + " has startStopLock lock, preparing the message for delivery"); }

         Message message = ref.getMessage();
        
         boolean selectorRejected = !this.accept(message);
        
         SimpleDelivery delivery = new SimpleDelivery(observer, ref, !selectorRejected, false);

         if (selectorRejected)
         {
            return delivery;
         }
        
         if (noLocal)
         {
            String conId = ((JBossMessage) message).getConnectionID();

            if (trace) { log.trace("message connection id: " + conId + " current connection connection id: " + sessionEndpoint.getConnectionEndpoint().getConnectionID()); }

            if (sessionEndpoint.getConnectionEndpoint().getConnectionID().equals(conId))
            {
              if (trace) { log.trace("Message from local connection so rejecting"); }
             
              try
               {
                 delivery.acknowledge(null);
               }
               catch (Throwable t)
               {
                 log.error("Failed to acknowledge delivery", t);
                
View Full Code Here

         Queue queue = binding.queue;

         if (trace) log.trace("Destination for message[ID=" + ref.getMessage().getMessageID() + "] is: " + queue);

         //Create a new delivery - note that it must have a delivery observer otherwise acknowledge will fail
         Delivery del = new SimpleDelivery(queue, ref, true, true);

         if (trace) log.trace("Acknowledging..");

         try
         {
           // The actual jmx queue may not have been deployed yet, so we need to the core queue if so,
            // or the acknowledge will have no effect

            boolean deactivate = false;

            if (!queue.isActive())
            {
              queue.activate();

              deactivate = true;
            }

            del.acknowledge(tx);

            if (deactivate)
            {
              queue.deactivate();
            }
View Full Code Here

TOP

Related Classes of org.jboss.messaging.core.impl.SimpleDelivery

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.