Examples of MessageReference


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

      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

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

         {
            // if paging and the in memory queue is exactly full we need to evict the end reference to storage to
            // preserve the number of refs in the queue
            if (messageRefs.size() == fullSize + 1)
            {
               MessageReference refCancel = (MessageReference)messageRefs.removeLast();
   
               addToDownCache(refCancel, true);
            }
         }
              
View Full Code Here

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

      }
   }
     
   protected MessageReference removeFirstInMemory() throws Exception
   {
      MessageReference result = super.removeFirstInMemory();

      checkLoad();

      return result;
   }
View Full Code Here

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

      Iterator iter = downCache.iterator();
     
      while (iter.hasNext())
      {
         MessageReference ref = (MessageReference) iter.next();
          
         if (ref.getMessage().isReliable() && recoverable)
         {
            toUpdate.add(ref);
         }
         else
         {
            toAdd.add(ref);
         }
      }
     
      if (!toAdd.isEmpty())
      {
         pm.pageReferences(channelID, toAdd, true);
      }
      if (!toUpdate.isEmpty())
      {
         pm.updatePageOrder(channelID, toUpdate);
      }

      // Release in memory refs for the refs we just spilled
      // Note! This must be done after the db inserts - to ensure message is
      // still in memory
      iter = downCache.iterator();

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

         ref.releaseMemoryReference();
      }

      downCache.clear();        

      if (trace) { log.trace(this + " cleared downcache"); }
View Full Code Here

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

  
   protected MessageReference addFromRefInfo(ReferenceInfo info, Map refMap)
   {
      long msgId = info.getMessageId();

      MessageReference ref = (MessageReference)refMap.get(new Long(msgId));

      ref.setDeliveryCount(info.getDeliveryCount());

      ref.setPagingOrder(-1);
     
      ref.setScheduledDeliveryTime(info.getScheduledDelivery());
     
      //Schedule the delivery if necessary, or just add to the in memory queue
      if (!checkAndSchedule(ref))
      {
         messageRefs.addLast(ref, ref.getMessage().getPriority());
      }
     
      return ref;
   }
View Full Code Here

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

      {
         ReferenceInfo info = (ReferenceInfo) iter.next();

         long msgId = info.getMessageId();

         MessageReference ref = ms.reference(msgId);

         if (ref != null)
         {
            refMap.put(new Long(msgId), ref);
         }
         else
         {
            // Add id to list of msg ids to load
            msgIdsToLoad.add(new Long(msgId));
         }
      }

      // Load the messages (if any)
      List messages = null;
      if (!msgIdsToLoad.isEmpty())
      {
         messages = pm.getMessages(msgIdsToLoad);

         if (messages.size() != msgIdsToLoad.size())
         {
            // Sanity check
           
            throw new IllegalStateException("Did not load correct number of messages, wanted:" +
                                            msgIdsToLoad.size() + " but got:" +
                                            messages.size());           
         }

         // Create references for these messages and add them to the reference map
         iter = messages.iterator();

         while (iter.hasNext())
         {
            Message m = (Message)iter.next();

            // Message might actually be know to the store since we did the
            // first check since might have been added by different channel
            // in intervening period, but this is ok - the store knows to only
            // return a reference to the pre-existing message
            MessageReference ref = ms.reference(m);
           
            refMap.put(new Long(m.getMessageID()), ref);
         }
      }
     
View Full Code Here

Examples of plugins.Freetalk.MessageList.MessageReference

    for(FetchFailedMarker marker : getExpiredFetchFailedMarkers(now)) {
      synchronized(Persistent.transactionLock(db)) {
        try {
          if(marker instanceof MessageFetchFailedMarker) {
            MessageFetchFailedMarker m = (MessageFetchFailedMarker)marker;
            MessageReference ref = m.getMessageReference();
            ref.clearMessageWasDownloadedFlag();
            ref.storeWithoutCommit();
          } else if(marker instanceof MessageListFetchFailedMarker) {
            MessageListFetchFailedMarker m = (MessageListFetchFailedMarker)marker;
            try {
              MessageList list = getMessageList(m.getMessageListID());
              list.deleteWithoutCommit();
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.