[jboss-svn-commits] JBL Code SVN: r22234 - in labs/jbossesb/workspace/skeagh: api/service/src/main/java/org/jboss/esb/annotations and 8 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Aug 29 09:27:31 EDT 2008


Author: tfennelly
Date: 2008-08-29 09:27:31 -0400 (Fri, 29 Aug 2008)
New Revision: 22234

Added:
   labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/
   labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/ClassUtilTest.java
   labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/MyAnnotation.java
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DeploymentLifecycleTest.java
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyResource.java
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-deploy-01.xml
Removed:
   labs/jbossesb/workspace/skeagh/api/service/src/main/java/org/jboss/esb/annotations/Inject.java
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/Deployment.java
Modified:
   labs/jbossesb/workspace/skeagh/commons/src/main/java/org/jboss/esb/classpath/ClassUtil.java
   labs/jbossesb/workspace/skeagh/jbossesb_checkstyle_checks.xml
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ConfigurationUnit.java
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterConfig.java
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/OutboundRouterConfig.java
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/ConfigurationDigester.java
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/DefaultConfigurationDigester.java
   labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/inrouters-smooks.xml
   labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd
   labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/outrouters-smooks.xml
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyInRouter.java
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyMessageTransformer.java
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyOutRouter.java
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyTestService.java
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-02.xml
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inandoutrouters_01.xml
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_01.xml
   labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-outrouters_01.xml
Log:
Deployment runtime .  
Deployment Object lifecycle management (services, routers, resources).

Deleted: labs/jbossesb/workspace/skeagh/api/service/src/main/java/org/jboss/esb/annotations/Inject.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/service/src/main/java/org/jboss/esb/annotations/Inject.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/api/service/src/main/java/org/jboss/esb/annotations/Inject.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.esb.annotations;
-
-import java.lang.annotation.*;
-
-/**
- * Field value injection annotation.
- * <p/>
- * Used on component implementations to flag a field definition for value injection.
- * Supported for:
- * <ul>
- *  <li>Injection of the components configuration.</li>
- *  <li>Injection of some of the core runtime contexts etc.</li>
- * </ul>
- *
- * <h3>Examples</h3>
- * <i>Configuration injection on an InboundRouter</i>:
- * <pre>
- * public class MyRouter implements InboundRouter {
- *
- *     &#x40;Inject
- *     private MyRouterConfig myRouterConfig;
- *
- *     ....
- * }
- * </pre>
- * <i>On an InboundRouter Implementation</i>:
- * <pre>
- * public class MyRouter implements InboundRouter {
- * 
- *     &#x40;Inject
- *     private DeploymentContext deploymentContext;
- *
- *     ....
- * }
- * </pre>
- * <i>On an Service Implementation</i>:
- * <pre>
- * public class MyService implements Service {
- *
- *     &#x40;Inject
- *     private DeploymentContext deploymentContext;
- *
- *     ....
- * }
- * </pre>
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
- at Documented
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ ElementType.FIELD })
-public @interface Inject
-{
-}

Modified: labs/jbossesb/workspace/skeagh/commons/src/main/java/org/jboss/esb/classpath/ClassUtil.java
===================================================================
--- labs/jbossesb/workspace/skeagh/commons/src/main/java/org/jboss/esb/classpath/ClassUtil.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/commons/src/main/java/org/jboss/esb/classpath/ClassUtil.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -24,6 +24,10 @@
 import org.apache.log4j.Logger;
 
 import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.lang.reflect.Proxy;
 
 /**
@@ -195,4 +199,134 @@
     {
         return "/" + packageObj.getName().replace('.', '/');
     }
+
+    /**
+     * Execute all void, public, zero arg methods (on the supplied Object) that are
+     * annotated with the specified Annotation.
+     * <p/>
+     * This method iterates to the root of the supplied Objects inheritance
+     * hierarchy and then works back, executing the annotated methods at each
+     * level.
+     *
+     * @param objectInstance The Object to be processed.
+     * @param annotation     The annotation type.
+     * @throws InvocationTargetException See {@link Method#invoke(Object, Object[])}.
+     * @throws IllegalAccessException    See {@link Method#invoke(Object, Object[])}.
+     */
+    public static void execAnnotatedMethod(final Object objectInstance, final Class<? extends Annotation> annotation) throws InvocationTargetException, IllegalAccessException
+    {
+        execAnnotatedMethod(objectInstance, objectInstance.getClass(), annotation);
+    }
+
+    /**
+     * An internal version of {@link #execAnnotatedMethod(Object, Class)} that takes
+     * the hierarchy Class param and does the actual work.
+     *
+     * @param objectInstance The Object to be processed.
+     * @param hierarchyClass The hierarchy class.
+     * @param annotation     The annotation type.
+     * @throws InvocationTargetException See {@link Method#invoke(Object, Object[])}.
+     * @throws IllegalAccessException    See {@link Method#invoke(Object, Object[])}.
+     */
+    private static void execAnnotatedMethod(final Object objectInstance, final Class<? extends Object> hierarchyClass, final Class<? extends Annotation> annotation) throws InvocationTargetException, IllegalAccessException
+    {
+        Class superClass = hierarchyClass.getSuperclass();
+
+        // Work our way up to the root of the class inheritance hierarchy....
+        if (superClass != null)
+        {
+            execAnnotatedMethod(objectInstance, superClass, annotation);
+        }
+
+        // Execute the methods from this level in the hierarchy and then fall
+        // back up one level...
+        Method[] methods = hierarchyClass.getDeclaredMethods();
+        for (Method method : methods)
+        {
+            if (Modifier.isPublic(method.getModifiers()))
+            {
+                boolean isAnnotated = method.isAnnotationPresent(annotation);
+                boolean isZeroArg = (method.getParameterTypes().length == 0);
+                boolean isVoidReturn = method.getReturnType().isAssignableFrom(void.class);
+                boolean isOverriden = (findExecutingHierarchyClass(method, objectInstance.getClass()) != hierarchyClass);
+
+                // Must be annotated, have no args, return void and not be overriden...
+                if (isAnnotated && isZeroArg && isVoidReturn && !isOverriden)
+                {
+                    method.invoke(objectInstance);
+                }
+            }
+        }
+    }
+
+    /**
+     * Search the specified class hierarchy for the class that defines the specified method
+     * that will be executed.
+     * <p/>
+     * This method allows you to search for overriden versions of a method.
+     *
+     * @param method      The method to search for.
+     * @param searchClass The Class whose hierarchy is to be searched.
+     * @return The Class (from the hierarchy) that defines the version of the specified
+     *         method that will be executed by the VM at runtime.
+     */
+    private static Class<? extends Object> findExecutingHierarchyClass(final Method method, final Class<? extends Object> searchClass)
+    {
+        if (isMethodDeclared(method, searchClass))
+        {
+            return searchClass;
+        }
+
+        Class superClass = searchClass.getSuperclass();
+        if (superClass != null)
+        {
+            return findExecutingHierarchyClass(method, superClass);
+        }
+
+        return null;
+    }
+
+    /**
+     * Is the specified method declared on the specified Class.
+     *
+     * @param method   The method to check for.
+     * @param theClass The Class to check.
+     * @return True if the method is declared, otherwise false.
+     */
+    private static boolean isMethodDeclared(final Method method, final Class<? extends Object> theClass)
+    {
+        Method[] methods = theClass.getDeclaredMethods();
+
+        for (Method classMethod : methods)
+        {
+            if (Modifier.isPublic(classMethod.getModifiers()))
+            {
+                if (classMethod.getName().equals(method.getName()))
+                {
+                    if (!classMethod.getReturnType().equals(method.getReturnType()))
+                    {
+                        continue;
+                    }
+
+                    /* Avoid unnecessary cloning */
+                    Class[] params1 = classMethod.getParameterTypes();
+                    Class[] params2 = method.getParameterTypes();
+                    if (params1.length == params2.length)
+                    {
+                        for (int i = 0; i < params1.length; i++)
+                        {
+                            if (params1[i] != params2[i])
+                            {
+                                continue;
+                            }
+                        }
+
+                        return true;
+                    }
+                }
+            }
+        }
+
+        return false;
+    }
 }

Added: labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/ClassUtilTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/ClassUtilTest.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/ClassUtilTest.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.esb.classpath;
+
+import junit.framework.TestCase;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ClassUtilTest extends TestCase
+{
+
+    public void test_execAnnotatedMethod_no_inheritance() throws InvocationTargetException, IllegalAccessException
+    {
+        A a = new A();
+
+        ClassUtil.execAnnotatedMethod(a, MyAnnotation.class);
+        assertEquals("[A.aMethodWith]", a.called.toString());
+    }
+
+    public void test_execAnnotatedMethod_with_inheritance() throws InvocationTargetException, IllegalAccessException
+    {
+        B b = new B();
+
+        ClassUtil.execAnnotatedMethod(b, MyAnnotation.class);
+        // The annotated methods in the super class should be called first...
+        assertEquals("[A.aMethodWith, B.bMethodWith]", b.called.toString());
+    }
+
+    public void test_execAnnotatedMethod_with_inheritance_overriden() throws InvocationTargetException, IllegalAccessException
+    {
+        C c = new C();
+
+        ClassUtil.execAnnotatedMethod(c, MyAnnotation.class);
+        // The annotated methods in the super class should be called first,
+        // but only if the method is not overriden.  A.aMethodWith is overriden
+        // in C (C.aMethodWith), so it should not be called before B.bMethodWith...
+        assertEquals("[B.bMethodWith, C.aMethodWith]", c.called.toString());
+    }
+
+    private class A
+    {
+
+        public Set called = new LinkedHashSet();
+
+        @MyAnnotation
+        public void aMethodWith()
+        {
+            called.add("A.aMethodWith");
+        }
+
+        public void aMethodWithout()
+        {
+            called.add("A.aMethodWithout");
+        }
+
+        @MyAnnotation
+        protected void aMethodWith_butnotpublic()
+        {
+            called.add("A.aMethodWith_butnotpublic");
+        }
+
+        @MyAnnotation
+        public boolean aMethodWith_butnotvoid()
+        {
+            called.add("A.aMethodWith_butnotvoid");
+            return true;
+        }
+
+        @MyAnnotation
+        public void aMethodWith_butwithparam(int x)
+        {
+            called.add("A.aMethodWith_butwithparam");
+        }
+    }
+
+    private class B extends A
+    {
+
+        @MyAnnotation
+        public void bMethodWith()
+        {
+            called.add("B.bMethodWith");
+        }
+    }
+
+    private class C extends B
+    {
+
+        // Overriding the same method defined in the base class
+        @MyAnnotation
+        public void aMethodWith()
+        {
+            called.add("C.aMethodWith");
+        }
+    }
+}


Property changes on: labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/ClassUtilTest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/MyAnnotation.java
===================================================================
--- labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/MyAnnotation.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/MyAnnotation.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -0,0 +1,12 @@
+package org.jboss.esb.classpath;
+
+import java.lang.annotation.*;
+
+/**
+ * @author
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ ElementType.METHOD })
+public @interface MyAnnotation
+{
+}


Property changes on: labs/jbossesb/workspace/skeagh/commons/src/test/java/org/jboss/esb/classpath/MyAnnotation.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/workspace/skeagh/jbossesb_checkstyle_checks.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/jbossesb_checkstyle_checks.xml	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/jbossesb_checkstyle_checks.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -115,11 +115,11 @@
         <module name="TabCharacter"/>
         <module name="WhitespaceAfter">
             <property name="tokens"
-                      value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND, WILDCARD_TYPE"/>
+                      value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/>
         </module>
         <module name="WhitespaceAround">
             <property name="tokens"
-                      value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND, WILDCARD_TYPE"/>
+                      value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/>
         </module>
 
 

Deleted: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/Deployment.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/Deployment.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/Deployment.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.esb.deploy;
-
-import org.jboss.esb.context.DeploymentContext;
-import org.jboss.esb.util.AssertArgument;
-import org.jboss.esb.deploy.config.ConfigurationUnit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * JBoss ESB Deployment.
- * <p/>
- * Represents the basic JBoss ESB deployment unit.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class Deployment
-{
-    /**
-     * Deployment Context.
-     */
-    private DeploymentContext context;
-
-    /**
-     * The list of configurations associated with this deployment instance.
-     */
-    private List<ConfigurationUnit> configurationList = new ArrayList<ConfigurationUnit>();
-
-    /**
-     * Public default constructor.
-     */
-    public Deployment()
-    {
-        this.context = new DeploymentContext();
-    }
-
-    /**
-     * Get the {@link DeploymentContext} associated with this deployment.
-     *
-     * @return Depolyment Context.
-     */
-    public final DeploymentContext getContext()
-    {
-        return context;
-    }
-
-    /**
-     * Add a {@link ConfigurationUnit} to this Deployment.
-     *
-     * @param configuration Configuration Unit to be added.
-     */
-    public final void add(final ConfigurationUnit configuration)
-    {
-        AssertArgument.isNotNull(configuration, "configuration");
-        configurationList.add(configuration);
-    }
-
-    /**
-     * Deploy the Deployment.
-     *
-     * @throws DeploymentException Error deploying ESB Deployment.
-     */
-    public final void deploy() throws DeploymentException
-    {
-        assertConfigurationsAdded();
-
-        // TODO: implement...
-    }
-
-    /**
-     * Undeploy the Deployment.
-     *
-     * @throws DeploymentException Error undeploying ESB Deployment.
-     */
-    public final void undeploy() throws DeploymentException
-    {
-        // TODO: implement...
-    }
-
-    /**
-     * Assert whether or not ESB configurations have been added to this
-     * Deployment.
-     *
-     * @throws DeploymentException No configurations have been added to this deployment.
-     */
-    private void assertConfigurationsAdded() throws DeploymentException
-    {
-        if (!configurationList.isEmpty())
-        {
-            throw new DeploymentException("Deployment not yet configured.  Unable to deploy.");
-        }
-    }
-}

Copied: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java (from rev 21885, labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/Deployment.java)
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -0,0 +1,354 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.esb.deploy;
+
+import org.apache.log4j.Logger;
+import org.jboss.esb.annotations.Initialize;
+import org.jboss.esb.annotations.Uninitialize;
+import org.jboss.esb.classpath.ClassUtil;
+import org.jboss.esb.context.DeploymentContext;
+import org.jboss.esb.deploy.config.ConfigurationUnit;
+import org.jboss.esb.deploy.config.InboundRouterConfig;
+import org.jboss.esb.deploy.config.OutboundRouterConfig;
+import org.jboss.esb.deploy.config.ServiceConfig;
+import org.jboss.esb.message.MessageTransformer;
+import org.jboss.esb.service.ServiceName;
+import org.jboss.esb.util.AssertArgument;
+
+import java.util.*;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * JBoss ESB Runtime.
+ * <p/>
+ * Represents the basic JBoss ESB deployment runtime, managing the deployment
+ * of a set of resources, routers and services.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class DeploymentRuntime
+{
+    /**
+     * Class logger.
+     */
+    private static Logger logger = Logger.getLogger(DeploymentRuntime.class);
+
+    /**
+     * Deployment Context.
+     */
+    private DeploymentContext context;
+    /**
+     * Deployment Name.
+     */
+    private String deploymentName;
+    /**
+     * The list of configurations associated with this deployment instance.
+     */
+    private List<ConfigurationUnit> configurationUnits = new ArrayList<ConfigurationUnit>();
+    /**
+     * Deployed Objects Map.
+     */
+    private Map<Object, Object> deployedObjects = new LinkedHashMap<Object, Object>();
+
+    /**
+     * Public default constructor.
+     */
+    public DeploymentRuntime()
+    {
+        this.context = new DeploymentContext();
+    }
+
+    /**
+     * Get the deployment name.
+     *
+     * @return The deployment name.
+     */
+    public final String getDeploymentName()
+    {
+        return deploymentName;
+    }
+
+    /**
+     * Set the deployment name.
+     *
+     * @param deploymentName The deployment name.
+     */
+    public final void setDeploymentName(final String deploymentName)
+    {
+        this.deploymentName = deploymentName;
+    }
+
+    /**
+     * Get the deployment configuration units.
+     *
+     * @return The deployment configuration units.
+     */
+    public final List<ConfigurationUnit> getConfigurationUnits()
+    {
+        return configurationUnits;
+    }
+
+    /**
+     * Set the deployment configuration units.
+     *
+     * @param configurationUnits The deployment configuration units.
+     */
+    public final void setConfigurationUnits(final List<ConfigurationUnit> configurationUnits)
+    {
+        this.configurationUnits = configurationUnits;
+    }
+
+    /**
+     * Get the {@link DeploymentContext} associated with this deployment.
+     *
+     * @return Depolyment Context.
+     */
+    public final DeploymentContext getContext()
+    {
+        return context;
+    }
+
+    /**
+     * Add a {@link ConfigurationUnit} to this Runtime.
+     *
+     * @param configuration Configuration Unit to be added.
+     */
+    public final void add(final ConfigurationUnit configuration)
+    {
+        AssertArgument.isNotNull(configuration, "configuration");
+        configurationUnits.add(configuration);
+    }
+
+    /**
+     * Deploy the Runtime.
+     *
+     * @throws org.jboss.esb.deploy.DeploymentException
+     *          Error deploying ESB Runtime.
+     */
+    public final void deploy() throws DeploymentException
+    {
+        assertConfigurationsAdded();
+
+        try
+        {
+            // Deploy everything in order...
+            deployResources();
+            deployOutboundRouters();
+            deployServices();
+            deployInboundRouters();
+        } catch (DeploymentException e)
+        {
+            undeploy();
+            throw e;
+        } catch (Throwable t)
+        {
+            undeploy();
+            throw new DeploymentException("Unexpected deployment error.", t);
+        }
+    }
+
+    /**
+     * Undeploy the Runtime.
+     *
+     * @throws DeploymentException Error undeploying ESB Runtime.
+     */
+    public final void undeploy() throws DeploymentException
+    {
+        if (!deployedObjects.isEmpty())
+        {
+            Map.Entry<Object, Object> deploymentSet[] = new Map.Entry[deployedObjects.size()];
+
+            deployedObjects.entrySet().toArray(deploymentSet);
+            for (int i = deploymentSet.length - 1; i >= 0; i--)
+            {
+                try
+                {
+                    ClassUtil.execAnnotatedMethod(deploymentSet[i].getValue(), Uninitialize.class);
+                } catch (Throwable t)
+                {
+                    logger.debug("Error while undeploying '" + deploymentSet[i].getKey() + "' (" + deploymentSet[i].getValue().getClass().getName() + ").");
+                }
+            }
+        }
+    }
+
+    /**
+     * Deploy all resources.
+     *
+     * @throws DeploymentException Error deploying a resource.
+     */
+    private void deployResources() throws DeploymentException
+    {
+        for (ConfigurationUnit configurationUnit : configurationUnits)
+        {
+            Map<String, Object> resourceMap = configurationUnit.getResources();
+            Set<Map.Entry<String, Object>> resources = resourceMap.entrySet();
+
+            for (Map.Entry<String, Object> resource : resources)
+            {
+                try
+                {
+                    ClassUtil.execAnnotatedMethod(resource.getValue(), Initialize.class);
+                    logger.debug("Deployed resource '" + resource.getKey() + "' (" + resource.getValue().getClass().getName() + ").");
+                    deployedObjects.put(resource.getKey(), resource.getValue());
+                } catch (InvocationTargetException e)
+                {
+                    throw new DeploymentException("Unable to deploy resource '" + resource.getKey() + "' (" + resource.getValue().getClass().getName() + ").", e.getCause());
+                } catch (Exception e)
+                {
+                    throw new DeploymentException("Unable to deploy resource '" + resource.getKey() + "' (" + resource.getValue().getClass().getName() + ").", e);
+                }
+            }
+        }
+    }
+
+    /**
+     * Deploy all Services.
+     *
+     * @throws DeploymentException Error deploying a Service.
+     */
+    private void deployServices() throws DeploymentException
+    {
+        for (ConfigurationUnit configurationUnit : configurationUnits)
+        {
+            Map<ServiceName, ServiceConfig> serviceMap = configurationUnit.getServices();
+            Set<Map.Entry<ServiceName, ServiceConfig>> services = serviceMap.entrySet();
+
+            for (Map.Entry<ServiceName, ServiceConfig> service : services)
+            {
+                try
+                {
+                    ClassUtil.execAnnotatedMethod(service.getValue().getService(), Initialize.class);
+                    logger.debug("Deployed service '" + service.getKey() + "' (" + service.getValue().getClass().getName() + ").");
+                    deployedObjects.put(service.getKey(), service.getValue().getService());
+                } catch (InvocationTargetException e)
+                {
+                    throw new DeploymentException("Unable to deploy service '" + service.getKey() + "' (" + service.getValue().getService().getClass().getName() + ").", e.getCause());
+                } catch (Exception e)
+                {
+                    throw new DeploymentException("Unable to deploy service '" + service.getKey() + "' (" + service.getValue().getService().getClass().getName() + ").", e);
+                }
+            }
+        }
+    }
+
+    private void deployInboundRouters() throws DeploymentException
+    {
+        for (ConfigurationUnit configurationUnit : configurationUnits)
+        {
+            Map<ServiceName, List<InboundRouterConfig>> routerMap = configurationUnit.getInboundRouters();
+            Set<Map.Entry<ServiceName, List<InboundRouterConfig>>> routers = routerMap.entrySet();
+
+            for (Map.Entry<ServiceName, List<InboundRouterConfig>> routerConfigMap : routers)
+            {
+                List<InboundRouterConfig> routerList = routerConfigMap.getValue();
+                for (InboundRouterConfig routerConfig : routerList)
+                {
+                    try
+                    {
+                        // Deploy the transformers first...
+                        deployTransformers(routerConfig.getTransformers(), routerConfig.getName());
+
+                        // Now deploy the router...
+                        ClassUtil.execAnnotatedMethod(routerConfig.getRouter(), Initialize.class);
+                        logger.debug("Deployed InboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").");
+                        deployedObjects.put(routerConfig.getName(), routerConfig.getRouter());
+                    } catch (InvocationTargetException e)
+                    {
+                        throw new DeploymentException("Unable to deploy InboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").", e.getCause());
+                    } catch (Exception e)
+                    {
+                        throw new DeploymentException("Unable to deploy InboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").", e);
+                    }
+                }
+            }
+        }
+    }
+
+    private void deployOutboundRouters() throws DeploymentException
+    {
+        for (ConfigurationUnit configurationUnit : configurationUnits)
+        {
+            Map<ServiceName, List<OutboundRouterConfig>> routerMap = configurationUnit.getOutboundRouters();
+            Set<Map.Entry<ServiceName, List<OutboundRouterConfig>>> routers = routerMap.entrySet();
+
+            for (Map.Entry<ServiceName, List<OutboundRouterConfig>> routerConfigMap : routers)
+            {
+                List<OutboundRouterConfig> routerList = routerConfigMap.getValue();
+                for (OutboundRouterConfig routerConfig : routerList)
+                {
+                    try
+                    {
+                        // Deploy the transformers first...
+                        deployTransformers(routerConfig.getTransformers(), routerConfig.getName());
+
+                        // Now deploy the router...
+                        ClassUtil.execAnnotatedMethod(routerConfig.getRouter(), Initialize.class);
+                        logger.debug("Deployed OutboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").");
+                        deployedObjects.put(routerConfig.getName(), routerConfig.getRouter());
+                    } catch (InvocationTargetException e)
+                    {
+                        throw new DeploymentException("Unable to deploy OutboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").", e.getCause());
+                    } catch (Exception e)
+                    {
+                        throw new DeploymentException("Unable to deploy OutboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").", e);
+                    }
+                }
+            }
+        }
+    }
+
+    private void deployTransformers(List<MessageTransformer> transformers, String routerConfigName) throws DeploymentException
+    {
+        if (transformers != null)
+        {
+            for (MessageTransformer transformer : transformers)
+            {
+                try
+                {
+                    ClassUtil.execAnnotatedMethod(transformer, Initialize.class);
+                    logger.debug("Deployed transformer for router '" + routerConfigName + "' (" + transformer.getClass().getName() + ").");
+                    deployedObjects.put(transformer, transformer);
+                } catch (InvocationTargetException e)
+                {
+                    throw new DeploymentException("Unable to deploy transformer for router '" + routerConfigName + "' (" + transformer.getClass().getName() + ").", e.getCause());
+                } catch (Exception e)
+                {
+                    throw new DeploymentException("Unable to deploy transformer for router '" + routerConfigName + "' (" + transformer.getClass().getName() + ").", e);
+                }
+            }
+        }
+    }
+
+    /**
+     * Assert whether or not ESB configurations have been added to this
+     * Runtime.
+     *
+     * @throws DeploymentException No configurations have been added to this deployment.
+     */
+    private void assertConfigurationsAdded() throws DeploymentException
+    {
+        if (configurationUnits.isEmpty())
+        {
+            throw new DeploymentException("DeploymentRuntime not yet configured.  Unable to deploy.");
+        }
+    }
+}


Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ConfigurationUnit.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ConfigurationUnit.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ConfigurationUnit.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -31,7 +31,7 @@
 import java.util.ArrayList;
 
 /**
- * JBoss ESB Configuration Unit.
+ * JBoss ESB Deployment Configuration Unit.
  *
  * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
  */

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterConfig.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterConfig.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterConfig.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -32,6 +32,10 @@
 public class InboundRouterConfig
 {
     /**
+     * Router config name.
+     */
+    private String name;
+    /**
      * Router instance.
      */
     private InboundRouter router;
@@ -41,6 +45,26 @@
     private List<MessageTransformer> transformers;
 
     /**
+     * Get the router configuration name.
+     *
+     * @return The router configuration name.
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * Set the router configuration name.
+     *
+     * @param name The router configuration name.
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
      * Get router instance.
      *
      * @return The router instance.

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/OutboundRouterConfig.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/OutboundRouterConfig.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/OutboundRouterConfig.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -33,6 +33,10 @@
 public class OutboundRouterConfig
 {
     /**
+     * Router config name.
+     */
+    private String name;
+    /**
      * Router instance.
      */
     private OutboundRouter router;
@@ -42,6 +46,26 @@
     private List<MessageTransformer> transformers;
 
     /**
+     * Get the router configuration name.
+     *
+     * @return The router configuration name.
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * Set the router configuration name.
+     *
+     * @param name The router configuration name.
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
      * Get router instance.
      *
      * @return The router instance.

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/ConfigurationDigester.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/ConfigurationDigester.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/ConfigurationDigester.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -41,7 +41,7 @@
     /**
      * Digest the supplied configuration stream.
      * <p/>
-     * Produces a {@link org.jboss.esb.deploy.config.ConfigurationUnit} that can be added to a {@link org.jboss.esb.deploy.Deployment}.
+     * Produces a {@link org.jboss.esb.deploy.config.ConfigurationUnit} that can be added to a {@link org.jboss.esb.deploy.DeploymentRuntime}.
      *
      * @param configStream The configuration Stream.
      * @return A configuration unit.

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/DefaultConfigurationDigester.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/DefaultConfigurationDigester.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/DefaultConfigurationDigester.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -32,9 +32,7 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
-import org.w3c.dom.Node;
 import org.xml.sax.SAXException;
-import org.milyn.xml.DomUtils;
 
 import javax.xml.parsers.ParserConfigurationException;
 import java.io.IOException;
@@ -58,7 +56,7 @@
     /**
      * Digest the supplied configuration stream.
      * <p/>
-     * Produces a {@link org.jboss.esb.deploy.config.ConfigurationUnit} that can be added to a {@link org.jboss.esb.deploy.Deployment}.
+     * Produces a {@link org.jboss.esb.deploy.config.ConfigurationUnit} that can be added to a {@link org.jboss.esb.deploy.DeploymentRuntime}.
      *
      * @param configStream The configuration Stream.
      * @return A configuration unit.
@@ -74,7 +72,7 @@
     /**
      * Digest the supplied configuration stream.
      * <p/>
-     * Produces a {@link ConfigurationUnit} that can be added to a {@link org.jboss.esb.deploy.Deployment}.
+     * Produces a {@link ConfigurationUnit} that can be added to a {@link org.jboss.esb.deploy.DeploymentRuntime}.
      *
      * @param configStream The configuration Stream.
      * @return A configuration unit.

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/inrouters-smooks.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/inrouters-smooks.xml	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/inrouters-smooks.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -38,6 +38,7 @@
     <jb:bindings beanId="inRouterConfig" class="org.jboss.esb.deploy.config.InboundRouterConfig" createOnElement="inRouter">
         <jb:wiring property="router" beanIdRef="inRouter" />
         <jb:wiring property="transformers" beanIdRef="transformers" />
+        <jb:value property="name" data="inRouter/@name" />
     </jb:bindings>
 
     <resource-config selector="inRouter">

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd	2008-08-29 13:27:31 UTC (rev 22234)
@@ -132,6 +132,7 @@
         <xs:sequence>
             <xs:element name="transformers" type="transformers" minOccurs="0" maxOccurs="1"/>
         </xs:sequence>
+        <xs:attribute name="name" type="xs:string" use="required" />
     </xs:complexType>
     <xs:element name="abstractInRouter" type="abstractInRouter" abstract="true" />
 
@@ -164,6 +165,7 @@
         <xs:sequence>
             <xs:element name="transformers" type="transformers" minOccurs="0" maxOccurs="1"/>
         </xs:sequence>
+        <xs:attribute name="name" type="xs:string" use="required" />
     </xs:complexType>
     <xs:element name="abstractOutRouter" type="abstractOutRouter" abstract="true" />
 

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/outrouters-smooks.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/outrouters-smooks.xml	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/outrouters-smooks.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -38,6 +38,7 @@
     <jb:bindings beanId="outRouterConfig" class="org.jboss.esb.deploy.config.OutboundRouterConfig" createOnElement="outRouter">
         <jb:wiring property="router" beanIdRef="outRouter" />
         <jb:wiring property="transformers" beanIdRef="transformers" />
+        <jb:value property="name" data="outRouter/@name" />
     </jb:bindings>
 
     <resource-config selector="outRouter">

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -88,6 +88,7 @@
         assertEquals(2, aRouterConfigs.size());
 
         InboundRouterConfig routerConfig = aRouterConfigs.get(0);
+        assertEquals("inrouter1", routerConfig.getName());
         assertEquals("1", ((MyInRouter) routerConfig.getRouter()).getMyparam());
         List<MessageTransformer> transformers = routerConfig.getTransformers();
         assertEquals(3, transformers.size());
@@ -96,6 +97,7 @@
         assertEquals(3, ((MyMessageTransformer) transformers.get(2)).getSomeParam());
 
         routerConfig = aRouterConfigs.get(1);
+        assertEquals("inrouter2", routerConfig.getName());
         assertEquals("2", ((MyInRouter) routerConfig.getRouter()).getMyparam());
         transformers = routerConfig.getTransformers();
         assertEquals(2, transformers.size());
@@ -106,12 +108,14 @@
         assertNotNull(bRouterConfigs);
         assertEquals(2, bRouterConfigs.size());
         routerConfig = bRouterConfigs.get(0);
+        assertEquals("inrouter3", routerConfig.getName());
         assertEquals("4", ((MyInRouter) routerConfig.getRouter()).getMyparam());
         transformers = routerConfig.getTransformers();
         assertEquals(1, transformers.size());
         assertEquals(6, ((MyMessageTransformer) transformers.get(0)).getSomeParam());
 
         routerConfig = bRouterConfigs.get(1);
+        assertEquals("inrouter4", routerConfig.getName());
         assertEquals("5", ((MyInRouter) routerConfig.getRouter()).getMyparam());
         assertEquals(5, ((MyInRouter) routerConfig.getRouter()).getMyOtherParam());
         transformers = routerConfig.getTransformers();
@@ -133,6 +137,7 @@
         assertEquals(2, aRouterConfigs.size());
 
         OutboundRouterConfig routerConfig = aRouterConfigs.get(0);
+        assertEquals("outrouter1", routerConfig.getName());
         assertEquals("1", ((MyOutRouter) routerConfig.getRouter()).getMyparam());
         List<MessageTransformer> transformers = routerConfig.getTransformers();
         assertEquals(3, transformers.size());
@@ -141,6 +146,7 @@
         assertEquals(3, ((MyMessageTransformer) transformers.get(2)).getSomeParam());
 
         routerConfig = aRouterConfigs.get(1);
+        assertEquals("outrouter2", routerConfig.getName());
         assertEquals("2", ((MyOutRouter) routerConfig.getRouter()).getMyparam());
         transformers = routerConfig.getTransformers();
         assertEquals(2, transformers.size());
@@ -151,12 +157,14 @@
         assertNotNull(bRouterConfigs);
         assertEquals(2, bRouterConfigs.size());
         routerConfig = bRouterConfigs.get(0);
+        assertEquals("outrouter3", routerConfig.getName());
         assertEquals("4", ((MyOutRouter) routerConfig.getRouter()).getMyparam());
         transformers = routerConfig.getTransformers();
         assertEquals(1, transformers.size());
         assertEquals(6, ((MyMessageTransformer) transformers.get(0)).getSomeParam());
 
         routerConfig = bRouterConfigs.get(1);
+        assertEquals("outrouter4", routerConfig.getName());
         assertEquals("5", ((MyOutRouter) routerConfig.getRouter()).getMyparam());
         assertEquals(5, ((MyOutRouter) routerConfig.getRouter()).getMyOtherParam());
         transformers = routerConfig.getTransformers();

Added: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DeploymentLifecycleTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DeploymentLifecycleTest.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DeploymentLifecycleTest.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.esb.deploy.config;
+
+import junit.framework.TestCase;
+import org.jboss.esb.deploy.DeploymentException;
+import org.jboss.esb.deploy.DeploymentRuntime;
+import org.jboss.esb.deploy.config.digest.DefaultConfigurationDigester;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class DeploymentLifecycleTest extends TestCase
+{
+    protected void setUp() throws Exception
+    {
+        MyInRouter.initialised = false;
+        MyMessageTransformer.initialised = false;
+        MyOutRouter.initialised = false;
+        MyResource.initialised = false;
+        MyTestService.initialised = false;
+    }
+
+    public void test_deploy_01_noexception() throws DeploymentException, IOException
+    {
+        DeploymentRuntime runtime = new DeploymentRuntime();
+        ConfigurationUnit configUnit = digest("jbossesb-deploy-01.xml");
+
+        runtime.add(configUnit);
+        assertDeployed(false);
+        runtime.deploy();
+        assertDeployed(true);
+        runtime.undeploy();
+        assertDeployed(false);
+    }
+
+    public void test_deploy_01_exception() throws DeploymentException, IOException
+    {
+        DeploymentRuntime runtime = new DeploymentRuntime();
+        ConfigurationUnit configUnit = digest("jbossesb-deploy-01.xml");
+
+        runtime.add(configUnit);
+        assertDeployed(false);
+        MyInRouter.exception = new Exception("deploy exception");
+        try
+        {
+            runtime.deploy();
+        } catch (DeploymentException e)
+        {
+            assertEquals("Unable to deploy InboundRouter 'inrouter1' (org.jboss.esb.deploy.config.MyInRouter).", e.getMessage());
+            // And check that everything else was undeployed again...
+            assertDeployed(false);
+        }
+    }
+
+    private void assertDeployed(boolean deployed)
+    {
+        assertEquals(deployed, MyInRouter.initialised);
+        assertEquals(deployed, MyMessageTransformer.initialised);
+        assertEquals(deployed, MyOutRouter.initialised);
+        assertEquals(deployed, MyResource.initialised);
+        assertEquals(deployed, MyTestService.initialised);
+    }
+
+    private ConfigurationUnit digest(String config) throws IOException, DeploymentException
+    {
+        DefaultConfigurationDigester digester = new DefaultConfigurationDigester();
+        return digester.digest(getClass().getResourceAsStream(config));
+    }
+}


Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DeploymentLifecycleTest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyInRouter.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyInRouter.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyInRouter.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -21,6 +21,8 @@
 
 import org.jboss.esb.routing.InboundRouter;
 import org.jboss.esb.routing.MessageDispatcher;
+import org.jboss.esb.annotations.Initialize;
+import org.jboss.esb.annotations.Uninitialize;
 
 /**
  * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
@@ -29,11 +31,27 @@
 {
     private String myparam;
     private int myOtherParam;
+    public static Exception exception;
+    public static boolean initialised = false;
 
     public void setDispatcher(MessageDispatcher dispatcher)
     {
     }
 
+    @Initialize
+    public void initialise() throws Exception
+    {
+        if(exception != null) {
+            throw exception;
+        }
+        initialised = true;
+    }
+
+    @Uninitialize
+    public void uninitialise() {
+        initialised = false;
+    }
+
     public String getMyparam()
     {
         return myparam;

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyMessageTransformer.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyMessageTransformer.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyMessageTransformer.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -22,6 +22,8 @@
 import org.jboss.esb.message.MessageTransformer;
 import org.jboss.esb.message.Message;
 import org.jboss.esb.message.MessageTransformationException;
+import org.jboss.esb.annotations.Initialize;
+import org.jboss.esb.annotations.Uninitialize;
 
 /**
  * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
@@ -29,7 +31,18 @@
 public class MyMessageTransformer implements MessageTransformer
 {
     private int someParam;
+    public static boolean initialised = false;
 
+    @Initialize
+    public void initialise() {
+        initialised = true;
+    }
+
+    @Uninitialize
+    public void uninitialise() {
+        initialised = false;
+    }
+
     public void transform(Message message) throws MessageTransformationException
     {
     }

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyOutRouter.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyOutRouter.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyOutRouter.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -24,6 +24,8 @@
 import org.jboss.esb.routing.OutboundRouter;
 import org.jboss.esb.routing.RoutingException;
 import org.jboss.esb.message.Message;
+import org.jboss.esb.annotations.Initialize;
+import org.jboss.esb.annotations.Uninitialize;
 
 /**
  * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
@@ -31,9 +33,19 @@
 public class MyOutRouter implements OutboundRouter
 {
     private String myparam;
-
     private int myOtherParam;
+    public static boolean initialised = false;
 
+    @Initialize
+    public void initialise() {
+        initialised = true;
+    }
+
+    @Uninitialize
+    public void uninitialise() {
+        initialised = false;
+    }
+
     public void route(Message message) throws RoutingException
     {
     }

Added: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyResource.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyResource.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyResource.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.esb.deploy.config;
+
+import org.jboss.esb.annotations.Initialize;
+import org.jboss.esb.annotations.Uninitialize;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MyResource
+{
+    public static boolean initialised = false;
+
+    @Initialize
+    public void initialise() {
+        initialised = true;
+    }
+
+    @Uninitialize
+    public void uninitialise() {
+        initialised = false;
+    }    
+}


Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyResource.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyTestService.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyTestService.java	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/MyTestService.java	2008-08-29 13:27:31 UTC (rev 22234)
@@ -22,6 +22,8 @@
 import org.jboss.esb.service.Service;
 import org.jboss.esb.service.ServiceException;
 import org.jboss.esb.message.Message;
+import org.jboss.esb.annotations.Initialize;
+import org.jboss.esb.annotations.Uninitialize;
 
 /**
  * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
@@ -29,6 +31,17 @@
 public class MyTestService implements Service
 {
     private String prop1;
+    public static boolean initialised = false;
+
+    @Initialize
+    public void initialise() {
+        initialised = true;
+    }
+
+    @Uninitialize
+    public void uninitialise() {
+        initialised = false;
+    }
     
     public Message process(Message message) throws ServiceException
     {

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-02.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-02.xml	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-02.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -1,10 +1,10 @@
 <jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd" xmlns:xprot="http://www.jboss.org/jbossesb/xsd/xprot/xprot.xsd">
     <routing>
         <inRouters serviceCategory="service-cat" serviceName="service-a">
-            <xprot:xprotInRouter xprotInAttribX="s" />
+            <xprot:xprotInRouter name="inrouter1" xprotInAttribX="s" />
         </inRouters>
         <outRouters serviceCategory="service-cat" serviceName="service-a">
-            <xprot:xprotOutRouter xprotOutAttribX="s"/>
+            <xprot:xprotOutRouter name="outrouter1" xprotOutAttribX="s"/>
         </outRouters>
     </routing>
 </jbossesb>
\ No newline at end of file

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -7,10 +7,10 @@
 
     <routing>
         <inRouters serviceCategory="service-cat" serviceName="service-a">
-            <xprot:xprotInRouter xprotInAttribX="s" />
+            <xprot:xprotInRouter name="inrouter1" xprotInAttribX="s" />
         </inRouters>
         <outRouters serviceCategory="service-cat" serviceName="service-a">
-            <xprot:xprotOutRouter xprotOutAttribX="s"/>
+            <xprot:xprotOutRouter name="outrouter1" xprotOutAttribX="s"/>
         </outRouters>
     </routing>
 </jbossesb>
\ No newline at end of file

Copied: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-deploy-01.xml (from rev 21938, labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml)
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-deploy-01.xml	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-deploy-01.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -0,0 +1,26 @@
+<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd" xmlns:xprot="http://www.jboss.org/jbossesb/xsd/xprot/xprot.xsd">
+    
+    <resources>
+        <resource id="resource1" class="org.jboss.esb.deploy.config.MyResource" />
+    </resources>
+
+    <services>
+        <service serviceCategory="service-cat" serviceName="service-a" serviceDescription="A Service" class="org.jboss.esb.deploy.config.MyTestService">
+            <property name="prop1">propValue</property>
+        </service>
+    </services>
+
+    <routing>
+        <inRouters serviceCategory="service-cat" serviceName="service-a">
+            <inRouter name="inrouter1" class="org.jboss.esb.deploy.config.MyInRouter" />
+            <inRouter name="inrouter2" class="org.jboss.esb.deploy.config.MyInRouter">
+                <transformers>
+                    <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer" />
+                </transformers>
+            </inRouter>
+        </inRouters>
+        <outRouters serviceCategory="service-cat" serviceName="service-a">
+            <outRouter name="outrouter1" class="org.jboss.esb.deploy.config.MyOutRouter" />
+        </outRouters>
+    </routing>
+</jbossesb>
\ No newline at end of file

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inandoutrouters_01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inandoutrouters_01.xml	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inandoutrouters_01.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -3,7 +3,7 @@
     <routing>
 
         <inRouters serviceCategory="service-cat" serviceName="service-a">
-            <inRouter class="org.jboss.esb.deploy.config.MyInRouter">
+            <inRouter name="inrouter1" class="org.jboss.esb.deploy.config.MyInRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">1</property>
@@ -17,7 +17,7 @@
                 </transformers>
                 <property name="myparam">1</property>
             </inRouter>
-            <inRouter class="org.jboss.esb.deploy.config.MyInRouter">
+            <inRouter name="inrouter2" class="org.jboss.esb.deploy.config.MyInRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">4</property>
@@ -31,7 +31,7 @@
         </inRouters>
 
         <inRouters serviceCategory="service-cat" serviceName="service-b">
-            <inRouter class="org.jboss.esb.deploy.config.MyInRouter">
+            <inRouter name="inrouter3" class="org.jboss.esb.deploy.config.MyInRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">6</property>
@@ -39,14 +39,14 @@
                 </transformers>
                 <property name="myparam">4</property>
             </inRouter>
-            <inRouter class="org.jboss.esb.deploy.config.MyInRouter">
+            <inRouter name="inrouter4" class="org.jboss.esb.deploy.config.MyInRouter">
                 <property name="myparam">5</property>
                 <property name="myOtherParam">5</property>
             </inRouter>
         </inRouters>
 
         <outRouters serviceCategory="service-cat" serviceName="service-a">
-            <outRouter class="org.jboss.esb.deploy.config.MyOutRouter">
+            <outRouter name="outrouter1" class="org.jboss.esb.deploy.config.MyOutRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">1</property>
@@ -60,7 +60,7 @@
                 </transformers>
                 <property name="myparam">1</property>
             </outRouter>
-            <outRouter class="org.jboss.esb.deploy.config.MyOutRouter">
+            <outRouter name="outrouter2" class="org.jboss.esb.deploy.config.MyOutRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">4</property>
@@ -74,7 +74,7 @@
         </outRouters>
         
         <outRouters serviceCategory="service-cat" serviceName="service-b">
-            <outRouter class="org.jboss.esb.deploy.config.MyOutRouter">
+            <outRouter name="outrouter3" class="org.jboss.esb.deploy.config.MyOutRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">6</property>
@@ -82,7 +82,7 @@
                 </transformers>
                 <property name="myparam">4</property>
             </outRouter>
-            <outRouter class="org.jboss.esb.deploy.config.MyOutRouter">
+            <outRouter name="outrouter4" class="org.jboss.esb.deploy.config.MyOutRouter">
                 <property name="myparam">5</property>
                 <property name="myOtherParam">5</property>
             </outRouter>

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_01.xml	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_01.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -3,7 +3,7 @@
     <routing>
         
         <inRouters serviceCategory="service-cat" serviceName="service-a">
-            <inRouter class="org.jboss.esb.deploy.config.MyInRouter">
+            <inRouter name="inrouter1" class="org.jboss.esb.deploy.config.MyInRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">1</property>
@@ -17,7 +17,7 @@
                 </transformers>
                 <property name="myparam">1</property>
             </inRouter>
-            <inRouter class="org.jboss.esb.deploy.config.MyInRouter">
+            <inRouter name="inrouter2" class="org.jboss.esb.deploy.config.MyInRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">4</property>
@@ -31,7 +31,7 @@
         </inRouters>
         
         <inRouters serviceCategory="service-cat" serviceName="service-b">
-            <inRouter class="org.jboss.esb.deploy.config.MyInRouter">
+            <inRouter name="inrouter3" class="org.jboss.esb.deploy.config.MyInRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">6</property>
@@ -39,7 +39,7 @@
                 </transformers>
                 <property name="myparam">4</property>
             </inRouter>
-            <inRouter class="org.jboss.esb.deploy.config.MyInRouter">
+            <inRouter name="inrouter4" class="org.jboss.esb.deploy.config.MyInRouter">
                 <property name="myparam">5</property>
                 <property name="myOtherParam">5</property>
             </inRouter>

Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-outrouters_01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-outrouters_01.xml	2008-08-29 13:11:58 UTC (rev 22233)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-outrouters_01.xml	2008-08-29 13:27:31 UTC (rev 22234)
@@ -2,7 +2,7 @@
 
     <routing>
         <outRouters serviceCategory="service-cat" serviceName="service-a">
-            <outRouter class="org.jboss.esb.deploy.config.MyOutRouter">
+            <outRouter name="outrouter1" class="org.jboss.esb.deploy.config.MyOutRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">1</property>
@@ -16,7 +16,7 @@
                 </transformers>
                 <property name="myparam">1</property>
             </outRouter>
-            <outRouter class="org.jboss.esb.deploy.config.MyOutRouter">
+            <outRouter name="outrouter2" class="org.jboss.esb.deploy.config.MyOutRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">4</property>
@@ -29,7 +29,7 @@
             </outRouter>
         </outRouters>
         <outRouters serviceCategory="service-cat" serviceName="service-b">
-            <outRouter class="org.jboss.esb.deploy.config.MyOutRouter">
+            <outRouter name="outrouter3" class="org.jboss.esb.deploy.config.MyOutRouter">
                 <transformers>
                     <transformer class="org.jboss.esb.deploy.config.MyMessageTransformer">
                         <property name="someParam">6</property>
@@ -37,7 +37,7 @@
                 </transformers>
                 <property name="myparam">4</property>
             </outRouter>
-            <outRouter class="org.jboss.esb.deploy.config.MyOutRouter">
+            <outRouter name="outrouter4" class="org.jboss.esb.deploy.config.MyOutRouter">
                 <property name="myparam">5</property>
                 <property name="myOtherParam">5</property>
             </outRouter>




More information about the jboss-svn-commits mailing list