[jboss-cvs] JBoss Messaging SVN: r5665 - in trunk: src and 9 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 20 04:04:09 EST 2009


Author: jmesnil
Date: 2009-01-20 04:04:09 -0500 (Tue, 20 Jan 2009)
New Revision: 5665

Added:
   trunk/src/schemas/
   trunk/src/schemas/jbm-configuration.xsd
   trunk/src/schemas/jbm-jms.xsd
   trunk/src/schemas/jbm-security.xsd
   trunk/src/schemas/queues.xsd
Modified:
   trunk/.classpath
   trunk/build-messaging.xml
   trunk/build.xml
   trunk/src/bin/run.bat
   trunk/src/bin/run.sh
   trunk/src/config/jbm-cluster-configuration.xml
   trunk/src/config/jbm-configuration.xml
   trunk/src/config/jbm-jms.xml
   trunk/src/config/jbm-security.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/impl/BasicSecurityDeployer.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/core/deployers/impl/XmlDeployer.java
   trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java
   trunk/src/main/org/jboss/messaging/util/XMLUtil.java
   trunk/tests/config/ConfigurationTest-config.xml
   trunk/tests/config/ConfigurationTest-config2.xml
   trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/XMLDeployerTest.java
Log:
JBMESSAGING-1301: Provide xml schemas for our xml config

added 4 XML schemas for jbm-configuration, jbm-security, queues & jbm-jms configuration files

shema are validated:
- when the distro is created to ensure we ship valid configuration
- when the server is started, each subclass of XmlDeployer has a validate(Element) method to check the validity of the XML configuration for the related schema

Modified: trunk/.classpath
===================================================================
--- trunk/.classpath	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/.classpath	2009-01-20 09:04:09 UTC (rev 5665)
@@ -12,6 +12,7 @@
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="src" path="tests/jms-tests/src"/>
+	<classpathentry kind="src" path="src/schemas"/>
 	<classpathentry kind="lib" path="thirdparty/oswego-concurrent/lib/concurrent.jar"/>
 	<classpathentry kind="lib" path="thirdparty/apache-log4j/lib/log4j.jar"/>
 	<classpathentry kind="lib" path="thirdparty/junit/lib/junit.jar"/>

Modified: trunk/build-messaging.xml
===================================================================
--- trunk/build-messaging.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/build-messaging.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -85,6 +85,7 @@
    <property name="src.dir" value="src"/>
    <property name="src.main.dir" value="${src.dir}/main"/>
    <property name="src.config.dir" value="${src.dir}/config"/>
+   <property name="src.schemas.dir" value="${src.dir}/schemas"/>
    <property name="src.bin.dir" value="${src.dir}/bin"/>
    <property name="doc.dir" value="docs"/>
    <property name="licenses.dir" value="licenses"/>
@@ -100,6 +101,7 @@
              value="${build.dir}/${build.artifact}"/>
    <property name="build.distro.lib.dir" value="${build.distro.dir}/lib"/>
    <property name="build.distro.config.dir" value="${build.distro.dir}/config"/>
+   <property name="build.distro.schemas.dir" value="${build.distro.dir}/schemas"/>
    <property name="build.distro.bin.dir" value="${build.distro.dir}/bin"/>
    <property name="build.distro.api.dir" value="${build.distro.dir}/docs/api"/>
    <property name="build.distro.examples.dir" value="${build.distro.dir}/examples"/>
@@ -284,6 +286,7 @@
       <pathelement location="${test.dir}/tmpfiles"/>
       <pathelement location="${test.classes.dir}"/>
       <pathelement location="${src.config.dir}"/>
+      <pathelement location="${src.schemas.dir}"/>
       <path refid="test.compilation.classpath"/>
       <path refid="oswego.concurrent.classpath"/>
       <path refid="slf4j.api.classpath"/>
@@ -301,6 +304,7 @@
    <path id="jms.test.execution.classpath">
       <pathelement location="${test.dir}/config"/>
       <pathelement location="${src.config.dir}"/>
+      <pathelement location="${src.schemas.dir}"/>
       <pathelement location="${test.jms.dir}/config"/>
       <pathelement location="${test.jms.classes.dir}"/>
       <path location="${build.jars.dir}/${transports.jar.name}"/>
@@ -333,6 +337,7 @@
    <path id="jms.standalone.server.classpath">
       <pathelement location="${test.dir}/config"/>
       <pathelement location="${src.config.dir}"/>
+      <pathelement location="${src.schemas.dir}"/>
       <pathelement location="${test.jms.dir}/config"/>
       <pathelement location="${test.jms.classes.dir}"/>
       <path location="${build.jars.dir}/${transports.jar.name}"/>
@@ -542,6 +547,30 @@
          <arg line="bootstrap"/>
       </exec>
    </target>
+    
+   <target name="validate-configuration" description="validate configuration files">
+      <echo>validating server configuration</echo>
+      <schemavalidate file="src/config/jbm-configuration.xml">
+         <schema namespace="urn:jboss:messaging-configuration" 
+                 file="src/schemas/jbm-configuration.xsd"/>
+      </schemavalidate>
+      <echo>validating security credentials</echo>
+      <schemavalidate file="src/config/jbm-security.xml">
+         <schema namespace="urn:jboss:messaging-security" 
+                 file="src/schemas/jbm-security.xsd"/>
+      </schemavalidate>
+      <echo>validating queue settings</echo>
+      <schemavalidate file="src/config/queues.xml">
+         <schema namespace="urn:jboss:messaging-queues" 
+                 file="src/schemas/queues.xsd"/>
+      </schemavalidate>
+      <echo>validating jms resources</echo>
+      <schemavalidate file="src/config/jbm-jms.xml">
+         <schema namespace="urn:jboss:messaging-jms" 
+                 file="src/schemas/jbm-jms.xsd"/>
+      </schemavalidate>
+   </target>
+    
    <!-- ======================================================================================== -->
    <!-- Archival Tasks                                                                           -->
    <!-- ======================================================================================== -->
@@ -719,7 +748,7 @@
       </javac>
    </target>
 
-   <target name="distro" depends="jar, jar-client">
+   <target name="distro" depends="jar, jar-client, validate-configuration">
 
       <mkdir dir="${build.distro.dir}"/>
       <mkdir dir="${build.distro.lib.dir}"/>
@@ -822,13 +851,17 @@
             <include name="messaging.truststore"/>
          </fileset>
       </copy>
+      <copy todir="${build.distro.schemas.dir}">
+         <fileset dir="${src.schemas.dir}">
+            <include name="*.xsd"/>
+         </fileset>
+      </copy>
       <copy todir="${build.distro.bin.dir}">
          <fileset dir="${src.bin.dir}">
             <include name="run.sh"/>
             <include name="run.bat"/>
          </fileset>
       </copy>
-
       <copy todir="${build.distro.bin.dir}">
          <fileset dir="${native.bin.dir}">
             <include name="*.so"/>

Modified: trunk/build.xml
===================================================================
--- trunk/build.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/build.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -105,6 +105,11 @@
    <target name="userdoc">
       <ant antfile="build-messaging.xml" target="userdoc"/>
    </target>
+    
+   <target name="validate-configuration">
+      <ant antfile="build-messaging.xml" target="validate-configuration"/>
+   </target>
+
    <!-- ======================================================================================== -->
    <!-- Archival Tasks                                                                           -->
    <!-- ======================================================================================== -->

Modified: trunk/src/bin/run.bat
===================================================================
--- trunk/src/bin/run.bat	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/bin/run.bat	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,7 +1,7 @@
 @ echo off
 setlocal ENABLEDELAYEDEXPANSION
 set JBM_HOME=..
-set CLASSPATH=%JBM_HOME%\config\
+set CLASSPATH=%JBM_HOME%\config\;%JBM_HOME%\schemas\
 set JVM_ARGS=-XX:+UseParallelGC -Xms512M -Xmx1024M -Djava.util.logging.config.file=%JBM_HOME%\config\logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.core.logging.JBMLoggerPlugin -Djava.library.path=.
 REM export JVM_ARGS="-Xmx512M -Djava.util.logging.config.file=%JBM_HOME%\config\logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.core.logging.JBMLoggerPlugin -Djava.library.path=. -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
 for /R ..\lib %%A in (*.jar) do (	

Modified: trunk/src/bin/run.sh
===================================================================
--- trunk/src/bin/run.sh	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/bin/run.sh	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,5 +1,5 @@
 export JBM_HOME=..
-export CLASSPATH=$JBM_HOME/config/
+export CLASSPATH=$JBM_HOME/config/:$JBM_HOME/schemas/
 export JVM_ARGS="-XX:+UseParallelGC -Xms512M -Xmx1024M -Djava.util.logging.config.file=$JBM_HOME/config/logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=."
 #export JVM_ARGS="-Xmx512M -Djava.util.logging.config.file=$JBM_HOME/config/logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=. -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
 for i in `ls $JBM_HOME/lib/*.jar`; do

Modified: trunk/src/config/jbm-cluster-configuration.xml
===================================================================
--- trunk/src/config/jbm-cluster-configuration.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/config/jbm-cluster-configuration.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,4 +1,5 @@
-<deployment>
+<deployment xmlns="urn:jboss:messaging-configuration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:messaging-configuration ../schemas/jbm-configuration.xsd ">
+
    <configuration>
 
       <clustered>true</clustered>
@@ -78,14 +79,14 @@
       </remoting-interceptors>
       -->
       
-      <backup>false</backup>
-      
       <queue-activation-timeout>30000</queue-activation-timeout>
 
+      <backup>false</backup>      
+
       <!--
-      <backup-connector connector-name="backup-connector"/>
+      <backup-connector-ref connector-name="netty-backup"/>
       -->
-      
+
       <!-- Connectors -->
       
       <connector name="netty-backup">

Modified: trunk/src/config/jbm-configuration.xml
===================================================================
--- trunk/src/config/jbm-configuration.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/config/jbm-configuration.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,4 +1,4 @@
-<deployment>
+<deployment xmlns="urn:jboss:messaging-configuration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:messaging-configuration ../schemas/jbm-configuration.xsd ">
    <configuration>
 
       <clustered>false</clustered>
@@ -33,9 +33,8 @@
       
       <message-flow name="example-static-connectors">
          <address>jmstopics.#</address>
-         <connector-ref connector-name="connector1" backup-connector-name="backup-connector1"/>
-         <connector-ref connector-name="connector2"/>
-         <connector-ref connector-name="connector3"/>
+         <connector-ref connector-name="netty" backup-connector-name="netty-backup"/>
+         <connector-ref connector-name="netty-http"/>
          <exclusive>false</exclusive>      
       </message-flow>
       
@@ -78,12 +77,12 @@
       </remoting-interceptors>
       -->
       
-      <backup>false</backup>
-      
       <queue-activation-timeout>30000</queue-activation-timeout>
 
+      <backup>false</backup>
+      
       <!--
-      <backup-connector-ref connector-name="backup-connector"/>
+      <backup-connector-ref connector-name="netty-backup"/>
       -->
       
       <!-- Connectors -->

Modified: trunk/src/config/jbm-jms.xml
===================================================================
--- trunk/src/config/jbm-jms.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/config/jbm-jms.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,4 +1,6 @@
-<deployment>
+<deployment xmlns="urn:jboss:messaging-jms" 
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:messaging-jms ../schemas/jbm-jms.xsd ">
 
    <connection-factory name="testConnectionFactory">
       <connector-ref connector-name="netty"/>
@@ -16,12 +18,12 @@
 
    <connection-factory name="ServerAckConnectionFactory">
       <connector-ref connector-name="netty"/>
-      <pre-acknowledge>true</pre-acknowledge>
       <entry name="ServerAckConnectionFactory"/>
       <entry name="/ServerAckConnectionFactory"/>
       <entry name="/ServerAckXAConnectionFactory"/>
       <entry name="java:/ServerAckConnectionFactory"/>
       <entry name="java:/ServerAckXAConnectionFactory"/>
+      <pre-acknowledge>true</pre-acknowledge>
    </connection-factory>
 
    <connection-factory name="ClusteredConnectionFactory">
@@ -42,18 +44,18 @@
 
    <connection-factory name="MyExampleConnectionFactory">
       <connector-ref connector-name="netty"/>
-      <ping-period>5000</ping-period>
-      <call-timeout>30000</call-timeout>
       <entry name="/MyExampleConnectionFactory"/>
       <entry name="/acme/MyExampleConnectionFactoryDupe"/>
       <entry name="java:/xyz/CF1"/>
       <entry name="java:/connectionfactories/acme/connection_factory"/>
+      <ping-period>5000</ping-period>
+      <call-timeout>30000</call-timeout>
       <!-- You can specify the default Client ID to use for connections created using this factory -->
       <client-id>MyClientID</client-id>
       <!-- The batch size in bytes to use when using the DUPS_OK_ACKNOWLEDGE acknowledgement mode -->
-      <dups-ok-batch-size>1048576</dups-ok-batch-size>-size>
+      <dups-ok-batch-size>1048576</dups-ok-batch-size>
       <!-- The batch size in bytes to use when using transactional sessions -->
-      <transaction-batch-size>1048576</transaction-batch-size>-size>
+      <transaction-batch-size>1048576</transaction-batch-size>
       <!-- This is the send window size in bytes -->
       <producer-window-size>1048576</producer-window-size>
       <!-- This is the maximum producer send rate that will be applied when using rate based producer flow control -->

Modified: trunk/src/config/jbm-security.xml
===================================================================
--- trunk/src/config/jbm-security.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/config/jbm-security.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,4 +1,4 @@
-<deployment>
+<deployment xmlns="urn:jboss:messaging-security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:messaging-security ../schemas/jbm-security.xsd ">
       <user name="guest" password="guest">
          <role name="guest"/>
       </user>

Modified: trunk/src/config/queues.xml
===================================================================
--- trunk/src/config/queues.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/config/queues.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,4 +1,6 @@
-<deployment>
+<deployment xmlns="urn:jboss:messaging-queues" 
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+            xsi:schemaLocation="urn:jboss:messaging-queues ../schemas/queues.xsd ">
 
    <security match="topicjms.testTopic">
       <permission type="create" roles="durpublisher"/>
@@ -65,7 +67,7 @@
 
    <queue-settings match="queuejms.QueueWithOwnDLQAndExpiryQueue">
       <dead-letter-address>queuejms.PrivateDLQ</dead-letter-address>
-      <expiry-queue>queuejms.PrivateExpiryQueue</expiry-queue>
+      <expiry-address>queuejms.PrivateExpiryQueue</expiry-address>
    </queue-settings>
 
    <queue-settings match="topicjms.TopicWithOwnDLQAndExpiryQueue">

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-20 01:38:41 UTC (rev 5664)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2009-01-20 09:04:09 UTC (rev 5665)
@@ -66,6 +66,7 @@
    // Constants ------------------------------------------------------------------------
 
    private static final String DEFAULT_CONFIGURATION_URL = "jbm-configuration.xml";
+   private static final String CONFIGURATION_SCHEMA_URL = "jbm-configuration.xsd";
 
    // Attributes ----------------------------------------------------------------------
 
@@ -80,6 +81,7 @@
       String xml = XMLUtil.readerToString(reader);
       xml = XMLUtil.replaceSystemProps(xml);
       Element e = XMLUtil.stringToElement(xml);
+      XMLUtil.validate(e, CONFIGURATION_SCHEMA_URL);
 
       clustered = getBoolean(e, "clustered", clustered);
 

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-20 01:38:41 UTC (rev 5664)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java	2009-01-20 09:04:09 UTC (rev 5665)
@@ -23,6 +23,7 @@
 
 import org.jboss.messaging.core.deployers.DeploymentManager;
 import org.jboss.messaging.core.security.JBMUpdateableSecurityManager;
+import org.jboss.messaging.util.XMLUtil;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
@@ -48,6 +49,12 @@
       return new String[]{"user"};
    }
 
+   @Override
+   public void validate(Node rootNode) throws Exception
+   {
+      XMLUtil.validate(rootNode, "jbm-security.xsd");
+   }
+
    public void deploy(final Node node) throws Exception
    {
       String username = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue();

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-20 01:38:41 UTC (rev 5664)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueSettingsDeployer.java	2009-01-20 09:04:09 UTC (rev 5665)
@@ -26,6 +26,7 @@
 import org.jboss.messaging.core.settings.HierarchicalRepository;
 import org.jboss.messaging.core.settings.impl.QueueSettings;
 import org.jboss.messaging.util.SimpleString;
+import org.jboss.messaging.util.XMLUtil;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
@@ -70,6 +71,12 @@
       return new String[]{"queue-settings"};
    }
 
+   @Override
+   public void validate(Node rootNode) throws Exception
+   {
+      XMLUtil.validate(rootNode, "queues.xsd");
+   }
+
    /**
     * deploy an element
     * @param node the element to deploy

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-20 01:38:41 UTC (rev 5664)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityDeployer.java	2009-01-20 09:04:09 UTC (rev 5665)
@@ -29,6 +29,7 @@
 import org.jboss.messaging.core.deployers.DeploymentManager;
 import org.jboss.messaging.core.security.Role;
 import org.jboss.messaging.core.settings.HierarchicalRepository;
+import org.jboss.messaging.util.XMLUtil;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
@@ -72,6 +73,12 @@
       return new String[]{SECURITY_ELEMENT_NAME};
    }
 
+   @Override
+   public void validate(Node rootNode) throws Exception
+   {
+      XMLUtil.validate(rootNode, "queues.xsd");
+   }
+   
    /**
     * the key attribute for theelement, usually 'name' but can be overridden
     *

Modified: trunk/src/main/org/jboss/messaging/core/deployers/impl/XmlDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/XmlDeployer.java	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/XmlDeployer.java	2009-01-20 09:04:09 UTC (rev 5665)
@@ -160,6 +160,9 @@
    public synchronized void deploy(final URL url) throws Exception
    {
       Element e = getRootElement(url);
+      
+      validate(e);
+      
       //find all thenodes to deploy
       String elements[] = getElementTagName();
       for (String element : elements)
@@ -260,6 +263,11 @@
    public abstract void deploy(final Node node) throws Exception;
 
    /**
+    * Validate the DOM 
+    */
+   public abstract void validate(final Node rootNode) throws Exception;
+
+   /**
     * undeploys an element
     * @param node the element to undeploy
     * @throws Exception .

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-20 01:38:41 UTC (rev 5664)
+++ trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java	2009-01-20 09:04:09 UTC (rev 5665)
@@ -123,6 +123,12 @@
       return new String[] { QUEUE_NODE_NAME, TOPIC_NODE_NAME, CONNECTION_FACTORY_NODE_NAME };
    }
 
+   @Override
+   public void validate(Node rootNode) throws Exception
+   {
+      XMLUtil.validate(rootNode, "jbm-jms.xsd");
+   }
+   
    /**
     * deploy an element
     * 
@@ -292,7 +298,7 @@
 
                if (backupNode != null)
                {
-                  String backupConnectorName = node.getNodeValue();
+                  String backupConnectorName = backupNode.getNodeValue();
 
                   backupConnector = configuration.getConnectorConfigurations().get(backupConnectorName);
 

Modified: trunk/src/main/org/jboss/messaging/util/XMLUtil.java
===================================================================
--- trunk/src/main/org/jboss/messaging/util/XMLUtil.java	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/src/main/org/jboss/messaging/util/XMLUtil.java	2009-01-20 09:04:09 UTC (rev 5665)
@@ -22,6 +22,7 @@
 
 package org.jboss.messaging.util;
 
+import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.io.StringReader;
@@ -32,8 +33,15 @@
 import java.util.List;
 import java.util.Properties;
 
+import javax.xml.XMLConstants;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
 
 import org.jboss.messaging.core.logging.Logger;
 import org.w3c.dom.Document;
@@ -42,6 +50,7 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 
 /**
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
@@ -467,6 +476,21 @@
       }
    }
 
+   public static void validate(Node node, String schemaFile) throws Exception
+   {
+      SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+      Source schemaSource = new StreamSource(ClassLoader.getSystemResourceAsStream(schemaFile));
+      Schema schema = factory.newSchema(schemaSource);
+      Validator validator = schema.newValidator();
+
+      // validate the DOM tree
+      try {
+          validator.validate(new DOMSource(node));
+      } catch (SAXException e) {
+         throw new IllegalStateException("Invalid configuration", e);
+      }
+   }
+   
    // Attributes -----------------------------------------------------------------------------------
 
    // Constructors ---------------------------------------------------------------------------------

Added: trunk/src/schemas/jbm-configuration.xsd
===================================================================
--- trunk/src/schemas/jbm-configuration.xsd	                        (rev 0)
+++ trunk/src/schemas/jbm-configuration.xsd	2009-01-20 09:04:09 UTC (rev 5665)
@@ -0,0 +1,296 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+   targetNamespace="urn:jboss:messaging-configuration"
+   xmlns="urn:jboss:messaging-configuration"
+   elementFormDefault="qualified"
+   attributeFormDefault="unqualified"
+   version="1.0">
+   
+   <xsd:element name="deployment">
+   	<xsd:complexType>
+   		<xsd:sequence>
+   			<xsd:element ref="configuration" maxOccurs="1"
+   				minOccurs="1">
+   			</xsd:element>
+   		</xsd:sequence>
+   	</xsd:complexType>
+   </xsd:element>
+
+   <xsd:element name="configuration">
+      <xsd:complexType>
+      		<xsd:sequence>
+      			<xsd:element ref="clustered" maxOccurs="1"
+      				minOccurs="0" />
+      			<xsd:element ref="broadcast-group" maxOccurs="1"
+      				minOccurs="0">
+      			</xsd:element>
+      			<xsd:element ref="discovery-group" maxOccurs="1"
+      				minOccurs="0">
+      			</xsd:element>
+      			<xsd:element ref="message-flow" minOccurs="0"
+      				maxOccurs="unbounded">
+      			</xsd:element>
+      			<xsd:element name="scheduled-max-pool-size"
+      				type="xsd:int" maxOccurs="1" minOccurs="0">
+      				<xsd:annotation>
+      					<xsd:documentation>
+      						Maximum number of threads to use for
+      						scheduled deliveries
+      					</xsd:documentation>
+      				</xsd:annotation>
+      			</xsd:element>
+      			<xsd:element name="require-destinations"
+      				type="xsd:boolean" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="security-enabled"
+      				type="xsd:boolean" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="security-invalidation-interval"
+      				type="xsd:int" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="wild-card-routing-enabled"
+      				type="xsd:boolean" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="management-address"
+      				type="xsd:string" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="management-notification-address"
+      				type="xsd:string" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="jmx-management-enabled"
+      				type="xsd:boolean" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="message-counter-enabled"
+      				type="xsd:boolean" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="connection-scan-period"
+      				type="xsd:long" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+                <xsd:element name="connection-ttl-override"
+                    type="xsd:long" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+      			<xsd:element name="transaction-timeout"
+      				type="xsd:long" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="transaction-timeout-scan-period"
+      				type="xsd:long" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="message-expiry-scan-period"
+      				type="xsd:long" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="message-expiry-thread-priority"
+      				type="xsd:int" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+                <xsd:element name="id-cache-size"
+                    type="xsd:int" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="persist-id-cache"
+                    type="xsd:int" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+      			<xsd:element ref="remoting-interceptors" maxOccurs="1"
+      				minOccurs="0">
+      			</xsd:element>
+                <xsd:element name="queue-activation-timeout"
+                    type="xsd:long" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+      			<xsd:element name="backup" type="xsd:boolean" maxOccurs="1" minOccurs="0"></xsd:element>
+      			<xsd:element name="backup-connector-ref"
+      				type="backup-connectorType" maxOccurs="1" minOccurs="0">
+      			</xsd:element>
+      			<xsd:element name="connector" type="connectorType"
+      				minOccurs="0" maxOccurs="unbounded">
+      			</xsd:element>
+      			<xsd:element name="acceptor" type="acceptorType" minOccurs="1" maxOccurs="unbounded"></xsd:element>
+      			<xsd:element name="paging-max-threads"
+                    type="xsd:int" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="paging-directory"
+                    type="xsd:string" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="paging-default-size"
+                    type="xsd:long" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="paging-max-global-size-bytes"
+                    type="xsd:long" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="bindings-directory"
+                    type="xsd:string" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="create-bindings-dir"
+                    type="xsd:boolean" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="journal-directory"
+                    type="xsd:string" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="create-journal-dir"
+                    type="xsd:boolean" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="journal-type"
+                    type="journalType" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="journal-buffer-reuse-size"
+                    type="xsd:int" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="journal-sync-transactional"
+                    type="xsd:boolean" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="journal-sync-non-transactional"
+                    type="xsd:boolean" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="journal-file-size"
+                    type="xsd:long" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="journal-min-files"
+                    type="xsd:int" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="journal-max-aio"
+                    type="xsd:int" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+                <xsd:element name="large-messages-directory"
+                    type="xsd:string" maxOccurs="1" minOccurs="0">
+                </xsd:element>
+        	</xsd:sequence>
+      </xsd:complexType>
+   </xsd:element>
+
+   <xsd:element name="clustered" type="xsd:boolean">
+   </xsd:element>
+
+
+
+    <xsd:element name="local-bind-address" type="xsd:string"></xsd:element>
+
+    <xsd:element name="local-bind-port" type="xsd:int"></xsd:element>
+
+    <xsd:element name="group-address" type="xsd:string"></xsd:element>
+
+    <xsd:element name="group-port" type="xsd:int"></xsd:element>
+
+    <xsd:element name="broadcast-period" type="xsd:int"></xsd:element>
+
+    <xsd:element name="connector-ref" type="connector-refType">
+    </xsd:element>
+
+    <xsd:element name="broadcast-group">
+    	<xsd:complexType>
+    		<xsd:sequence>
+    			<xsd:element ref="local-bind-address" maxOccurs="1"
+    				minOccurs="1">
+    			</xsd:element>
+    			<xsd:element ref="local-bind-port" maxOccurs="1"
+    				minOccurs="1">
+    			</xsd:element>
+    			<xsd:element ref="group-address" maxOccurs="1"
+                    minOccurs="1"></xsd:element>
+    			<xsd:element ref="group-port" maxOccurs="1"
+                    minOccurs="1"></xsd:element>
+    			<xsd:element ref="broadcast-period" maxOccurs="1"
+                    minOccurs="1"></xsd:element>
+    			<xsd:element ref="connector-ref" maxOccurs="1"
+    				minOccurs="1">
+    			</xsd:element>
+    		</xsd:sequence>
+    		<xsd:attribute name="name" type="xsd:ID" use="required"></xsd:attribute>
+    	</xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="refresh-timeout" type="xsd:long"></xsd:element>
+
+    <xsd:element name="discovery-group">
+    	<xsd:complexType>
+    		<xsd:sequence>
+    			<xsd:element ref="group-address" maxOccurs="1"
+                    minOccurs="1"></xsd:element>
+    			<xsd:element ref="group-port" maxOccurs="1"
+                    minOccurs="1"></xsd:element>
+    			<xsd:element ref="refresh-timeout" maxOccurs="1"
+                    minOccurs="1"></xsd:element>
+    		</xsd:sequence>
+    		<xsd:attribute name="name" type="xsd:ID" use="required"></xsd:attribute>
+    	</xsd:complexType>
+    </xsd:element>
+    
+        <xsd:element name="message-flow">
+        <xsd:complexType>
+        	<xsd:sequence>
+                <xsd:element name="address" type="xsd:string"></xsd:element>
+                <xsd:choice>
+                    <xsd:element ref="discovery-group-ref" minOccurs="1" maxOccurs="1"></xsd:element>
+                    <xsd:element ref="connector-ref" minOccurs="1" maxOccurs="unbounded"></xsd:element>
+                </xsd:choice>
+                <xsd:element name="exclusive" type="xsd:boolean" minOccurs="0" maxOccurs="1">
+        		</xsd:element>
+            </xsd:sequence>
+        	<xsd:attribute name="name" type="xsd:ID" use="required"></xsd:attribute>
+        </xsd:complexType>
+        </xsd:element>
+
+        <xsd:element name="discovery-group-ref">
+        	<xsd:complexType>
+        		<xsd:attribute name="discovery-group-name" type="xsd:IDREF"></xsd:attribute>
+        	</xsd:complexType>
+        </xsd:element>
+
+        <xsd:complexType name="connector-refType">
+        	<xsd:attribute name="connector-name" type="xsd:IDREF" use="required"></xsd:attribute>
+        	<xsd:attribute name="backup-connector-name" type="xsd:IDREF" use="optional"></xsd:attribute>
+        </xsd:complexType>
+
+        <xsd:element name="remoting-interceptors">
+        	<xsd:complexType>
+        		<xsd:sequence>
+        			<xsd:element name="class-name" type="xsd:string" maxOccurs="unbounded" minOccurs="1"></xsd:element>
+        		</xsd:sequence>
+        	</xsd:complexType>
+        </xsd:element>
+
+        <xsd:complexType name="paramType">
+        	<xsd:attribute name="key" type="xsd:string" use="required"></xsd:attribute>
+        <xsd:attribute name="value" type="xsd:string" use="required"></xsd:attribute>
+        <xsd:attribute name="type" use="required">
+        		<xsd:simpleType>
+        			<xsd:restriction base="xsd:string">
+        				<xsd:enumeration value="String"></xsd:enumeration>
+        				<xsd:enumeration value="Integer"></xsd:enumeration>
+        				<xsd:enumeration value="Long"></xsd:enumeration>
+        				<xsd:enumeration value="Boolean"></xsd:enumeration>
+        				<xsd:enumeration value="Float"></xsd:enumeration>
+        				<xsd:enumeration value="Double"></xsd:enumeration>
+        			</xsd:restriction>
+        		</xsd:simpleType>
+        	</xsd:attribute>
+        </xsd:complexType>
+
+    <xsd:complexType name="connectorType">
+                    <xsd:sequence>
+                    <xsd:element name="factory-class"
+                        type="xsd:string" minOccurs="1" maxOccurs="1">
+                    </xsd:element>
+                    <xsd:element name="param" type="paramType" maxOccurs="unbounded" minOccurs="0"></xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="name" type="xsd:ID" use="required"></xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="acceptorType">
+                    <xsd:sequence>
+                    <xsd:element name="factory-class"
+                        type="xsd:string" minOccurs="1" maxOccurs="1">
+                    </xsd:element>
+                    <xsd:element name="param" type="paramType" maxOccurs="unbounded" minOccurs="0"></xsd:element>
+                </xsd:sequence>
+                <xsd:attribute name="name" type="xsd:string" use="optional"></xsd:attribute>
+    </xsd:complexType>
+
+
+    <xsd:simpleType name="journalType">
+    	<xsd:restriction base="xsd:string">
+    		<xsd:enumeration value="ASYNCIO"></xsd:enumeration>
+    		<xsd:enumeration value="NIO"></xsd:enumeration>
+    	</xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:complexType name="backup-connectorType">
+    	<xsd:attribute name="connector-name" type="xsd:IDREF" use="required"></xsd:attribute>
+    </xsd:complexType>
+</xsd:schema>

Added: trunk/src/schemas/jbm-jms.xsd
===================================================================
--- trunk/src/schemas/jbm-jms.xsd	                        (rev 0)
+++ trunk/src/schemas/jbm-jms.xsd	2009-01-20 09:04:09 UTC (rev 5665)
@@ -0,0 +1,112 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+   targetNamespace="urn:jboss:messaging-jms"
+   xmlns="urn:jboss:messaging-jms"
+   elementFormDefault="qualified"
+   attributeFormDefault="unqualified"
+   version="1.0">
+   
+   <xsd:element name="deployment">
+   	<xsd:complexType>
+   		<xsd:sequence>
+   			<xsd:element ref="connection-factory"
+   				maxOccurs="unbounded" minOccurs="1">
+   			</xsd:element>
+   			<xsd:choice maxOccurs="unbounded" minOccurs="1">
+   				<xsd:element ref="queue" maxOccurs="1"
+   					minOccurs="1">
+   				</xsd:element>
+   				<xsd:element ref="topic" maxOccurs="1" minOccurs="1"></xsd:element>
+   			</xsd:choice>
+   		</xsd:sequence>
+   	</xsd:complexType>
+   </xsd:element>
+
+   <xsd:element name="connection-factory">
+   	<xsd:complexType>
+   		<xsd:sequence>
+            <xsd:choice>
+            	<xsd:element ref="connector-ref" maxOccurs="1"
+            		minOccurs="1">
+            	</xsd:element>
+            	<xsd:element name="discovery-group-ref" type="discovery-group-refType" maxOccurs="1" minOccurs="1"></xsd:element>
+            </xsd:choice>
+            <xsd:element name="entry" type="entryType"
+   				maxOccurs="unbounded" minOccurs="1">
+   			</xsd:element>
+   			<xsd:element name="ping-period" type="xsd:long"
+   				maxOccurs="1" minOccurs="0">
+   			</xsd:element>
+            <xsd:element name="call-timeout" type="xsd:long"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="client-id" type="xsd:string"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="dups-ok-batch-size" type="xsd:long"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="transaction-batch-size" type="xsd:long"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="producer-window-size" type="xsd:long"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="producer-max-rate" type="xsd:int"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="consumer-window-size" type="xsd:long"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="consumer-max-rate" type="xsd:int"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="block-on-acknowledge" type="xsd:boolean"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="send-np-messages-synchronously" type="xsd:boolean"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="send-p-messages-synchronously" type="xsd:boolean"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="auto-group-id" type="xsd:boolean"
+                maxOccurs="1" minOccurs="0">
+            </xsd:element>
+   			<xsd:element name="pre-acknowledge" type="xsd:boolean"
+   				maxOccurs="1" minOccurs="0">
+   			</xsd:element>
+   		</xsd:sequence>
+   		<xsd:attribute name="name" type="xsd:string"></xsd:attribute>
+   	</xsd:complexType>
+   </xsd:element>
+
+    <xsd:element name="connector-ref" type="connector-refType"></xsd:element>
+
+    <xsd:complexType name="connector-refType">
+    	<xsd:attribute name="connector-name" type="xsd:string" use="required"></xsd:attribute>
+    	<xsd:attribute name="backup-connector-name" type="xsd:string" use="optional"></xsd:attribute>
+    </xsd:complexType>
+    
+    <xsd:complexType name="entryType">
+    	<xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:complexType name="discovery-group-refType">
+    	<xsd:attribute name="discovery-group-name" type="xsd:string" use="required"></xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="queue" type="destinationType"></xsd:element>
+
+
+    
+    <xsd:complexType name="destinationType">
+    	<xsd:sequence>
+    		<xsd:element name="entry" type="entryType" maxOccurs="1" minOccurs="1"></xsd:element>
+    	</xsd:sequence>
+    	<xsd:attribute name="name" type="xsd:ID" use="required"></xsd:attribute>
+    </xsd:complexType>
+
+    <xsd:element name="topic" type="destinationType"></xsd:element>
+</xsd:schema>

Added: trunk/src/schemas/jbm-security.xsd
===================================================================
--- trunk/src/schemas/jbm-security.xsd	                        (rev 0)
+++ trunk/src/schemas/jbm-security.xsd	2009-01-20 09:04:09 UTC (rev 5665)
@@ -0,0 +1,33 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+   targetNamespace="urn:jboss:messaging-security"
+   xmlns="urn:jboss:messaging-security"
+   elementFormDefault="qualified"
+   attributeFormDefault="unqualified"
+   version="1.0">
+   
+   <xsd:element name="deployment">
+   	<xsd:complexType>
+   		<xsd:sequence>
+   			<xsd:element ref="user" maxOccurs="unbounded" minOccurs="0"></xsd:element>
+   		</xsd:sequence>
+   	</xsd:complexType>
+   </xsd:element>
+
+   <xsd:element name="role">
+   	<xsd:complexType>
+   		<xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
+   	</xsd:complexType>
+   </xsd:element>
+
+   <xsd:element name="user">
+   	<xsd:complexType>
+   		<xsd:sequence>
+   			<xsd:element ref="role" maxOccurs="unbounded" minOccurs="1"></xsd:element>
+   		</xsd:sequence>
+   		<xsd:attribute name="name" type="xsd:ID" use="required"></xsd:attribute>
+   		<xsd:attribute name="password" type="xsd:string"></xsd:attribute>
+   	</xsd:complexType>
+   </xsd:element>
+</xsd:schema>

Added: trunk/src/schemas/queues.xsd
===================================================================
--- trunk/src/schemas/queues.xsd	                        (rev 0)
+++ trunk/src/schemas/queues.xsd	2009-01-20 09:04:09 UTC (rev 5665)
@@ -0,0 +1,71 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+   targetNamespace="urn:jboss:messaging-queues"
+   xmlns="urn:jboss:messaging-queues"
+   elementFormDefault="qualified"
+   attributeFormDefault="unqualified"
+   version="1.0">
+   
+   <xsd:element name="deployment">
+   	<xsd:complexType>
+   		<xsd:sequence>
+   			<xsd:element ref="security" maxOccurs="unbounded"
+   				minOccurs="0">
+   			</xsd:element>
+   			<xsd:element ref="queue-settings" maxOccurs="unbounded" minOccurs="0"></xsd:element>
+   		</xsd:sequence>
+   	</xsd:complexType>
+   </xsd:element>
+
+   <xsd:element name="permission">
+   	<xsd:complexType>
+   		<xsd:attribute name="type" type="xsd:string" use="required"></xsd:attribute>
+   		<xsd:attribute name="roles" type="xsd:string" use="required"></xsd:attribute>
+   	</xsd:complexType>
+   </xsd:element>
+
+   <xsd:element name="security">
+   	<xsd:complexType>
+   		<xsd:sequence>
+   			<xsd:element ref="permission" maxOccurs="unbounded" minOccurs="1"></xsd:element>
+   		</xsd:sequence>
+            <xsd:attribute name="match" type="xsd:string" use="required"></xsd:attribute>
+        </xsd:complexType>
+   </xsd:element>
+
+   <xsd:element name="queue-settings" type="queue-settingsType"></xsd:element>
+
+   <xsd:complexType name="queue-settingsType">
+   	<xsd:sequence>
+        <xsd:element name="clustered" type="xsd:boolean"
+            maxOccurs="1" minOccurs="0">
+        </xsd:element>
+   		<xsd:element name="dead-letter-address" type="xsd:string"
+   			maxOccurs="1" minOccurs="0">
+   		</xsd:element>
+        <xsd:element name="expiry-address" type="xsd:string"
+            maxOccurs="1" minOccurs="0">
+        </xsd:element>
+        <xsd:element name="redelivery-delay" type="xsd:long"
+            maxOccurs="1" minOccurs="0">
+        </xsd:element>
+        <xsd:element name="max-size-bytes" type="xsd:long"
+            maxOccurs="1" minOccurs="0">
+        </xsd:element>
+        <xsd:element name="page-size-bytes" type="xsd:long"
+            maxOccurs="1" minOccurs="0">
+        </xsd:element>
+        <xsd:element name="drop-messages-when-full" type="xsd:boolean"
+            maxOccurs="1" minOccurs="0">
+        </xsd:element>
+        <xsd:element name="distribution-policy-class" type="xsd:string"
+            maxOccurs="1" minOccurs="0">
+        </xsd:element>
+        <xsd:element name="message-counter-history-day-limit" type="xsd:int"
+            maxOccurs="1" minOccurs="0">
+        </xsd:element>
+   	</xsd:sequence>
+   	<xsd:attribute name="match" type="xsd:string" use="required"></xsd:attribute>
+   </xsd:complexType>
+</xsd:schema>

Modified: trunk/tests/config/ConfigurationTest-config.xml
===================================================================
--- trunk/tests/config/ConfigurationTest-config.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/tests/config/ConfigurationTest-config.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,25 +1,24 @@
-<deployment>
+<deployment xmlns="urn:jboss:messaging-configuration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:messaging-configuration ../../src/schemas/jbm-configuration.xsd ">
    <configuration>
       <clustered>true</clustered>
-      <backup>true</backup>
-      <queue-activation-timeout>12456</queue-activation-timeout>
       <scheduled-max-pool-size>12345</scheduled-max-pool-size>        
       <require-destinations>false</require-destinations>
       <security-enabled>false</security-enabled>
       <security-invalidation-interval>5423</security-invalidation-interval>
       <wild-card-routing-enabled>true</wild-card-routing-enabled>
-      <call-timeout>7654</call-timeout>    
-      <packet-confirmation-batch-size>543</packet-confirmation-batch-size>
+      <management-address>Giraffe</management-address>
       <connection-scan-period>6543</connection-scan-period>
       <transaction-timeout>98765</transaction-timeout>
       <transaction-timeout-scan-period>56789</transaction-timeout-scan-period>
       <message-expiry-scan-period>10111213</message-expiry-scan-period>
       <message-expiry-thread-priority>8</message-expiry-thread-priority>
-      <management-address>Giraffe</management-address>
       <remoting-interceptors>
          <class-name>org.jboss.messaging.tests.unit.core.config.impl.TestInterceptor1</class-name>
          <class-name>org.jboss.messaging.tests.unit.core.config.impl.TestInterceptor2</class-name>
       </remoting-interceptors>
+      <queue-activation-timeout>12456</queue-activation-timeout>
+      <backup>true</backup>
+      <backup-connector-ref connector-name="backup-connector"/>
       <connector name="backup-connector">
          <factory-class>org.jboss.messaging.tests.unit.core.config.impl.TestConnectorFactory1</factory-class>
          <param key="c_mykey1" value="c_foovalue1" type="String"/>
@@ -27,7 +26,6 @@
          <param key="c_mykey3" value="60" type="Integer"/>
          <param key="c_mykey4" value="c_foovalue4" type="String"/>      
       </connector>
-      <backup-connector-ref connector-name="backup-connector"/>
       <acceptor>
          <factory-class>org.jboss.messaging.tests.unit.core.config.impl.TestAcceptorFactory1</factory-class>           
          <param key="a_mykey1" value="a_foovalue1" type="String"/>
@@ -52,8 +50,6 @@
       <journal-file-size>12345678</journal-file-size>
       <journal-min-files>100</journal-min-files>
       <journal-max-aio>56546</journal-max-aio>
-      <journal-aio-timeout>432323</journal-aio-timeout>
-      <journal-task-period>6544</journal-task-period>      
    </configuration>
 
 </deployment>
\ No newline at end of file

Modified: trunk/tests/config/ConfigurationTest-config2.xml
===================================================================
--- trunk/tests/config/ConfigurationTest-config2.xml	2009-01-20 01:38:41 UTC (rev 5664)
+++ trunk/tests/config/ConfigurationTest-config2.xml	2009-01-20 09:04:09 UTC (rev 5665)
@@ -1,5 +1,9 @@
-<deployment>
+<deployment xmlns="urn:jboss:messaging-configuration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:messaging-configuration ../../src/schemas/jbm-configuration.xsd ">
    <configuration>
-     <!-- just use all the defaults -->              
+     <!-- just use all the defaults -->
+     <!--  we must declare at least one acceptor to have a valid configuration -->
+     <acceptor>
+        <factory-class>org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
+     </acceptor>   
    </configuration>
 </deployment>
\ No newline at end of file

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-20 01:38:41 UTC (rev 5664)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/XMLDeployerTest.java	2009-01-20 09:04:09 UTC (rev 5665)
@@ -226,6 +226,11 @@
          return "test";
       }
 
+      @Override
+      public void validate(Node rootNode) throws Exception
+      {
+      }
+
       public void deploy(Node node) throws Exception
       {
          deployments++;




More information about the jboss-cvs-commits mailing list