[hornetq-commits] JBoss hornetq SVN: r8871 - in trunk: src/main/org/hornetq/core/server/impl and 5 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Feb 11 15:16:39 EST 2010


Author: clebert.suconic at jboss.com
Date: 2010-02-11 15:16:38 -0500 (Thu, 11 Feb 2010)
New Revision: 8871

Added:
   trunk/src/main/org/hornetq/jms/server/config/impl/JMSQueueConfigurationImpl.java
Removed:
   trunk/src/main/org/hornetq/jms/server/config/impl/QueueConfigurationImpl.java
Modified:
   trunk/examples/jms/embedded/src/org/hornetq/jms/example/EmbeddedExample.java
   trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
   trunk/src/main/org/hornetq/jms/server/impl/JMSServerConfigParserImpl.java
   trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSConfigurationTest.java
   trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
Log:
Configuration changes for AS integration

Modified: trunk/examples/jms/embedded/src/org/hornetq/jms/example/EmbeddedExample.java
===================================================================
--- trunk/examples/jms/embedded/src/org/hornetq/jms/example/EmbeddedExample.java	2010-02-10 23:37:24 UTC (rev 8870)
+++ trunk/examples/jms/embedded/src/org/hornetq/jms/example/EmbeddedExample.java	2010-02-11 20:16:38 UTC (rev 8871)
@@ -38,7 +38,7 @@
 import org.hornetq.jms.server.config.JMSQueueConfiguration;
 import org.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
 import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;
-import org.hornetq.jms.server.config.impl.QueueConfigurationImpl;
+import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
 import org.jnp.server.Main;
 import org.jnp.server.NamingBeanImpl;
@@ -96,7 +96,7 @@
          jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
 
          // Step 7. Configure the JMS Queue
-         JMSQueueConfiguration queueConfig = new QueueConfigurationImpl("queue1", null, false, "/queue/queue1");
+         JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl("queue1", null, false, "/queue/queue1");
          jmsConfig.getQueueConfigurations().add(queueConfig);
 
          // Step 8. Start the JMS Server using the HornetQ core server and the JMS configuration

Modified: trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2010-02-10 23:37:24 UTC (rev 8870)
+++ trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2010-02-11 20:16:38 UTC (rev 8871)
@@ -165,7 +165,7 @@
 
    private volatile ExecutorFactory executorFactory;
 
-   private volatile HierarchicalRepository<Set<Role>> securityRepository;
+   private final HierarchicalRepository<Set<Role>> securityRepository;
 
    private volatile ResourceManager resourceManager;
 
@@ -258,6 +258,11 @@
       addressSettingsRepository = new HierarchicalObjectRepository<AddressSettings>();
 
       addressSettingsRepository.setDefault(new AddressSettings());
+      
+      securityRepository = new HierarchicalObjectRepository<Set<Role>>();
+
+      securityRepository.setDefault(new HashSet<Role>());
+
    }
 
    // lifecycle methods
@@ -429,12 +434,15 @@
          {
             memoryManager.stop();
          }
+         
+         addressSettingsRepository.clear();
+         
+         securityRepository.clear();
 
          pagingManager = null;
          securityStore = null;
          resourceManager = null;
          postOffice = null;
-         securityRepository = null;
          securityStore = null;
          queueFactory = null;
          resourceManager = null;
@@ -925,9 +933,6 @@
 
       storageManager = createStorageManager();
 
-      securityRepository = new HierarchicalObjectRepository<Set<Role>>();
-      securityRepository.setDefault(new HashSet<Role>());
-
       if (ConfigurationImpl.DEFAULT_CLUSTER_USER.equals(configuration.getClusterUser()) && ConfigurationImpl.DEFAULT_CLUSTER_PASSWORD.equals(configuration.getClusterPassword()))
       {
          log.warn("Security risk! It has been detected that the cluster admin user and password " + "have not been changed from the installation default. "

Copied: trunk/src/main/org/hornetq/jms/server/config/impl/JMSQueueConfigurationImpl.java (from rev 8870, trunk/src/main/org/hornetq/jms/server/config/impl/QueueConfigurationImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/server/config/impl/JMSQueueConfigurationImpl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/server/config/impl/JMSQueueConfigurationImpl.java	2010-02-11 20:16:38 UTC (rev 8871)
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.server.config.impl;
+
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+
+
+/**
+ * A QueueConfigurationImpl
+ *
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ *
+ */
+public class JMSQueueConfigurationImpl implements JMSQueueConfiguration
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   private final String name;
+
+   private final String selector;
+
+   private final boolean durable;
+
+   private final String[] bindings;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public JMSQueueConfigurationImpl(final String name,
+                                 final String selector,
+                                 final boolean durable,
+                                 final String... bindings)
+   {
+      this.name = name;
+      this.selector = selector;
+      this.durable = durable;
+      this.bindings = new String[bindings.length];
+      System.arraycopy(bindings, 0, this.bindings, 0, bindings.length);
+   }
+
+   // QueueConfiguration implementation -----------------------------
+
+   public String[] getBindings()
+   {
+      return bindings;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public String getSelector()
+   {
+      return selector;
+   }
+
+   public boolean isDurable()
+   {
+      return durable;
+   }
+
+   // Public --------------------------------------------------------
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}

Deleted: trunk/src/main/org/hornetq/jms/server/config/impl/QueueConfigurationImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/config/impl/QueueConfigurationImpl.java	2010-02-10 23:37:24 UTC (rev 8870)
+++ trunk/src/main/org/hornetq/jms/server/config/impl/QueueConfigurationImpl.java	2010-02-11 20:16:38 UTC (rev 8871)
@@ -1,89 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.config.impl;
-
-import org.hornetq.jms.server.config.JMSQueueConfiguration;
-
-
-/**
- * A QueueConfigurationImpl
- *
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- *
- */
-public class QueueConfigurationImpl implements JMSQueueConfiguration
-{
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final String name;
-
-   private final String selector;
-
-   private final boolean durable;
-
-   private final String[] bindings;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public QueueConfigurationImpl(final String name,
-                                 final String selector,
-                                 final boolean durable,
-                                 final String... bindings)
-   {
-      this.name = name;
-      this.selector = selector;
-      this.durable = durable;
-      this.bindings = new String[bindings.length];
-      System.arraycopy(bindings, 0, this.bindings, 0, bindings.length);
-   }
-
-   // QueueConfiguration implementation -----------------------------
-
-   public String[] getBindings()
-   {
-      return bindings;
-   }
-
-   public String getName()
-   {
-      return name;
-   }
-
-   public String getSelector()
-   {
-      return selector;
-   }
-
-   public boolean isDurable()
-   {
-      return durable;
-   }
-
-   // Public --------------------------------------------------------
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerConfigParserImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerConfigParserImpl.java	2010-02-10 23:37:24 UTC (rev 8870)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerConfigParserImpl.java	2010-02-11 20:16:38 UTC (rev 8871)
@@ -31,7 +31,7 @@
 import org.hornetq.jms.server.config.TopicConfiguration;
 import org.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
 import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;
-import org.hornetq.jms.server.config.impl.QueueConfigurationImpl;
+import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
 import org.hornetq.jms.server.config.impl.TopicConfigurationImpl;
 import org.hornetq.utils.XMLConfigurationUtil;
 import org.hornetq.utils.XMLUtil;
@@ -436,7 +436,7 @@
                                          final boolean durable,
                                          final String[] jndiArray)
    {
-      return new QueueConfigurationImpl(queueName, selectorString, durable, jndiArray);
+      return new JMSQueueConfigurationImpl(queueName, selectorString, durable, jndiArray);
    }
 
    /**

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java	2010-02-10 23:37:24 UTC (rev 8870)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java	2010-02-11 20:16:38 UTC (rev 8871)
@@ -45,7 +45,7 @@
 import org.hornetq.jms.server.config.JMSConfiguration;
 import org.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
 import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;
-import org.hornetq.jms.server.config.impl.QueueConfigurationImpl;
+import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
 import org.hornetq.tests.unit.util.InVMContext;
 import org.hornetq.tests.util.UnitTestCase;
@@ -164,7 +164,7 @@
       JMSConfiguration configuration = new JMSConfigurationImpl();
       context = new InVMContext();
       configuration.setContext(context);
-      configuration.getQueueConfigurations().add(new QueueConfigurationImpl(queueName, null, false, queueName));
+      configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl(queueName, null, false, queueName));
 
       ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf",
                                                                                        new TransportConfiguration(NettyConnectorFactory.class.getName()),

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSConfigurationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSConfigurationTest.java	2010-02-10 23:37:24 UTC (rev 8870)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSConfigurationTest.java	2010-02-11 20:16:38 UTC (rev 8871)
@@ -32,7 +32,7 @@
 import org.hornetq.jms.server.config.TopicConfiguration;
 import org.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
 import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;
-import org.hornetq.jms.server.config.impl.QueueConfigurationImpl;
+import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
 import org.hornetq.jms.server.config.impl.TopicConfigurationImpl;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
 import org.hornetq.tests.unit.util.InVMContext;
@@ -72,7 +72,7 @@
                                                                                        "/cf/binding1",
                                                                                        "/cf/binding2");
       jmsConfiguration.getConnectionFactoryConfigurations().add(cfConfig);
-      QueueConfigurationImpl queueConfig = new QueueConfigurationImpl(RandomUtil.randomString(),
+      JMSQueueConfigurationImpl queueConfig = new JMSQueueConfigurationImpl(RandomUtil.randomString(),
                                                                       null,
                                                                       false,
                                                                       "/queue/binding1",

Modified: trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java	2010-02-10 23:37:24 UTC (rev 8870)
+++ trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java	2010-02-11 20:16:38 UTC (rev 8871)
@@ -58,7 +58,7 @@
 import org.hornetq.jms.server.JMSServerManager;
 import org.hornetq.jms.server.config.JMSConfiguration;
 import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;
-import org.hornetq.jms.server.config.impl.QueueConfigurationImpl;
+import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
 import org.hornetq.jms.server.config.impl.TopicConfigurationImpl;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
 import org.hornetq.spi.core.protocol.ProtocolType;
@@ -1258,7 +1258,7 @@
        HornetQServer hornetQServer = HornetQServers.newHornetQServer(config);
        
        JMSConfiguration jmsConfig = new JMSConfigurationImpl();
-       jmsConfig.getQueueConfigurations().add(new QueueConfigurationImpl(getQueueName(), null, false, getQueueName()));
+       jmsConfig.getQueueConfigurations().add(new JMSQueueConfigurationImpl(getQueueName(), null, false, getQueueName()));
        jmsConfig.getTopicConfigurations().add(new TopicConfigurationImpl(getTopicName(), getTopicName()));
        server = new JMSServerManagerImpl(hornetQServer, jmsConfig);
        server.setContext(null);



More information about the hornetq-commits mailing list