Package org.hornetq.jms.server.config

Examples of org.hornetq.jms.server.config.TopicConfiguration


      assertEquals("/fullConfigurationQueue", queueConfig.getBindings()[0]);
      assertEquals("/queue/fullConfigurationQueue", queueConfig.getBindings()[1]);
     

      assertEquals(1, jmsconfig.getTopicConfigurations().size());
      TopicConfiguration topicConfig = jmsconfig.getTopicConfigurations().get(0);
      assertEquals("fullConfigurationTopic", topicConfig.getName());
      assertEquals(2, topicConfig.getBindings().length);
      assertEquals("/fullConfigurationTopic", topicConfig.getBindings()[0]);
      assertEquals("/topic/fullConfigurationTopic", topicConfig.getBindings()[1]);
     
     
   }
View Full Code Here


    * @param node
    * @throws Exception
    */
   private void deployTopic(final Node node) throws Exception
   {
      TopicConfiguration topicConfig = parser.parseTopicConfiguration(node);
      jmsServerManager.createTopic(false, topicConfig.getName(), topicConfig.getBindings());
   }
View Full Code Here

    * @param node
    * @throws Exception
    */
   private void deployTopic(final Node node) throws Exception
   {
      TopicConfiguration topicConfig = parser.parseTopicConfiguration(node);
      jmsServerManager.createTopic(false, topicConfig.getName(), topicConfig.getBindings());
   }
View Full Code Here

    * @param node
    * @throws Exception
    */
   private void deployTopic(final Node node) throws Exception
   {
      TopicConfiguration topicConfig = parser.parseTopicConfiguration(node);
      jmsServerManager.createTopic(false, topicConfig.getName(), topicConfig.getBindings());
   }
View Full Code Here

      assertEquals("/fullConfigurationQueue", queueConfig.getBindings()[0]);
      assertEquals("/queue/fullConfigurationQueue", queueConfig.getBindings()[1]);


      assertEquals(1, jmsconfig.getTopicConfigurations().size());
      TopicConfiguration topicConfig = jmsconfig.getTopicConfigurations().get(0);
      assertEquals("fullConfigurationTopic", topicConfig.getName());
      assertEquals(2, topicConfig.getBindings().length);
      assertEquals("/fullConfigurationTopic", topicConfig.getBindings()[0]);
      assertEquals("/topic/fullConfigurationTopic", topicConfig.getBindings()[1]);


   }
View Full Code Here

      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");

      try
      {
         JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
         TopicConfiguration topic = parser.parseTopicConfiguration(document.getDocumentElement());
         HornetQTopic hqTopic = HornetQDestination.createTopic(topic.getName());
         String topicName = hqTopic.getAddress();
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {

            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(topicName));
            if (!query.isExists())
            {
               session.createQueue(topicName, topicName, "__HQX=-1", true);

            }
            else
            {
               throw new WebApplicationException(Response.status(412).type("text/plain").entity("Queue already exists.").build());
            }
         }
         finally
         {
            try { session.close(); } catch (Exception ignored) {}
         }
         if (topic.getBindings() != null && topic.getBindings().length > 0 && manager.getRegistry() != null)
         {
            for (String binding : topic.getBindings())
            {
               manager.getRegistry().bind(binding, hqTopic);
            }
         }
         URI uri = uriInfo.getRequestUriBuilder().path(topicName).build();
View Full Code Here

      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");

      try
      {
         JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
         TopicConfiguration topic = parser.parseTopicConfiguration(document.getDocumentElement());
         HornetQTopic hqTopic = HornetQDestination.createTopic(topic.getName());
         String topicName = hqTopic.getAddress();
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {

            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(topicName));
            if (!query.isExists())
            {
               session.createQueue(topicName, topicName, "__HQX=-1", true);

            }
            else
            {
               throw new WebApplicationException(Response.status(412).type("text/plain").entity("Queue already exists.").build());
            }
         }
         finally
         {
            try
            {
               session.close();
            }
            catch (Exception ignored)
            {
            }
         }
         if (topic.getBindings() != null && topic.getBindings().length > 0 && manager.getRegistry() != null)
         {
            for (String binding : topic.getBindings())
            {
               manager.getRegistry().bind(binding, hqTopic);
            }
         }
         URI uri = uriInfo.getRequestUriBuilder().path(topicName).build();
View Full Code Here

    * @param node
    * @throws Exception
    */
   private void deployTopic(final Node node) throws Exception
   {
      TopicConfiguration topicConfig = parser.parseTopicConfiguration(node);
      jmsServerManager.createTopic(false, topicConfig.getName(), topicConfig.getBindings());
   }
View Full Code Here

      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + uriInfo.getPath() + "\"");

      try
      {
         JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
         TopicConfiguration topic = parser.parseTopicConfiguration(document.getDocumentElement());
         HornetQTopic hqTopic = HornetQDestination.createTopic(topic.getName());
         String topicName = hqTopic.getAddress();
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {

            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(topicName));
            if (!query.isExists())
            {
               session.createQueue(topicName, topicName, "__HQX=-1", true);

            }
            else
            {
               throw new WebApplicationException(Response.status(412).type("text/plain").entity("Queue already exists.").build());
            }
         }
         finally
         {
            try
            {
               session.close();
            }
            catch (Exception ignored)
            {
            }
         }
         if (topic.getBindings() != null && topic.getBindings().length > 0 && manager.getRegistry() != null)
         {
            for (String binding : topic.getBindings())
            {
               manager.getRegistry().bind(binding, hqTopic);
            }
         }
         URI uri = uriInfo.getRequestUriBuilder().path(topicName).build();
View Full Code Here

    * @param node
    * @throws Exception
    */
   private void deployTopic(final Node node) throws Exception
   {
      TopicConfiguration topicConfig = parser.parseTopicConfiguration(node);
      jmsServerManager.createTopic(false, topicConfig.getName(), topicConfig.getBindings());
   }
View Full Code Here

TOP

Related Classes of org.hornetq.jms.server.config.TopicConfiguration

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.