Package org.hornetq.jms.client

Examples of org.hornetq.jms.client.HornetQDestination


            checkJNDI(jndi);

            if (internalCreateQueue(queueName, selectorString, durable))
            {

               HornetQDestination destination = queues.get(queueName);
               if (destination == null)
               {
                  // sanity check. internalCreateQueue should already have done this check
                  throw new IllegalArgumentException("Queue does not exist");
               }
View Full Code Here


         {
            checkJNDI(jndi);

            if (internalCreateTopic(topicName))
            {
               HornetQDestination destination = topics.get(topicName);

               if (destination == null)
               {
                  // sanity check. internalCreateQueue should already have done this check
                  throw new IllegalArgumentException("Queue does not exist");
View Full Code Here

      if (!added)
      {
         return false;
      }

      HornetQDestination destination = queues.get(queueName);
      if (destination == null)
      {
         // sanity check. internalCreateQueue should already have done this check
         throw new IllegalArgumentException("Queue does not exist");
      }
View Full Code Here

      {
         return false;
      }
      else
      {
         HornetQDestination destination = topics.get(topicName);

         if (destination == null)
         {
            // sanity check. internalCreateQueue should already have done this check
            throw new IllegalArgumentException("Queue does not exist");
View Full Code Here

         server.start();
         ServerLocator locator = createInVMNonHALocator();
         ClientSessionFactory factory = locator.createSessionFactory();
         ClientSession session = factory.createSession(false, false, false);
         HornetQDestination queue = (HornetQDestination)HornetQJMSClient.createQueue("test");
         session.createQueue(queue.getSimpleAddress(), queue.getSimpleAddress(), true);
         session.close();

         HornetQResourceAdapter ra = new HornetQResourceAdapter();

         ra.setConnectorClassName("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory");
View Full Code Here

   public void testEquals() throws Exception
   {
      String destinationName = RandomUtil.randomString();
      String address = HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX + destinationName;
      HornetQDestination destination = (HornetQDestination) HornetQDestination.fromAddress(address);
      HornetQDestination sameDestination = (HornetQDestination) HornetQDestination.fromAddress(address);
      HornetQDestination differentDestination = (HornetQDestination) HornetQDestination.fromAddress(address + RandomUtil.randomString());

      Assert.assertFalse(destination.equals(null));
      Assert.assertTrue(destination.equals(destination));
      Assert.assertTrue(destination.equals(sameDestination));
      Assert.assertFalse(destination.equals(differentDestination));
View Full Code Here

   public void testFromAddressWithQueueAddressPrefix() throws Exception
   {
      String destinationName = RandomUtil.randomString();
      String address = HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX + destinationName;
      HornetQDestination destination = (HornetQDestination) HornetQDestination.fromAddress(address);
      Assert.assertTrue(destination instanceof Queue);
      Assert.assertEquals(destinationName, ((Queue)destination).getQueueName());
   }
View Full Code Here

   public void testFromAddressWithTopicAddressPrefix() throws Exception
   {
      String destinationName = RandomUtil.randomString();
      String address = HornetQDestination.JMS_TOPIC_ADDRESS_PREFIX + destinationName;
      HornetQDestination destination = (HornetQDestination) HornetQDestination.fromAddress(address);
      Assert.assertTrue(destination instanceof Topic);
      Assert.assertEquals(destinationName, ((Topic)destination).getTopicName());
   }
View Full Code Here

   }

   public boolean moveMessage(final String messageID, final String otherQueueName, final boolean rejectDuplicates) throws Exception
   {
      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
      HornetQDestination otherQueue = HornetQDestination.createQueue(otherQueueName);
      int moved = coreQueueControl.moveMessages(filter, otherQueue.getAddress(), rejectDuplicates);
      if (moved != 1)
      {
         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
      }
View Full Code Here

   }

   public int moveMessages(final String filterStr, final String otherQueueName, final boolean rejectDuplicates) throws Exception
   {
      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
      HornetQDestination otherQueue = HornetQDestination.createQueue(otherQueueName);
      return coreQueueControl.moveMessages(filter, otherQueue.getAddress(), rejectDuplicates);
   }
View Full Code Here

TOP

Related Classes of org.hornetq.jms.client.HornetQDestination

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.