Package org.jboss.jms.delegate

Examples of org.jboss.jms.delegate.DeliveryInfo


   {
      List cancels = new ArrayList();
     
      for (Iterator i = deliveryInfos.iterator(); i.hasNext(); )
      {
         DeliveryInfo ack = (DeliveryInfo)i.next();     
        
         if (ack.isShouldAck())
         {        
           DefaultCancel cancel = new DefaultCancel(ack.getMessageProxy().getDeliveryId(),
                                                    ack.getMessageProxy().getDeliveryCount(),
                                                    false, false);
          
           cancels.add(cancel);
         }
      } 
View Full Code Here


   {
      List acks = new ArrayList();
     
      for (Iterator i = deliveryInfos.iterator(); i.hasNext(); )
      {
         DeliveryInfo ack = (DeliveryInfo)i.next();     
        
         if (ack.isShouldAck())
         {        
           acks.add(ack);
         }
      } 
     
View Full Code Here

        
         List acks = state.getAcks();
        
         if (!acks.isEmpty())
         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
            MessageProxy mp = info.getMessageProxy();
           
            SessionDelegate del = mp.getSessionDelegate();
           
            del.redeliver(acks);
         }
View Full Code Here

            iter2 = acks.iterator();

            while (iter2.hasNext())
            {
               DeliveryInfo ack = (DeliveryInfo) iter2.next();

               //We don't want to send acks for things like non durable subs which will have been already acked
               if (ack.isShouldAck())
               {
                  //We only need the delivery id written
                  out.writeLong(ack.getMessageProxy().getDeliveryId());
               }
            }

            //Marker for end of acks
            out.writeLong(Long.MIN_VALUE);
View Full Code Here

            serverID = newServerID;

            // Remove any non persistent acks
            for (Iterator i = acks.iterator(); i.hasNext();)
            {
               DeliveryInfo di = (DeliveryInfo) i.next();

               if (!di.getMessageProxy().getMessage().isReliable())
               {
                  if (trace)
                  {
                     log.trace(this + " discarded non-persistent " + di + " on failover");
                  }
View Full Code Here

         if (acknowledgeMode == Session.CLIENT_ACKNOWLEDGE)
         {
            for(Iterator i = getClientAckList().iterator(); i.hasNext(); )
            {
               DeliveryInfo info = (DeliveryInfo)i.next();
               if (!info.getMessageProxy().getMessage().isReliable())
               {
                  i.remove();
                  log.trace("removed non persistent delivery " + info);
               }
            }

            ackInfos = getClientAckList();
         }
         else
         {
            DeliveryInfo autoAck = getAutoAckInfo();
            if (autoAck != null)
            {
               if (!autoAck.getMessageProxy().getMessage().isReliable())
               {
                  // unreliable, discard
                  setAutoAckInfo(null);
               }
               else
               {
                  // reliable
                  ackInfos = new ArrayList();
                  ackInfos.add(autoAck);
               }
            }
         }

         log.trace(this + " retrieved " + ackInfos.size() + " deliveries");
      }
      else
      {
         // Transacted session - we need to get the acks from the resource manager. BTW we have
         // kept the old resource manager.

         ackInfos = rm.getDeliveriesForSession(getSessionID());
      }

      List recoveryInfos = new ArrayList();
      if (!ackInfos.isEmpty())
      {        
         for (Iterator i = ackInfos.iterator(); i.hasNext(); )
         {
            DeliveryInfo del = (DeliveryInfo)i.next();
            DeliveryRecovery recInfo =
               new DeliveryRecovery(del.getMessageProxy().getDeliveryId(),
                                    del.getMessageProxy().getMessage().getMessageID(),
                                    del.getQueueName());

            recoveryInfos.add(recInfo);       
         }        
      }
     
View Full Code Here

      {
         //Message has been cancelled
         return;
      }
     
      DeliveryInfo deliveryInfo =
         new DeliveryInfo(m, consumerID, queueName, connectionConsumerSession, shouldAck);
           
      m.incDeliveryCount();
     
      // If this is the callback-handler for a connection consumer we don't want to acknowledge or
      // add anything to the tx for this session.
View Full Code Here

      {
         //Message has been cancelled
         return;
      }
     
      DeliveryInfo deliveryInfo =
         new DeliveryInfo(m, consumerID, queueName, connectionConsumerSession, shouldAck);
           
      m.incDeliveryCount();
     
      // If this is the callback-handler for a connection consumer we don't want to acknowledge or
      // add anything to the tx for this session.
View Full Code Here

               boolean ignore =
                  checkExpiredOrReachedMaxdeliveries(m, sessionDelegate, maxDeliveries, shouldAck);
              
               if (!isConnectionConsumer && !ignore)
               {
                  final DeliveryInfo info = new DeliveryInfo(m, consumerID, queueName, null, shouldAck);
                 
                  if (timeout <= 0)
                  {
                     sessionDelegate.preDeliver(info);
View Full Code Here

     
      if (ackMode == Session.AUTO_ACKNOWLEDGE || isXAAndConsideredNonTransacted(state))
      {
         //Acknowledge or cancel any outstanding auto ack
       
         DeliveryInfo remainingAutoAck = state.getAutoAckInfo();
        
         if (remainingAutoAck != null)
         {
            if (trace) { log.trace(this + " handleClosing(). Found remaining auto ack. Will ack " + remainingAutoAck); }
           
View Full Code Here

TOP

Related Classes of org.jboss.jms.delegate.DeliveryInfo

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.