Package org.jboss.messaging.core.message

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


      else
      {
         tx = txRep.createTransaction();
      }
     
      MessageReference ref1 = ms.reference(m1);
      MessageReference ref2 = ms.reference(m2)
      MessageReference ref3 = ms.reference(m3);      
      MessageReference ref4 = ms.reference(m4);
      MessageReference ref5 = ms.reference(m5)

      //Add first two refs non transactionally
      pm.addReference(channel.getChannelID(), ref1, null);
      pm.addReference(channel.getChannelID(), ref2, null);
     
View Full Code Here


   {
      Message m = CoreMessageFactory.
      createCoreMessage(0, false, 777l, 888l, (byte)9, headers, "payload");

      // recoverable store, non-reliable message, one message
      MessageReference ref = ms.reference(m);
      assertCorrectReference(ref, m);
      ref.releaseMemoryReference();

      ref = ms.reference(m.getMessageID());
      assertNull(ref);
   }
View Full Code Here

      Message m = CoreMessageFactory.
      createCoreMessage(0, false, 777l, 888l, (byte)9, headers, "payload");

      // recoverable store, non-reliable message, one message
      MessageReference ref = ms.reference(m);
      assertCorrectReference(ref, m);

      MessageReference ref2 = ms.reference(m);

      assertCorrectReference(ref2, m);
   }
View Full Code Here

   {
      Message m = CoreMessageFactory.
      createCoreMessage(0, true, 777l, 888l, (byte)9, headers, "payload");

      // recoverable store, non-reliable message, one message
      MessageReference ref = ms.reference(m);
      assertCorrectReference(ref, m);

      ref.releaseMemoryReference();

      // there's no strong reference to the unique message reference anymore, so the message store
      // should be cleaned of everything that pertains to that message

      ref = ms.reference(m.getMessageID());
View Full Code Here

   {
      Message m = CoreMessageFactory.
      createCoreMessage(0, true, 777l, 888l, (byte)9, headers, "payload");

      // recoverable store, non-reliable message, one message
      MessageReference ref = ms.reference(m);
      assertCorrectReference(ref, m);

      MessageReference ref2 = ms.reference(m);

      assertCorrectReference(ref2, m);
   }
View Full Code Here

      Message m = CoreMessageFactory.
      createCoreMessage(0, true, 777l, 888l, (byte)9, headers, "payload");

      // non-recoverable store, non-reliable message, one message
      MessageReference ref = ms.reference(m);
      assertCorrectReference(ref, m);
     
      //Create another reference from that reference
      MessageReference ref2 = ms.reference(m);
         
      ref.releaseMemoryReference();
     
      MessageReference ref3 = ms.reference(m.getMessageID());
      assertNotNull(ref3);
      ref3.releaseMemoryReference();
     
      assertCorrectReference(ref3, m);
     
      ref2.releaseMemoryReference();
View Full Code Here

   {
      Message m = CoreMessageFactory.
      createCoreMessage(0, true, 777l, 888l, (byte)9, headers, "payload");

      // non-recoverable store, non-reliable message, one message
      MessageReference ref = ms.reference(m);
      assertCorrectReference(ref, m);
     
      MessageReference ref2 = ms.reference(ref.getMessage().getMessageID());
      assertNotNull(ref2);     
      assertCorrectReference(ref2, m);
     
      MessageReference ref3 = ms.reference(ref.getMessage().getMessageID());
      assertNotNull(ref3);     
      assertCorrectReference(ref3, m);
     
      ref.releaseMemoryReference();
      ref2.releaseMemoryReference();
      ref3.releaseMemoryReference();
     
      MessageReference ref4 = ms.reference(ref.getMessage().getMessageID());
           
      assertNull(ref4);               
   }
View Full Code Here

     
      for (int i = 0; i < num; i++)
      {        
         Message msg = CoreMessageFactory.createCoreMessage(msgCount++, persistent, null);     
        
         MessageReference ref = ms.reference(msg);        
        
         Condition condition = conditionFactory.createCondition(conditionText);
        
         boolean routed = office.route(ref, condition, null);        
        
View Full Code Here

         assertFalse(queue6.isActive());
         assertTrue(queue3.isActive());
         assertTrue(queue4.isActive());     
        
         Message msg1 = CoreMessageFactory.createCoreMessage(1);     
         MessageReference ref1 = ms.reference(msg1);
        
         boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
        
         List msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver2.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver3.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
         Message msgRec = (Message)msgs.get(0);
         assertTrue(msg1 == msgRec);
         receiver3.acknowledge(msgRec, null);
         msgs = queue3.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty())
        
         msgs = receiver4.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver5.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver6.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         receiver3.clear();
                    
         Message msg2 = CoreMessageFactory.createCoreMessage(2);     
         MessageReference ref2 = ms.reference(msg2);
        
         routed = postOffice.route(ref2, new SimpleCondition("topic2"), null);     
         assertTrue(routed);
        
         msgs = receiver1.getMessages();
View Full Code Here

         queue1.add(receiver1);
  
         assertTrue(queue1.isActive());
  
         Message msg1 = CoreMessageFactory.createCoreMessage(1);     
         MessageReference ref1 = ms.reference(msg1);
        
         boolean routed =
            postOffice.route(ref1, new SimpleCondition("this won't match anything"), null);
        
         assertFalse(routed);
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.