Package org.jboss.messaging.core.message

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


         //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

      {
         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

                  //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

      {
         // 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

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

      return (MessageReference) result;
   }
View Full Code Here

      }
   }
  
   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

         {
            // 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

      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

      Iterator iter = refInfos.iterator();
      while (iter.hasNext())
      {
         ReferenceInfo info = (ReferenceInfo)iter.next();
        
         MessageReference ref = addFromRefInfo(info, refMap);
        
         if (recoverable && ref.getMessage().isReliable())
         {
            loadedReliable = true;
         }
         else
         {
View Full Code Here

TOP

Related Classes of org.jboss.messaging.core.message.MessageReference

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.