Examples of MessageReference


Examples of org.jboss.messaging.core.message.MessageReference

   public void cancel(Delivery del) throws Throwable
   {
      //We may need to update the delivery count in the database
     
      MessageReference ref = del.getReference();
     
      if (ref.getMessage().isReliable())
      {
         pm.updateDeliveryCount(this.channelID, ref);
      }
     
      deliveringCount.decrement();
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

         // dereference pass
         ArrayList messages = new ArrayList(references.size());
         for (Iterator i = references.iterator(); i.hasNext();)
         {
            MessageReference ref = (MessageReference) i.next();
            messages.add(ref.getMessage());
         }
         return messages;
      }     
   }
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

         //also we might get race conditions when other channels are updating the same message in the db

         //Note - we don't do this in a tx - because the tx could be too big if we have millions of refs
         //paged in storage

         MessageReference ref;
         while ((ref = removeFirstInMemory()) != null)
         {
            SimpleDelivery del = new SimpleDelivery(this, ref);

            del.acknowledge(null);
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

      {
         Iterator iter = messageRefs.getAll().iterator();

         while (iter.hasNext())
         {
            MessageReference r = (MessageReference) iter.next();

            // TODO: I need to dereference the message each time I apply the
            // filter. Refactor so the message reference will also contain JMS
            // properties
            if (filter == null || filter.accept(r.getMessage()))
            {
               undelivered.add(r);
            }
            else
            {
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

                  //http://jira.jboss.com/jira/browse/JBMESSAGING-839
                  log.warn(this + " cannot find reference " + id + " (Might be paged!)");
                  break;
               }
              
               MessageReference ref = (MessageReference)liter.next();
              
               if (ref.getMessage().getMessageID() == id.longValue())
               {
                  liter.remove();
                 
                  Delivery del = new SimpleDelivery(this, ref);
                 
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

      {
         // The iterator is used to iterate through the refs in the channel in the case that they
         // don't match the selectors of any receivers.
         ListIterator iter = null;
        
         MessageReference ref = null;
        
         if (!receiversReady)
         {
            return;
         }
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

      return callback;
   }
   protected MessageReference removeFirstInMemory() throws Exception
   {
      MessageReference result = (MessageReference) messageRefs.removeFirst();

      return (MessageReference) result;
   }
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

      }
   }
  
   private MessageReference nextReference(ListIterator iter) throws Throwable
   {
      MessageReference ref;
     
      if (iter == null)
      {
         //We just get the next ref from the head of the queue
         ref = (MessageReference) messageRefs.peekFirst();
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

         {
            // We add the references to the state
           
            for(Iterator i = refsToAdd.iterator(); i.hasNext(); )
            {
               MessageReference ref = (MessageReference)i.next();

               if (trace) { log.trace(this + ": adding " + ref + " to non-recoverable state"); }

               try
               {
View Full Code Here

Examples of org.jboss.messaging.core.message.MessageReference

      public void afterRollback(boolean onePhase) throws Exception
      {
         for(Iterator i = refsToAdd.iterator(); i.hasNext(); )
         {
            MessageReference ref = (MessageReference)i.next();

            if (trace) { log.trace(this + " releasing memory " + ref + " after rollback"); }
            ref.releaseMemoryReference();
         }
      }
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.