Package org.hornetq.jms.server.config

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


   @MetaMapping(value = AddressSettingsMapper.class)
   public Object[] getQueueConfiguration(String name) throws Exception
   {
      Object[] config = new Object[3];
      JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
      JMSQueueConfiguration queueConfiguration = new JMSQueueConfigurationImpl(control.getName(), control.getSelector(), !control.isTemporary(), control.getJNDIBindings());
      config[0] = queueConfiguration;
      String addressSettingsAsJSON = hornetQServerControl.getAddressSettingsAsJSON(name);
      config[1] = AddressSettingsInfo.from(addressSettingsAsJSON);
      String rolesAsJSON = hornetQServerControl.getRolesAsJSON(name);
      RoleInfo[] roles = RoleInfo.from(rolesAsJSON);
View Full Code Here


   public MetaValue createMetaValue(MetaType metaType, Object[] val)
   {
      CompositeValueSupport cvs = new CompositeValueSupport(ADDRESS_SETTINGS_TYPE);
      if (val[0] instanceof JMSQueueConfiguration)
      {
         JMSQueueConfiguration queueConfiguration = (JMSQueueConfiguration) val[0];
         cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, queueConfiguration.getName()));
         cvs.set("jndiBindings", new SimpleValueSupport(SimpleMetaType.STRING, getJndiString(queueConfiguration.getBindings())));
      }
      else
      {
         TopicConfiguration topicConfiguration = (TopicConfiguration) val[0];
         cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, topicConfiguration.getName()));
View Full Code Here

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

      try
      {
         JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
         JMSQueueConfiguration queue = parser.parseQueueConfiguration(document.getDocumentElement());
         HornetQQueue hqQueue = HornetQDestination.createQueue(queue.getName());
         String queueName = hqQueue.getAddress();
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {

            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
            if (!query.isExists())
            {
               if (queue.getSelector() != null)
               {
                  session.createQueue(queueName, queueName, queue.getSelector(), queue.isDurable());
               }
               else
               {
                  session.createQueue(queueName, queueName, queue.isDurable());
               }

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

    * @param node
    * @throws Exception
    */
   private void deployQueue(final Node node) throws Exception
   {
      JMSQueueConfiguration queueconfig = parser.parseQueueConfiguration(node);
      jmsServerManager.createQueue(false, queueconfig.getName(), queueconfig.getSelector(), queueconfig.isDurable(), queueconfig.getBindings());
   }
View Full Code Here

   public Response createJmsQueue(@Context UriInfo uriInfo, Document document)
   {
      try
      {
         JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
         JMSQueueConfiguration queue = parser.parseQueueConfiguration(document.getDocumentElement());
         HornetQQueue hqQueue = HornetQDestination.createQueue(queue.getName());
         String queueName = hqQueue.getAddress();
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {

            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
            if (!query.isExists())
            {
               if (queue.getSelector() != null)
               {
                  session.createQueue(queueName, queueName, queue.getSelector(), queue.isDurable());
               }
               else
               {
                  session.createQueue(queueName, queueName, queue.isDurable());
               }

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

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

      try
      {
         JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
         JMSQueueConfiguration queue = parser.parseQueueConfiguration(document.getDocumentElement());
         HornetQQueue hqQueue = HornetQDestination.createQueue(queue.getName());
         String queueName = hqQueue.getAddress();
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {

            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
            if (!query.isExists())
            {
               if (queue.getSelector() != null)
               {
                  session.createQueue(queueName, queueName, queue.getSelector(), queue.isDurable());
               }
               else
               {
                  session.createQueue(queueName, queueName, queue.isDurable());
               }

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

      assertEquals(true, cfConfig.isCacheLargeMessagesClient());
     
     
      assertEquals(1, jmsconfig.getQueueConfigurations().size());

      JMSQueueConfiguration queueConfig = jmsconfig.getQueueConfigurations().get(0);
      assertEquals("fullConfigurationQueue", queueConfig.getName());
      assertEquals(2, queueConfig.getBindings().length);
      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());
View Full Code Here

         connectorNames.add("connector");
         ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf", false,  connectorNames, "/cf");
         jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);

         // Step 4. Configure the JMS Queue
         JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl("queue1", null, false, "/queue/queue1");
         jmsConfig.getQueueConfigurations().add(queueConfig);

         // Step 5. Start the JMS Server using the HornetQ core server and the JMS configuration
         EmbeddedJMS jmsServer = new EmbeddedJMS();
         jmsServer.setConfiguration(configuration);
View Full Code Here

   public Response createJmsQueue(@Context UriInfo uriInfo, Document document)
   {
      try
      {
         JMSServerConfigParserImpl parser = new JMSServerConfigParserImpl();
         JMSQueueConfiguration queue = parser.parseQueueConfiguration(document.getDocumentElement());
         HornetQQueue hqQueue = HornetQDestination.createQueue(queue.getName());
         String queueName = hqQueue.getAddress();
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {

            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
            if (!query.isExists())
            {
               if (queue.getSelector() != null)
               {
                  session.createQueue(queueName, queueName, queue.getSelector(), queue.isDurable());
               }
               else
               {
                  session.createQueue(queueName, queueName, queue.isDurable());
               }

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

    * @param node
    * @throws Exception
    */
   private void deployQueue(final Node node) throws Exception
   {
      JMSQueueConfiguration queueconfig = parser.parseQueueConfiguration(node);
      jmsServerManager.createQueue(false, queueconfig.getName(), queueconfig.getSelector(), queueconfig.isDurable(), queueconfig.getBindings());
   }
View Full Code Here

TOP

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

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.