Package org.jboss.messaging.core.contract

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


               }

               while (iter.hasNext())
               {
                  // We may need to persist the message itself
                  MessageReference ref = (MessageReference) iter.next();

                  // For non reliable refs we insert the ref (and maybe the
                  // message) itself

                  // Now store the reference
                   
                  log.trace("Paged ref with page order " + ref.getPagingOrder());

                  addReference(channelID, ref, psInsertReference, page);

                  int rows = psInsertReference.executeUpdate();

                  if (trace)
                  {
                     log.trace("Inserted " + rows + " rows");
                  }
                 
                  // Maybe we need to persist the message itself
                  Message m = ref.getMessage();

                  rows = storeMessage(m, psInsertMessage, psUpdateMessage);

                  if (trace)
                  {
View Full Code Here


               Iterator iter = references.iterator();

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

                  removeReference(channelID, ref, psDeleteReference);

                  int rows = psDeleteReference.executeUpdate();
View Full Code Here

               psUpdateReference = conn
                     .prepareStatement(getSQLStatement("UPDATE_PAGE_ORDER"));

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

                  psUpdateReference.setLong(1, ref.getPagingOrder());

                  psUpdateReference.setLong(2, ref.getMessage().getMessageID());

                  psUpdateReference.setLong(3, channelID);

                  int rows = psUpdateReference.executeUpdate();
View Full Code Here

               boolean first = true;

               for (Iterator i = refsToAdd.iterator(); i.hasNext();)
               {
                  ChannelRefPair pair = (ChannelRefPair) i.next();
                  MessageReference ref = pair.ref;

                  if (psReference == null)
                  {
                     psReference = conn
                           .prepareStatement(getSQLStatement("INSERT_MESSAGE_REF"));
                  }

                  // Now store the reference
                  addReference(pair.channelID, ref, psReference, false);

                  int rows = psReference.executeUpdate();

                  if (trace)
                  {
                     log.trace("Inserted " + rows + " rows");
                  }

                  Message m = ref.getMessage();

                  synchronized (m)
                  {
                     if (!m.isPersisted())
                     {
View Full Code Here

               while (iter.hasNext())
               {
                  Object obj = iter.next();

                  MessageReference ref;
                  if (obj instanceof MessageReference)
                  {
                     ref = (MessageReference) obj;
                  }
                  else
                  {
                     ref = ((ChannelRefPair) obj).ref;
                  }

                  psMessage.setLong(1, ref.getMessage().getMessageID());
                  psMessage.setLong(2, ref.getMessage().getMessageID());

                  int rows = psMessage.executeUpdate();

                  if (trace)
                  {
View Full Code Here

   {
      static MessageOrderComparator instance = new MessageOrderComparator();

      public int compare(Object o1, Object o2)
      {
         MessageReference ref1;
         MessageReference ref2;

         if (o1 instanceof MessageReference)
         {
            ref1 = (MessageReference) o1;
            ref2 = (MessageReference) o2;
         }
         else
         {
            ref1 = ((ChannelRefPair) o1).ref;
            ref2 = ((ChannelRefPair) o2).ref;
         }

         long id1 = ref1.getMessage().getMessageID();
         long id2 = ref2.getMessage().getMessageID();

         return (id1 < id2 ? -1 : (id1 == id2 ? 0 : 1));
      }
View Full Code Here

   {
      if (trace) { log.trace(this + " routing from cluster " + message + ", routing key " + routingKeyText + ", queue names " + queueNames); }

      Condition routingKey = conditionFactory.createCondition(routingKeyText);

      MessageReference ref = message.createReference();
        
      routeInternal(ref, routingKey, null, true, queueNames);       
   }
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

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

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

      checkLoad();

      return result;
   }
View Full Code Here

TOP

Related Classes of org.jboss.messaging.core.contract.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.