[jboss-cvs] JBoss Messaging SVN: r5704 - in trunk: src/main/org/jboss/messaging/core/config/impl and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 23 10:04:27 EST 2009


Author: jmesnil
Date: 2009-01-23 10:04:27 -0500 (Fri, 23 Jan 2009)
New Revision: 5704

Added:
   trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueDeployer.java
Modified:
   trunk/src/config/jbm-configuration.xml
   trunk/src/config/jbm-standalone-beans.xml
   trunk/src/config/queues.xml
   trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
   trunk/src/main/org/jboss/messaging/core/deployers/Deployer.java
   trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java
   trunk/src/main/org/jboss/messaging/core/deployers/impl/FileDeploymentManager.java
   trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueSettingsDeployer.java
   trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityDeployer.java
   trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java
   trunk/src/schemas/jbm-configuration.xsd
   trunk/src/schemas/queues.xsd
   trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/FileDeploymentManagerTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/XMLDeployerTest.java
Log:
JBMESSAGING-1301: Provide xml schemas for our xml config

* queue settings content can be declared in either jbm-configuration.xml or queues.xml
* predefined queues can be declared in either jbm-configuration.xml or queues.xml
* Predefined Queues have a specific QueueDeployer which will parse the configurations files and put the queue configurations in the configuration object injected into MessagingServerImpl


Modified: trunk/src/config/jbm-configuration.xml
===================================================================
--- trunk/src/config/jbm-configuration.xml	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/config/jbm-configuration.xml	2009-01-23 15:04:27 UTC (rev 5704)
@@ -139,6 +139,7 @@
         <refresh-timeout>10000</refresh-timeout>
       </discovery-group>
 
+<queue name="in-jbm-configuration" address="in-jbm-configuration" filter="wtf > 1"/>
       <!--  Paging configuration -->
       
       <paging-max-threads>10</paging-max-threads>
@@ -182,4 +183,10 @@
 
    </configuration>
    
+   <settings>
+   
+      <queue name="in-jbm-configuration-settings" address="in-jbm-configuration-settings"/>
+   
+</settings>
+   
    </deployment>
\ No newline at end of file

Modified: trunk/src/config/jbm-standalone-beans.xml
===================================================================
--- trunk/src/config/jbm-standalone-beans.xml	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/config/jbm-standalone-beans.xml	2009-01-23 15:04:27 UTC (rev 5704)
@@ -45,6 +45,8 @@
 
    <bean name="MessagingServer" class="org.jboss.messaging.core.server.impl.MessagingServerImpl">
       <depends>QueueSettingsDeployer</depends>
+      <depends>QueueDeployer</depends>
+      
       <property name="storageManager">
          <inject bean="StorageManager"/>
       </property>
@@ -126,6 +128,17 @@
       </constructor>
    </bean>
 
+   <bean name="QueueDeployer" class="org.jboss.messaging.core.deployers.impl.QueueDeployer">
+      <constructor>
+         <parameter>
+            <inject bean="DeploymentManager"/>
+         </parameter>
+         <parameter>
+            <inject bean="Configuration"/>
+         </parameter>
+      </constructor>
+   </bean>
+   
    <bean name="SecurityDeployer" class="org.jboss.messaging.core.deployers.impl.SecurityDeployer">
       <constructor>
          <parameter>

Modified: trunk/src/config/queues.xml
===================================================================
--- trunk/src/config/queues.xml	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/config/queues.xml	2009-01-23 15:04:27 UTC (rev 5704)
@@ -2,120 +2,5 @@
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="urn:jboss:messaging ../schemas/queues.xsd ">
 
-   <security match="topicjms.testTopic">
-      <permission type="create" roles="durpublisher"/>
-      <permission type="read" roles="guest,publisher,durpublisher"/>
-      <permission type="write" roles="guest,publisher,durpublisher"/>
-   </security>
-
-   <security match="topicjms.securedTopic">
-      <permission type="write" roles="publisher"/>
-      <permission type="read" roles="publisher"/>
-   </security>
-
-   <security match="topicjms.testDurableTopic">
-      <permission type="create" roles="durpublisher"/>
-      <permission type="read" roles="guest,publisher,durpublisher"/>
-      <permission type="write" roles="guest,publisher,durpublisher"/>
-   </security>
-
-   <security match="queuejms.testQueue">
-      <permission type="read" roles="guest,publisher"/>
-      <permission type="write" roles="guest,publisher"/>
-   </security>
-
-   <security match="queuejms.NoSuchQueue">
-      <permission type="read" roles="guest,publisher"/>
-      <permission type="write" roles="guest,publisher"/>
-   </security>
-
-   <security match="topicjms.NoSuchTopic">
-      <permission type="read" roles="guest,publisher"/>
-      <permission type="write" roles="guest,publisher"/>
-   </security>
-
-   <security match="queuetempjms.*">
-      <permission type="create" roles="guest,def"/>
-      <permission type="read" roles="guest,def"/>
-      <permission type="write" roles="guest,def"/>
-   </security>
-
-   <security match="topictempjms.*">
-      <permission type="create" roles="guest,def"/>
-      <permission type="read" roles="guest,def"/>
-      <permission type="write" roles="guest,def"/>
-   </security>
-
-   <!--this will catch any word i.e. queuejms.anything-->
-   <!--<security match="queuejms.^">
-      <permission type="read" roles="guest,publisher"/>
-      <permission type="write" roles="guest,publisher"/>
-   </security>-->
-
-   <!--this will catch any word i.e. queuejms.anything-->
-   <!--<security match="topicjms.^">
-      <permission type="read" roles="guest,publisher"/>
-      <permission type="write" roles="guest,publisher"/>
-   </security>-->
-
-   <!--default security to catch all-->
-   <security match="*">
-      <permission type="create" roles="guest,def"/>
-      <permission type="read" roles="guest,def"/>
-      <permission type="write" roles="guest,def"/>
-   </security>
-
-   <queue-settings match="queuejms.QueueWithOwnDLQAndExpiryQueue">
-      <dead-letter-address>queuejms.PrivateDLQ</dead-letter-address>
-      <expiry-address>queuejms.PrivateExpiryQueue</expiry-address>
-   </queue-settings>
-
-   <queue-settings match="topicjms.TopicWithOwnDLQAndExpiryQueue">
-      <dead-letter-address>queuejms.PrivateDLQ</dead-letter-address>
-      <expiry-address>queuejms.PrivateExpiryQueue</expiry-address>
-   </queue-settings>
-
-   <queue-settings match="queuejms.QueueWithOwnRedeliveryDelay">
-      <redelivery-delay>5000</redelivery-delay>
-   </queue-settings>
-
-   <queue-settings match="topicjms.TopicWithOwnRedeliveryDelay">
-      <redelivery-delay>5000</redelivery-delay>
-   </queue-settings>
-
-   <queue-settings match="queuejms.testDistributedQueue">
-      <clustered>true</clustered>
-   </queue-settings>
-
-   <queue-settings match="topicjms.testDistributedTopic">
-      <clustered>true</clustered>
-   </queue-settings>
-
-   <queue-settings match="queuejms.testPerfQueue">
-      <clustered>false</clustered>
-   </queue-settings>
-
-   <queue-settings match="queuejms.MyQueue">
-      <max-size-bytes>-1</max-size-bytes>
-      <page-size-bytes>10485760</page-size-bytes>
-      <drop-messages-when-full>false</drop-messages-when-full>
-   </queue-settings>
-
-   <queue-settings match="queuejms.testGroupQueue">
-      <max-size-bytes>-1</max-size-bytes>
-      <page-size-bytes>10485760</page-size-bytes>
-      <drop-messages-when-full>false</drop-messages-when-full>
-      <distribution-policy-class>org.jboss.messaging.core.server.impl.GroupingRoundRobinDistributor</distribution-policy-class>
-   </queue-settings>
-
-   <!--default for catch all-->
-   <queue-settings match="*">
-      <clustered>false</clustered>
-      <dead-letter-address>queuejms.DLQ</dead-letter-address>
-      <expiry-address>queuejms.ExpiryQueue</expiry-address>
-      <redelivery-delay>0</redelivery-delay>
-      <max-size-bytes>-1</max-size-bytes>
-      <distribution-policy-class>org.jboss.messaging.core.server.impl.RoundRobinDistributor</distribution-policy-class>
-      <message-counter-history-day-limit>10</message-counter-history-day-limit>
-   </queue-settings>
+  <queue name="in-queue-xml" address="in-queue-xml"/>
 </settings>

Modified: trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -40,7 +40,6 @@
 import org.jboss.messaging.core.config.cluster.BroadcastGroupConfiguration;
 import org.jboss.messaging.core.config.cluster.DiscoveryGroupConfiguration;
 import org.jboss.messaging.core.config.cluster.DivertConfiguration;
-import org.jboss.messaging.core.config.cluster.QueueConfiguration;
 import org.jboss.messaging.core.logging.Logger;
 import org.jboss.messaging.core.server.JournalType;
 import org.jboss.messaging.util.Pair;
@@ -228,15 +227,6 @@
 
          parseDivertConfiguration(dvNode);
       }
-
-      NodeList queueNodes = e.getElementsByTagName("queue");
-
-      for (int i = 0; i < queueNodes.getLength(); i++)
-      {
-         Element queueNode = (Element)queueNodes.item(i);
-
-         parseQueueConfiguration(queueNode);
-      }
       
       // Persistence config
 
@@ -880,18 +870,4 @@
       
       divertConfigurations.add(config);
    }
-
-   private void parseQueueConfiguration(final Element node)
-   {
-      String name = node.getAttribute("name");
-      
-      String address = node.getAttribute("address");
-
-      String filterString = node.getAttribute("filter");
-
-      boolean durable = Boolean.parseBoolean(node.getAttribute("durable"));
-      
-      queueConfigurations.add(new QueueConfiguration(address, name, filterString, durable));
-   }
-
 }

Modified: trunk/src/main/org/jboss/messaging/core/deployers/Deployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/Deployer.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/main/org/jboss/messaging/core/deployers/Deployer.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -34,11 +34,11 @@
 public interface Deployer extends MessagingComponent
 {
    /**
-    * The name of the configuration file name to look for for deployment
+    * The name of the configuration files to look for for deployment
     *
-    * @return The name of the config file
+    * @return The names of the config files
     */
-   String getConfigFileName();
+   String[] getConfigFileNames();
 
    /**
     * Deploy the URL for the first time

Modified: trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -80,9 +80,9 @@
       jbmSecurityManager.removeUser(username);
    }
 
-   public String getConfigFileName()
+   public String[] getConfigFileNames()
    {
-      return "jbm-security.xml";
+      return new String[] {"jbm-security.xml"};
    }
 
    public void setJbmSecurityManager(final JBMUpdateableSecurityManager jbmSecurityManager)

Modified: trunk/src/main/org/jboss/messaging/core/deployers/impl/FileDeploymentManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/FileDeploymentManager.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/FileDeploymentManager.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -106,31 +106,34 @@
       {
          deployers.add(deployer);
          
-         String filename = deployer.getConfigFileName();
+         String[] filenames = deployer.getConfigFileNames();
          
-         log.debug("the filename is " + filename);
-         
-         log.debug(System.getProperty("java.class.path"));
-         
-         Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(filename);
-         
-         while (urls.hasMoreElements())
+         for (String filename : filenames)
          {
-            URL url = urls.nextElement();
-            
-            log.debug("Got url " + url);
-                                 
-            try
+            log.debug("the filename is " + filename);
+
+            log.debug(System.getProperty("java.class.path"));
+
+            Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(filename);
+
+            while (urls.hasMoreElements())
             {
-               log.debug("Deploying " + deployer + " with url " + url);
-               deployer.deploy(url);
+               URL url = urls.nextElement();
+
+               log.debug("Got url " + url);
+
+               try
+               {
+                  log.debug("Deploying " + deployer + " with url " + url);
+                  deployer.deploy(url);
+               }
+               catch (Exception e)
+               {
+                  log.error("Error deploying " + url, e);
+               }
+
+               deployed.put(url, new DeployInfo(deployer, new File(url.getFile()).lastModified()));            
             }
-            catch (Exception e)
-            {
-               log.error("Error deploying " + url, e);
-            }
-            
-            deployed.put(url, new DeployInfo(deployer, new File(url.getFile()).lastModified()));            
          }
       }      
       
@@ -146,13 +149,17 @@
       
       if (deployers.remove(deployer))
       {
-         Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(deployer.getConfigFileName());
-         while (urls.hasMoreElements())
+         String[] filenames = deployer.getConfigFileNames();
+         for (String filename : filenames)
          {
-            URL url = urls.nextElement();
-            
-            deployed.remove(url);
-         }         
+            Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(filename);
+            while (urls.hasMoreElements())
+            {
+               URL url = urls.nextElement();
+
+               deployed.remove(url);
+            }         
+         }
       }
    }
 
@@ -170,47 +177,52 @@
       {
          for (Deployer deployer : deployers)
          {
-            Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(deployer.getConfigFileName());
+            String[] filenames = deployer.getConfigFileNames();
 
-            while (urls.hasMoreElements())
+            for (String filename : filenames)
             {
-               URL url = urls.nextElement();
-               
-               DeployInfo info = deployed.get(url);
-               
-               long newLastModified = new File(url.getFile()).lastModified();
-                  
-               if (info == null)
-               {                              
-                  try
-                  {
-                     log.debug("Deploying " + deployer + " with url " + url);
-                     
-                     deployer.deploy(url);
-                     
-                     deployed.put(url, new DeployInfo(deployer, new File(url.getFile()).lastModified()));
+               Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(filename);
+
+               while (urls.hasMoreElements())
+               {
+                  URL url = urls.nextElement();
+
+                  DeployInfo info = deployed.get(url);
+
+                  long newLastModified = new File(url.getFile()).lastModified();
+
+                  if (info == null)
+                  {                              
+                     try
+                     {
+                        log.debug("Deploying " + deployer + " with url " + url);
+
+                        deployer.deploy(url);
+
+                        deployed.put(url, new DeployInfo(deployer, new File(url.getFile()).lastModified()));
+                     }
+                     catch (Exception e)
+                     {
+                        log.error("Error deploying " + url, e);
+                     }
                   }
-                  catch (Exception e)
-                  {
-                     log.error("Error deploying " + url, e);
+                  else if (newLastModified > info.lastModified)
+                  {                              
+                     try
+                     {
+                        log.debug("Redeploying " + deployer + " with url " + url);
+
+                        deployer.redeploy(url);
+
+                        deployed.put(url, new DeployInfo(deployer, new File(url.getFile()).lastModified()));
+                     }
+                     catch (Exception e)
+                     {
+                        log.error("Error redeploying " + url, e);
+                     }
                   }
-               }
-               else if (newLastModified > info.lastModified)
-               {                              
-                  try
-                  {
-                     log.debug("Redeploying " + deployer + " with url " + url);
-                     
-                     deployer.redeploy(url);
-                     
-                     deployed.put(url, new DeployInfo(deployer, new File(url.getFile()).lastModified()));
-                  }
-                  catch (Exception e)
-                  {
-                     log.error("Error redeploying " + url, e);
-                  }
-               }
-            }         
+               }               
+            }
          }
          
          for (Map.Entry<URL, DeployInfo> entry : deployed.entrySet())

Added: trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueDeployer.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueDeployer.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+
+package org.jboss.messaging.core.deployers.impl;
+
+import java.util.List;
+
+import org.jboss.messaging.core.config.Configuration;
+import org.jboss.messaging.core.config.cluster.QueueConfiguration;
+import org.jboss.messaging.core.deployers.DeploymentManager;
+import org.jboss.messaging.util.XMLUtil;
+import org.w3c.dom.Node;
+
+/**
+ * A QueueDeployer
+ * 
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ */
+public class QueueDeployer extends XmlDeployer
+{   
+   private final Configuration serverConfiguration;
+
+   public QueueDeployer(final DeploymentManager deploymentManager,
+                                final Configuration configuration)
+   {
+      super(deploymentManager);
+      this.serverConfiguration = configuration;
+   }
+   
+   /**
+    * the names of the elements to deploy
+    * @return the names of the elements todeploy
+    */
+   public String[] getElementTagName()
+   {
+      return new String[]{"queue"};
+   }
+
+   @Override
+   public void validate(Node rootNode) throws Exception
+   {
+      if ("deployment".equals(rootNode.getNodeName()))
+      {
+         System.out.println("QueueSettingsDeployer.validate() QUEUE_SETTINGS IN JBM_CONFIGURATION");
+         XMLUtil.validate(rootNode, "jbm-configuration.xsd");
+      } else 
+      {
+         System.out.println("QueueSettingsDeployer.validate() QUEUE_SETTINGS IN QUEUES");
+         XMLUtil.validate(rootNode, "queues.xsd");         
+      }
+   }
+
+   /**
+    * deploy an element
+    * @param node the element to deploy
+    * @throws Exception .
+    */
+   public void deploy(Node node) throws Exception
+   {
+      QueueConfiguration queueConfig = parseQueueConfiguration(node);
+      List<QueueConfiguration> configurations = serverConfiguration.getQueueConfigurations();
+      configurations.add(queueConfig);
+      serverConfiguration.setQueueConfigurations(configurations);
+   }
+   
+   @Override
+   public void undeploy(Node node) throws Exception
+   {
+   }
+
+   /**
+    * The name of the configuration file name to look for for deployment
+    *
+    * @return The name of the config file
+    */
+   public String[] getConfigFileNames()
+   {
+      return new String[] {"jbm-configuration.xml", "queues.xml"};
+   }
+
+   private QueueConfiguration parseQueueConfiguration(final Node node)
+   {
+      String name = node.getAttributes().getNamedItem("name").getNodeValue();
+      
+      String address = node.getAttributes().getNamedItem("address").getNodeValue();
+
+      String filterString = null;
+
+      Node filterNode = node.getAttributes().getNamedItem("filter");
+      if (filterNode !=null)
+      {
+         String filterValue = filterNode.getNodeValue();
+         if (!"".equals(filterValue.trim()))
+         {
+            filterString = filterValue;
+         }
+      }
+
+      boolean durable = false;
+      Node durableNode = node.getAttributes().getNamedItem("durable");
+      if (durableNode != null)
+      {
+         durable = Boolean.parseBoolean(durableNode.getNodeValue());
+      }
+      
+      return new QueueConfiguration(address, name, filterString, durable);
+   }
+
+}

Modified: trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueSettingsDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueSettingsDeployer.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueSettingsDeployer.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -74,7 +74,15 @@
    @Override
    public void validate(Node rootNode) throws Exception
    {
-      XMLUtil.validate(rootNode, "queues.xsd");
+      if ("deployment".equals(rootNode.getNodeName()))
+      {
+         System.out.println("QueueSettingsDeployer.validate() QUEUE_SETTINGS IN JBM_CONFIGURATION");
+         XMLUtil.validate(rootNode, "jbm-configuration.xsd");
+      } else 
+      {
+         System.out.println("QueueSettingsDeployer.validate() QUEUE_SETTINGS IN QUEUES");
+         XMLUtil.validate(rootNode, "queues.xsd");         
+      }
    }
 
    /**
@@ -137,14 +145,9 @@
       queueSettingsRepository.addMatch(match, queueSettings);
    }
 
-   /**
-    * The name of the configuration file name to look for for deployment
-    *
-    * @return The name of the config file
-    */
-   public String getConfigFileName()
+   public String[] getConfigFileNames()
    {
-      return "queues.xml";
+      return new String[] {"jbm-configuration", "queues.xml"};
    }
 
    /**

Modified: trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityDeployer.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityDeployer.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -159,8 +159,8 @@
     *
     * @return The name of the config file
     */
-   public String getConfigFileName()
+   public String[] getConfigFileNames()
    {
-      return QUEUES_XML;
+      return new String[] {QUEUES_XML};
    }
 }

Modified: trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -453,14 +453,9 @@
       }
    }
 
-   /**
-    * The name of the configuration file name to look for for deployment
-    * 
-    * @return The name of the config file
-    */
-   public String getConfigFileName()
+   public String[] getConfigFileNames()
    {
-      return "jbm-jms.xml";
+      return new String[] {"jbm-jms.xml"};
    }
 
 }

Modified: trunk/src/schemas/jbm-configuration.xsd
===================================================================
--- trunk/src/schemas/jbm-configuration.xsd	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/schemas/jbm-configuration.xsd	2009-01-23 15:04:27 UTC (rev 5704)
@@ -5,14 +5,18 @@
 	elementFormDefault="qualified" attributeFormDefault="unqualified"
 	version="1.0">
 
+	<xsd:include schemaLocation="queues.xsd"></xsd:include>
 	<xsd:element name="deployment">
 		<xsd:complexType>
 			<xsd:sequence>
 				<xsd:element ref="configuration" maxOccurs="1"
 					minOccurs="1">
 				</xsd:element>
+				<xsd:element ref="settings" maxOccurs="1"
+					minOccurs="0">
+				</xsd:element>
 			</xsd:sequence>
-		</xsd:complexType>		
+		</xsd:complexType>
 	</xsd:element>
 
 	<xsd:element name="configuration">
@@ -104,9 +108,9 @@
 				<xsd:element name="divert" type="divertType"
 					maxOccurs="unbounded" minOccurs="0">
 				</xsd:element>
-				<xsd:element name="queue" type="queueType" maxOccurs="unbounded"
-                    minOccurs="0">
-                </xsd:element>
+				<xsd:element name="queue" type="queueType"
+					maxOccurs="unbounded" minOccurs="0">
+				</xsd:element>
 				<xsd:element name="bridge" type="bridgeType"
 					maxOccurs="unbounded" minOccurs="0">
 				</xsd:element>
@@ -350,7 +354,7 @@
 
 	<xsd:complexType name="divertType">
 		<xsd:sequence>
-		   <xsd:element name="unique-name" type="xsd:string"
+			<xsd:element name="unique-name" type="xsd:string"
 				maxOccurs="1" minOccurs="1">
 			</xsd:element>
 			<xsd:element name="routing-name" type="xsd:string"
@@ -397,11 +401,6 @@
 			<xsd:any></xsd:any>
 		</xsd:sequence>
 	</xsd:complexType>
-	
-   <xsd:complexType name="queueType">
-    <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
-    <xsd:attribute name="address" type="xsd:string" use="required"></xsd:attribute>
-    <xsd:attribute name="filter" type="xsd:string" use="optional"></xsd:attribute>
-    <xsd:attribute name="durable" type="xsd:boolean" use="optional"></xsd:attribute>
-   </xsd:complexType>
+
+
 </xsd:schema>

Modified: trunk/src/schemas/queues.xsd
===================================================================
--- trunk/src/schemas/queues.xsd	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/src/schemas/queues.xsd	2009-01-23 15:04:27 UTC (rev 5704)
@@ -16,6 +16,9 @@
    			<xsd:element ref="queue-settings" maxOccurs="unbounded"
    				minOccurs="0">
    			</xsd:element>
+            <xsd:element ref="queue" maxOccurs="unbounded"
+                minOccurs="0">
+            </xsd:element>
    		</xsd:sequence>
    	</xsd:complexType>
    </xsd:element>
@@ -70,4 +73,17 @@
    	</xsd:sequence>
    	<xsd:attribute name="match" type="xsd:string" use="required"></xsd:attribute>
    </xsd:complexType>   
+   
+      <xsd:element name="queue" type="queueType"></xsd:element>
+   
+    <xsd:complexType name="queueType">
+        <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
+        <xsd:attribute name="address" type="xsd:string"
+            use="required">
+        </xsd:attribute>
+        <xsd:attribute name="filter" type="xsd:string" use="optional"></xsd:attribute>
+        <xsd:attribute name="durable" type="xsd:boolean"
+            use="optional">
+        </xsd:attribute>
+    </xsd:complexType>
 </xsd:schema>

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/FileDeploymentManagerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/FileDeploymentManagerTest.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/FileDeploymentManagerTest.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -82,7 +82,7 @@
 
       try
       {      
-         EasyMock.expect(deployer.getConfigFileName()).andReturn(filename);
+         EasyMock.expect(deployer.getConfigFileNames()).andReturn(new String[] {filename});
          
          URL url = file.toURL();
          
@@ -156,15 +156,15 @@
       
       try
       {      
-         EasyMock.expect(deployer1.getConfigFileName()).andReturn(filename1);      
+         EasyMock.expect(deployer1.getConfigFileNames()).andReturn(new String[] {filename1});      
          URL url1 = file1.toURL();      
          deployer1.deploy(url1);
          
-         EasyMock.expect(deployer2.getConfigFileName()).andReturn(filename2);      
+         EasyMock.expect(deployer2.getConfigFileNames()).andReturn(new String[] {filename2});      
          URL url2 = file2.toURL();      
          deployer2.deploy(url2);
          
-         EasyMock.expect(deployer3.getConfigFileName()).andReturn(filename3);      
+         EasyMock.expect(deployer3.getConfigFileNames()).andReturn(new String[] {filename3});      
          URL url3 = file3.toURL();      
          deployer3.deploy(url3);
    
@@ -199,7 +199,7 @@
          
          EasyMock.reset(deployer1, deployer2, deployer3);
          
-         EasyMock.expect(deployer1.getConfigFileName()).andReturn(filename1); 
+         EasyMock.expect(deployer1.getConfigFileNames()).andReturn(new String[] {filename1}); 
                   
          EasyMock.replay(deployer1, deployer2, deployer3);
          
@@ -214,8 +214,8 @@
          
          EasyMock.reset(deployer1, deployer2, deployer3);
          
-         EasyMock.expect(deployer2.getConfigFileName()).andReturn(filename2); 
-         EasyMock.expect(deployer3.getConfigFileName()).andReturn(filename3); 
+         EasyMock.expect(deployer2.getConfigFileNames()).andReturn(new String[] {filename2}); 
+         EasyMock.expect(deployer3.getConfigFileNames()).andReturn(new String[] {filename3}); 
          
          EasyMock.replay(deployer1, deployer2, deployer3);
          
@@ -262,7 +262,7 @@
  
       try
       {      
-         EasyMock.expect(deployer.getConfigFileName()).andReturn(filename);      
+         EasyMock.expect(deployer.getConfigFileNames()).andReturn(new String[] {filename});      
          URL url = file.toURL();      
          deployer.deploy(url);
          
@@ -277,7 +277,7 @@
          
          EasyMock.reset(deployer);
                            
-         EasyMock.expect(deployer.getConfigFileName()).andReturn(filename);          
+         EasyMock.expect(deployer.getConfigFileNames()).andReturn(new String[] {filename});          
          deployer.redeploy(url);
          
          EasyMock.replay(deployer);
@@ -296,7 +296,7 @@
          
          EasyMock.reset(deployer);
          
-         EasyMock.expect(deployer.getConfigFileName()).andReturn(filename); 
+         EasyMock.expect(deployer.getConfigFileNames()).andReturn(new String[] {filename}); 
          
          EasyMock.replay(deployer);
          
@@ -328,7 +328,7 @@
  
       try
       {      
-         EasyMock.expect(deployer.getConfigFileName()).andReturn(filename);      
+         EasyMock.expect(deployer.getConfigFileNames()).andReturn(new String[] {filename});      
          URL url = file.toURL();      
          deployer.deploy(url);
          
@@ -348,7 +348,7 @@
          
          EasyMock.reset(deployer);
          
-         EasyMock.expect(deployer.getConfigFileName()).andReturn(filename);   
+         EasyMock.expect(deployer.getConfigFileNames()).andReturn(new String[] {filename});   
          
          deployer.undeploy(url);
          
@@ -368,7 +368,7 @@
          
          EasyMock.reset(deployer);
          
-         EasyMock.expect(deployer.getConfigFileName()).andReturn(filename);  
+         EasyMock.expect(deployer.getConfigFileNames()).andReturn(new String[] {filename});  
          
          deployer.deploy(url);
          

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/XMLDeployerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/XMLDeployerTest.java	2009-01-23 14:48:08 UTC (rev 5703)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/XMLDeployerTest.java	2009-01-23 15:04:27 UTC (rev 5704)
@@ -221,9 +221,9 @@
          return new String[] { elementname };
       }
 
-      public String getConfigFileName()
+      public String[] getConfigFileNames()
       {
-         return "test";
+         return new String[] {"test"};
       }
 
       @Override




More information about the jboss-cvs-commits mailing list