[jboss-svn-commits] JBL Code SVN: r9542 - in labs/jbossesb/workspace/bburke/product: core/listeners/src/org/jboss/soa/esb/listeners/config and 7 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Feb 15 18:04:57 EST 2007


Author: bill.burke at jboss.com
Date: 2007-02-15 18:04:56 -0500 (Thu, 15 Feb 2007)
New Revision: 9542

Added:
   labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/Configuration.java
   labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
   labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java
   labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
   labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java
   labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java
   labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java
   labs/jbossesb/workspace/bburke/product/install/jboss-service-registry.xml
   labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/esb-queues-service.xml
Modified:
   labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/LifecycleUtil.java
   labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/Generator.java
   labs/jbossesb/workspace/bburke/product/core/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java
   labs/jbossesb/workspace/bburke/product/core/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
   labs/jbossesb/workspace/bburke/product/core/services/build.xml
   labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
   labs/jbossesb/workspace/bburke/product/install/build.xml
   labs/jbossesb/workspace/bburke/product/install/jboss-service-dependencies.xml
   labs/jbossesb/workspace/bburke/product/install/jboss-service.xml
   labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/build.xml
   labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/jbossesb.xml
Log:
ESB Deployer

Modified: labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/LifecycleUtil.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/LifecycleUtil.java	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/LifecycleUtil.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -35,179 +35,187 @@
 
 /**
  * Lifecycle helper methods
+ *
  * @author kevin
  */
 public class LifecycleUtil
 {
-    /**
-     * Default constructor.
-     */
-    private LifecycleUtil()
-    {
-    }
-    
-    /**
-     * Get the managed listeners from the specified parameter entry in the repository.
-     * @param param The listener parameter.
-     * @return The managed listeners.
-     * 
-     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
-     * @throws SAXException For errors associated with parsing the configuration.
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    public static List<ManagedLifecycle> getListeners(final String param)
-        throws ParamRepositoryException, SAXException, ManagedLifecycleException
-    {
-        return getListeners(getConfigTree(param)) ;
-    }
-    
-    /**
-     * Get the managed listeners from the specified config tree.
-     * @param tree The config tree.
-     * @return The managed listeners.
-     * 
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    public static List<ManagedLifecycle> getListeners(final ConfigTree tree)
-        throws ManagedLifecycleException
-    {
-        return getManagedInstances(tree, ListenerTagNames.LISTENER_CLASS_TAG) ;
-    }
-    
-    /**
-     * Get the managed gateways from the specified parameter entry in the repository.
-     * @param param The gateway parameter.
-     * @return The managed gateways.
-     * 
-     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
-     * @throws SAXException For errors associated with parsing the configuration.
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    public static List<ManagedLifecycle> getGateways(final String param)
-        throws ParamRepositoryException, SAXException, ManagedLifecycleException
-    {
-        return getGateways(getConfigTree(param)) ;
-    }
-    
-    /**
-     * Get the managed gateways from the specified config tree.
-     * @param tree The config tree.
-     * @return The managed gateways.
-     * 
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    public static List<ManagedLifecycle> getGateways(final ConfigTree tree)
-        throws ManagedLifecycleException
-    {
-        return getManagedInstances(tree, ListenerTagNames.GATEWAY_CLASS_TAG) ;
-    }
-    
-    /**
-     * Get the managed instances from the specified config tree.
-     * @param tree The config tree.
-     * @return The managed instances.
-     * 
-     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
-     * @throws SAXException For errors associated with parsing the configuration.
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    private static List<ManagedLifecycle> getManagedInstances(final ConfigTree tree, final String classTag)
-        throws ManagedLifecycleException
-    {
-        final ArrayList<ManagedLifecycle> instances = new ArrayList<ManagedLifecycle>() ;
-        
-        for(ConfigTree child : tree.getAllChildren())
-        {
-            final String classname = child.getAttribute(classTag) ;
-            if (classname != null)
+   /**
+    * Default constructor.
+    */
+   private LifecycleUtil()
+   {
+   }
+
+   /**
+    * Get the managed listeners from the specified parameter entry in the repository.
+    *
+    * @param param The listener parameter.
+    * @return The managed listeners.
+    * @throws ParamRepositoryException  For errors associated with accessing the parameter repository.
+    * @throws SAXException              For errors associated with parsing the configuration.
+    * @throws ManagedLifecycleException For errors associated with the managed instance.
+    */
+   public static List<ManagedLifecycle> getListeners(final String param)
+           throws ParamRepositoryException, SAXException, ManagedLifecycleException
+   {
+      return getListeners(getConfigTree(param));
+   }
+
+
+
+   /**
+    * Get the managed listeners from the specified config tree.
+    *
+    * @param tree The config tree.
+    * @return The managed listeners.
+    * @throws ManagedLifecycleException For errors associated with the managed instance.
+    */
+   public static List<ManagedLifecycle> getListeners(final ConfigTree tree)
+           throws ManagedLifecycleException
+   {
+      return getManagedInstances(tree, ListenerTagNames.LISTENER_CLASS_TAG);
+   }
+
+   /**
+    * Get the managed gateways from the specified parameter entry in the repository.
+    *
+    * @param param The gateway parameter.
+    * @return The managed gateways.
+    * @throws ParamRepositoryException  For errors associated with accessing the parameter repository.
+    * @throws SAXException              For errors associated with parsing the configuration.
+    * @throws ManagedLifecycleException For errors associated with the managed instance.
+    */
+   public static List<ManagedLifecycle> getGateways(final String param)
+           throws ParamRepositoryException, SAXException, ManagedLifecycleException
+   {
+      return getGateways(getConfigTree(param));
+   }
+
+   /**
+    * Get the managed gateways from the specified config tree.
+    *
+    * @param tree The config tree.
+    * @return The managed gateways.
+    * @throws ManagedLifecycleException For errors associated with the managed instance.
+    */
+   public static List<ManagedLifecycle> getGateways(final ConfigTree tree)
+           throws ManagedLifecycleException
+   {
+      return getManagedInstances(tree, ListenerTagNames.GATEWAY_CLASS_TAG);
+   }
+
+   /**
+    * Get the managed instances from the specified config tree.
+    *
+    * @param tree The config tree.
+    * @return The managed instances.
+    * @throws ParamRepositoryException  For errors associated with accessing the parameter repository.
+    * @throws SAXException              For errors associated with parsing the configuration.
+    * @throws ManagedLifecycleException For errors associated with the managed instance.
+    */
+   private static List<ManagedLifecycle> getManagedInstances(final ConfigTree tree, final String classTag)
+           throws ManagedLifecycleException
+   {
+      final ArrayList<ManagedLifecycle> instances = new ArrayList<ManagedLifecycle>();
+
+      for (ConfigTree child : tree.getAllChildren())
+      {
+         final String classname = child.getAttribute(classTag);
+         if (classname != null)
+         {
+            final Class instanceClass;
+            try
             {
-                final Class instanceClass ;
-                try
-                {
-                    instanceClass = loadClass(classname) ;
-                }
-                catch (final ClassNotFoundException cnfe)
-                {
-                    throw new ManagedLifecycleException("Could not locate managed instance " + classname) ;
-                }
-                
-                if (!ManagedLifecycle.class.isAssignableFrom(instanceClass))
-                {
-                    throw new ManagedLifecycleException("Managed instance " + classname + " does not implement ManagedLifecycle") ;
-                }
-                
-                final Constructor constructor ;
-                try
-                {
-                    constructor = instanceClass.getConstructor(new Class[] {ConfigTree.class}) ;
-                }
-                catch (final NoSuchMethodException nsme)
-                {
-                    throw new ManagedLifecycleException("Managed instance " + classname + " does not have correct constructor") ;
-                }
-                final ManagedLifecycle instance ;
-                try
-                {
-                    instance = (ManagedLifecycle)constructor.newInstance(child) ;
-                }
-                catch (final Exception ex)
-                {
-                    throw new ManagedLifecycleException("Unexpected exception while instantiating managed instance", ex) ;
-                }
-                instances.add(instance) ;
+               instanceClass = loadClass(classname);
             }
-        }
-        
-        return instances ;
-    }
-    
-    /**
-     * Get the config tree from the specified parameter entry in the repository.
-     * @param param The parameter.
-     * @return The config tree.
-     * 
-     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
-     * @throws SAXException For errors associated with parsing the configuration.
-     */
-    public static ConfigTree getConfigTree(final String param)
-        throws ParamRepositoryException, SAXException
-    {
-        final String xml = ParamRepositoryFactory.getInstance().get(param) ;
-        final ConfigTree tree = ConfigTree.fromXml(xml) ;
-        
-        tree.setAttribute("configSource", "param-repository:" + param) ;
-        return tree ;
-    }
-    
-    /**
-     * Load the specified class.
-     * @param classname The name of the class to load.
-     * @return The specified class.
-     * @throws ClassNotFoundException If the class cannot be found.
-     */
-    private static Class loadClass(final String classname)
-        throws ClassNotFoundException
-    {
-        final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
-        if (threadClassLoader != null)
-        {
+            catch (final ClassNotFoundException cnfe)
+            {
+               throw new ManagedLifecycleException("Could not locate managed instance " + classname);
+            }
+
+            if (!ManagedLifecycle.class.isAssignableFrom(instanceClass))
+            {
+               throw new ManagedLifecycleException("Managed instance " + classname + " does not implement ManagedLifecycle");
+            }
+
+            final Constructor constructor;
             try
             {
-                return threadClassLoader.loadClass(classname) ;
+               constructor = instanceClass.getConstructor(new Class[]{ConfigTree.class});
             }
-            catch (final ClassNotFoundException cnfe) {} // ignore
-        }
-        
-        final ClassLoader classLoader = LifecycleUtil.class.getClassLoader() ;
-        if (classLoader != null)
-        {
+            catch (final NoSuchMethodException nsme)
+            {
+               throw new ManagedLifecycleException("Managed instance " + classname + " does not have correct constructor");
+            }
+            final ManagedLifecycle instance;
             try
             {
-                return classLoader.loadClass(classname) ;
+               instance = (ManagedLifecycle) constructor.newInstance(child);
             }
-            catch (final ClassNotFoundException cnfe) {} // ignore
-        }
-        
-        return Class.forName(classname, true, ClassLoader.getSystemClassLoader()) ;
-    }
+            catch (final Exception ex)
+            {
+               throw new ManagedLifecycleException("Unexpected exception while instantiating managed instance", ex);
+            }
+            instances.add(instance);
+         }
+      }
+
+      return instances;
+   }
+
+   /**
+    * Get the config tree from the specified parameter entry in the repository.
+    *
+    * @param param The parameter.
+    * @return The config tree.
+    * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
+    * @throws SAXException             For errors associated with parsing the configuration.
+    */
+   public static ConfigTree getConfigTree(final String param)
+           throws ParamRepositoryException, SAXException
+   {
+      final String xml = ParamRepositoryFactory.getInstance().get(param);
+      final ConfigTree tree = ConfigTree.fromXml(xml);
+
+      tree.setAttribute("configSource", "param-repository:" + param);
+      return tree;
+   }
+
+   /**
+    * Load the specified class.
+    *
+    * @param classname The name of the class to load.
+    * @return The specified class.
+    * @throws ClassNotFoundException If the class cannot be found.
+    */
+   private static Class loadClass(final String classname)
+           throws ClassNotFoundException
+   {
+      final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader();
+      if (threadClassLoader != null)
+      {
+         try
+         {
+            return threadClassLoader.loadClass(classname);
+         }
+         catch (final ClassNotFoundException cnfe)
+         {
+         } // ignore
+      }
+
+      final ClassLoader classLoader = LifecycleUtil.class.getClassLoader();
+      if (classLoader != null)
+      {
+         try
+         {
+            return classLoader.loadClass(classname);
+         }
+         catch (final ClassNotFoundException cnfe)
+         {
+         } // ignore
+      }
+
+      return Class.forName(classname, true, ClassLoader.getSystemClassLoader());
+   }
 }

Added: labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/Configuration.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/Configuration.java	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/Configuration.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,107 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.listeners.config;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.LifecycleUtil;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.xml.sax.InputSource;
+
+import javax.xml.transform.stream.StreamSource;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.List;
+
+/**
+ * comment
+ *
+ * @author <a href="kurt.stam at jboss.com">Kurt Stam</a>
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class Configuration
+{
+   private static final String JBOSSESB_XSD = "/jbossesb-1.0.xsd";
+
+   public static String getStringFromStream(InputStream is) throws Exception
+   {
+      byte[] bytes = StreamUtils.readStream(is);
+      return new String(bytes, "UTF-8");
+   }
+
+   public static ManagedLifecycleController create(URL jbossEsbXml)
+   {
+      String configXml = null;
+      try
+      {
+         configXml = getStringFromStream(jbossEsbXml.openStream());
+         return create(configXml);
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("Failed to load jbossesb.xml file: " + jbossEsbXml, e);
+      }
+   }
+
+   public static ManagedLifecycleController create(String configXml)
+   {
+      InputStream validationInputStream = Configuration.class.getResourceAsStream(JBOSSESB_XSD);
+      //if this fails try using the
+      if (validationInputStream == null)
+      {
+         throw new IllegalStateException("ESB validation file [" + JBOSSESB_XSD + "] not found.");
+      }
+      StreamSource validationInputSource = new StreamSource(validationInputStream);
+
+      try
+      {
+         InputSource xmlInputSource = new InputSource(new StringReader(configXml));
+         XmlValidator validator = new XmlValidatorImpl();
+         if (validator.validate(xmlInputSource, validationInputSource))
+         {
+            ByteArrayOutputStream listenerXml = new ByteArrayOutputStream();
+            ByteArrayOutputStream gatewayXml = new ByteArrayOutputStream();
+            Generator generator = new Generator(new ByteArrayInputStream(configXml.getBytes()), listenerXml, gatewayXml);
+            generator.generate();
+            ByteArrayInputStream listenerIs = new ByteArrayInputStream(listenerXml.toByteArray());
+            ConfigTree listenerConfig = ConfigTree.fromInputStream(listenerIs);
+            List<ManagedLifecycle> instances = LifecycleUtil.getListeners(listenerConfig);
+
+            ByteArrayInputStream gatewayIs = new ByteArrayInputStream(gatewayXml.toByteArray());
+            ConfigTree gatewayConfig = ConfigTree.fromInputStream(gatewayIs);
+            instances.addAll(LifecycleUtil.getGateways(gatewayConfig));
+            return new ManagedLifecycleController(instances);
+         }
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+
+      return null;
+   }
+}

Modified: labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/Generator.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/Generator.java	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/Generator.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -24,6 +24,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -61,8 +62,20 @@
 	 * Configuration model.
 	 */
 	private XMLBeansModel model;
-	
-	/**
+
+   private OutputStream gatewayOutputStream;
+
+   private OutputStream listenerOutputStream;
+
+
+   public Generator(InputStream config, OutputStream listenerOutputStream, OutputStream gatewayOutputStream) throws ConfigurationException, IOException
+   {
+      this(config);
+      this.gatewayOutputStream = gatewayOutputStream;
+      this.listenerOutputStream = listenerOutputStream;
+   }
+
+   /**
 	 * Public constructor.
 	 * @param config The input configuration stream.
 	 * @throws ConfigurationException Bad listener ESB configuration. 
@@ -86,6 +99,24 @@
 		}
 	}
 	
+   /**
+    * Generate the configuration set in the supplied output directory and store it in the member outputstreams.
+    * @throws ConfigurationException Failed to generate configuration set.
+    */
+   public void generate() throws ConfigurationException {
+      // Generate and serialise the configuration for the ESB Aware listeners...
+      ESBAwareGenerator awareGenerator = new ESBAwareGenerator(model);
+      Document awareConfig = awareGenerator.generate();
+
+      YADOMUtil.serialize(awareConfig, listenerOutputStream);
+
+      // Generate and serialise the configuration for the Gateway listeners...
+      GatewayGenerator gatewayGenerator = new GatewayGenerator(model);
+      Document gatewayConfig = gatewayGenerator.generate();
+
+      YADOMUtil.serialize(gatewayConfig, gatewayOutputStream);
+   }
+
 	/**
 	 * Generate the configuration set in the supplied output directory.
 	 * <p/>

Added: labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,280 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.listeners.config;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.SubDeployer;
+import org.jboss.deployment.SubDeployerSupport;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.MetaData;
+import org.jboss.metadata.XmlFileLoader;
+import org.jboss.mx.loading.LoaderRepositoryFactory;
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.ObjectNameConverter;
+import org.jboss.system.ServiceControllerMBean;
+import org.w3c.dom.Element;
+
+import javax.management.ObjectName;
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBoss4ESBDeployer extends SubDeployerSupport
+        implements SubDeployer, JBoss4ESBDeployerMBean
+{
+   private final static Logger log = Logger.getLogger(JBoss4ESBDeployer.class);
+
+   private ServiceControllerMBean serviceController;
+
+   /**
+    * Default CTOR used to set default values to the Suffixes and RelativeOrder
+    * attributes. Those are read at subdeployer registration time by the MainDeployer
+    * to alter its SuffixOrder.
+    */
+   public JBoss4ESBDeployer()
+   {
+      setSuffixes(new String[]{".esb"});
+      setRelativeOrder(1000); // before old EJB 2.1 deployer
+   }
+
+   public static boolean hasFile(DeploymentInfo di, String filePath)
+   {
+      String urlStr = di.url.getFile();
+      try
+      {
+         URL dd = di.localCl.findResource(filePath);
+         if (dd != null)
+         {
+
+            // If the DD url is not a subset of the urlStr then this is coming
+            // from a jar referenced by the deployment jar manifest and the
+            // this deployment jar it should not be treated as persistence
+            if (di.localUrl != null)
+            {
+               urlStr = di.localUrl.toString();
+            }
+
+            String ddStr = dd.toString();
+            if (ddStr.indexOf(urlStr) >= 0)
+            {
+               return true;
+            }
+         }
+      }
+      catch (Exception ignore)
+      {
+      }
+      return false;
+   }
+
+   /**
+    * Returns true if this deployer can deploy the given DeploymentInfo.
+    *
+    * @return True if this deployer can deploy the given DeploymentInfo.
+    * @jmx:managed-operation
+    */
+   public boolean accepts(DeploymentInfo di)
+   {
+      String urlStr = di.url.toString();
+      return urlStr.endsWith(".esb") || urlStr.endsWith(".esb/") ||
+      urlStr.endsWith("-esb.xml");
+   }
+
+   /**
+    * Get a reference to the ServiceController
+    */
+   protected void startService() throws Exception
+   {
+      serviceController = (ServiceControllerMBean)
+              MBeanProxyExt.create(ServiceControllerMBean.class,
+                                   ServiceControllerMBean.OBJECT_NAME, server);
+
+      mainDeployer.addDeployer(this);
+   }   
+
+   protected URL getDocumentUrl(DeploymentInfo di)
+   {
+      String urlStr = di.url.toString();
+      if (urlStr.endsWith(".esb") || urlStr.endsWith(".esb/"))
+      {
+         return di.localCl.getResource("META-INF/jboss-esb.xml");
+      }
+      return di.url;
+   }
+
+   public void init(DeploymentInfo di) throws DeploymentException
+   {
+      try
+      {
+         if( di.url.getProtocol().equalsIgnoreCase("file") )
+         {
+            File file = new File(di.url.getFile());
+
+            if( !file.isDirectory() )
+            {
+               // If not directory we watch the package
+               di.watch = di.url;
+            }
+            else
+            {
+               // If directory we watch the xml files
+               di.watch = new URL(di.url, "META-INF/jboss-esb.xml");
+            }
+         }
+         else
+         {
+            // We watch the top only, no directory support
+            di.watch = di.url;
+         }
+
+         XmlFileLoader xfl = new XmlFileLoader();
+         InputStream in = di.localCl.getResourceAsStream("META-INF/classloader.xml");
+         if( in != null )
+         {
+            try
+            {
+               Element jboss = xfl.getDocument(in, "META-INF/classloader.xml").getDocumentElement();
+               // Check for a ejb level class loading config
+               Element loader = MetaData.getOptionalChild(jboss, "loader-repository");
+               if( loader != null )
+               {
+                  LoaderRepositoryFactory.LoaderRepositoryConfig config =
+                        LoaderRepositoryFactory.parseRepositoryConfig(loader);
+                  di.setRepositoryInfo(config);
+               }
+
+            }
+            finally
+            {
+               in.close();
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         if (e instanceof DeploymentException)
+         {
+            throw (DeploymentException) e;
+         }
+         throw new DeploymentException( "failed to initialize", e );
+      }
+
+
+      // invoke super-class initialization
+      super.init(di);
+   }
+
+   public synchronized void create(DeploymentInfo di) throws DeploymentException
+   {
+      log.debug("create, " + di.shortName);
+
+      try
+      {
+         String jbossEsbXml = Configuration.getStringFromStream(getDocumentUrl(di).openStream());
+         JBoss4ESBDeployment deployment = new JBoss4ESBDeployment(jbossEsbXml);
+         String name = "jboss.esb:module=" + di.shortName;
+         // Build an escaped JMX name including deployment shortname
+         ObjectName esbModuleName = ObjectNameConverter.convert(name);
+         // Check that the name is not registered
+         if (server.isRegistered(esbModuleName) == true)
+         {
+            log.debug("The ESB Module name: " + esbModuleName
+                      + "is already registered, adding uid=" + System.identityHashCode(deployment));
+            name = name + ",uid=" + System.identityHashCode(deployment);
+            esbModuleName = ObjectNameConverter.convert(name);
+         }
+         server.registerMBean(deployment, esbModuleName);
+         di.deployedObject = esbModuleName;
+         log.debug("Deploying: " + di.url);
+         // Invoke the create life cycle method
+         serviceController.create(di.deployedObject);
+      }
+      catch (Exception e)
+      {
+         throw new DeploymentException("Error during create of ESB Module: "
+                                       + di.url, e);
+      }
+      super.create(di);
+   }
+
+   public synchronized void start(DeploymentInfo di)
+           throws DeploymentException
+   {
+      try
+      {
+         // Start application
+         log.debug("start application, deploymentInfo: " + di +
+                   ", short name: " + di.shortName +
+                   ", parent short name: " +
+                   (di.parent == null ? "null" : di.parent.shortName));
+         serviceController.start(di.deployedObject);
+      }
+      catch (Exception e)
+      {
+         stop(di);
+         destroy(di);
+         throw new DeploymentException("Could not deploy " + di.url, e);
+      }
+      super.start(di);
+   }
+
+   public void stop(DeploymentInfo di)
+           throws DeploymentException
+   {
+      log.debug("init, " + di.shortName);
+      try
+      {
+         serviceController.stop(di.deployedObject);
+      }
+      catch (Exception e)
+      {
+         throw new DeploymentException("problem stopping ejb module: " +
+                                       di.url, e);
+      }
+
+      super.stop(di);
+   }
+
+   public void destroy(DeploymentInfo di)
+           throws DeploymentException
+   {
+      try
+      {
+         serviceController.destroy(di.deployedObject);
+         serviceController.remove(di.deployedObject);
+      }
+      catch (Exception e)
+      {
+         throw new DeploymentException("problem destroying ejb module: " +
+                                       di.url, e);
+      }
+
+      super.destroy(di);
+   }
+}

Added: labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.listeners.config;
+
+import org.jboss.deployment.SubDeployerMBean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JBoss4ESBDeployerMBean extends SubDeployerMBean
+{
+}

Added: labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,78 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.listeners.config;
+
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBoss4ESBDeployment extends ServiceMBeanSupport implements JBoss4ESBDeploymentMBean
+{
+   private String jbossEsbXml;
+   private ManagedLifecycleController controller;
+
+
+   public JBoss4ESBDeployment(String jbossEsbXml)
+   {
+      this.jbossEsbXml = jbossEsbXml;
+   }
+
+   public String getJbossEsbXml()
+   {
+      return jbossEsbXml;
+   }
+
+   public String getJbossEsbXmlAsHtml()
+   {
+      return jbossEsbXml.replace("<", "&lt;").replace(">", "&gt;");
+   }
+
+   public ManagedLifecycleController getController()
+   {
+      return controller;
+   }
+
+   @Override
+   public void createService()
+   {
+      controller = Configuration.create(jbossEsbXml);
+   }
+
+   @Override
+   public void startService() throws Exception
+   {
+      controller.start();
+
+   }
+
+   @Override
+   public void stopService() throws Exception
+   {
+      controller.stop();
+   }
+
+}

Added: labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/core/listeners/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.listeners.config;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JBoss4ESBDeploymentMBean extends ServiceMBean
+{
+   String getJbossEsbXml()
+           ;
+
+   String getJbossEsbXmlAsHtml()
+           ;
+}

Modified: labs/jbossesb/workspace/bburke/product/core/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/core/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -136,7 +136,7 @@
 					return null;
 				}
 			}
-
+         System.out.println("************* PARAM FILE IS: " + paramFile);
 			InputStream fileStream = null;
 			try
 			{

Modified: labs/jbossesb/workspace/bburke/product/core/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/core/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -22,6 +22,7 @@
 package org.jboss.soa.esb.dom;
 
 import java.io.File;
+import java.io.OutputStream;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -118,7 +119,11 @@
 		serialize(node, new StreamResult(new File(outdir, fileName)));
 	}
 
-	/**
+   public static void serialize(Node node, OutputStream out) throws ConfigurationException {
+      serialize(node, new StreamResult(out));
+   }
+
+   /**
 	 * Serialize the supplied DOM node to the supplied DOM StreamResult instance.
 	 * @param node The DOM node to be serialised.
 	 * @param streamRes The StreamResult into which the node is to be serialised.

Modified: labs/jbossesb/workspace/bburke/product/core/services/build.xml
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/services/build.xml	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/core/services/build.xml	2007-02-15 23:04:56 UTC (rev 9542)
@@ -2,135 +2,139 @@
 
 <project name="JbossEsbServices" default="org.jboss.esb.services.compile" basedir=".">
 
-	<property name="org.jboss.esb.internal.dest" location="../../build"/>
-		
-    <property name="org.jboss.esb.services.name.jar" value="${ant.project.name}.jar"/>
-	<property name="org.jboss.esb.services.dist.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
-    <property name="org.jboss.esb.services.appl.dir" location="../.."/>
-    <property name="org.jboss.esb.services.metainf.dir" location="src/META-INF"/>
+   <property name="org.jboss.esb.internal.dest" location="../../build"/>
 
-	<property name="org.jboss.esb.services.classes.dir" location="${org.jboss.esb.internal.dest}/classes/services"/>
-	<property name="org.jboss.esb.services.src.dir" location="src"/>
-	<property name="org.jboss.esb.services.rules.dir" location="rules"/>
-	<property name="org.jboss.esb.root.dir" location="../.."/>
-	<property environment="env"/>
+   <property name="org.jboss.esb.services.name.jar" value="${ant.project.name}.jar"/>
+   <property name="org.jboss.esb.services.dist.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
+   <property name="org.jboss.esb.services.appl.dir" location="../.."/>
+   <property name="org.jboss.esb.services.metainf.dir" location="src/META-INF"/>
 
-	<property name="org.jboss.esb.ext.serverlib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
-	<condition property="org.jboss.esb.ext.serverlib.dir" value="${org.jboss.esb.jboss.home}/server/all/lib">
-		<equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
-	</condition>
-	
-	<property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
-	<condition property="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.jboss.home}/lib">
-		<equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
-	</condition>
-	
-	    <!-- =================================================================== -->
-	    <!-- Define the class path                                               -->
-	    <!-- =================================================================== -->
-	    <path id="org.jboss.esb.services.base.classpath">
-	        <fileset dir="${org.jboss.esb.ext.lib.dir}"  includes="*.jar" excludes="jbossall-client.jar"/>
-	    	<pathelement location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
-	    </path>
+   <property name="org.jboss.esb.services.classes.dir" location="${org.jboss.esb.internal.dest}/classes/services"/>
+   <property name="org.jboss.esb.services.src.dir" location="src"/>
+   <property name="org.jboss.esb.services.rules.dir" location="rules"/>
+   <property name="org.jboss.esb.root.dir" location="../.."/>
+   <property environment="env"/>
 
-	    <!-- =================================================================== -->
-	    <!-- Initialize                                                          -->
-	    <!-- =================================================================== -->
-	    <target name="org.jboss.esb.services.init">
-	        <tstamp>
-	            <format property="TODAY" pattern="dd-MM-yy"/>
-	        </tstamp>
-	    </target>
+   <property name="org.jboss.esb.ext.serverlib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
+   <condition property="org.jboss.esb.ext.serverlib.dir" value="${org.jboss.esb.jboss.home}/server/all/lib">
+      <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
+   </condition>
 
-	    <!-- =================================================================== -->
-	    <!-- Prepares the directory structure                                    -->
-	    <!-- =================================================================== -->
-	    <target name="org.jboss.esb.services.prepare" depends="org.jboss.esb.services.init">
-	        <mkdir dir="${org.jboss.esb.services.classes.dir}"/>
-	    </target>
+   <property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
+   <condition property="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.jboss.home}/lib">
+      <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
+   </condition>
 
-	    <!-- =================================================================== -->
-	    <!-- Compiles all the classes                                            -->
-	    <!-- =================================================================== -->
+   <!-- =================================================================== -->
+   <!-- Define the class path                                               -->
+   <!-- =================================================================== -->
+   <path id="org.jboss.esb.services.base.classpath">
+      <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar" excludes="jbossall-client.jar"/>
+      <pathelement location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
+   </path>
 
-        <target name="org.jboss.esb.services.compile">
-            <!-- Compile services -->
-            <antcall target="org.jboss.esb.services.internal.compile"/>
-            <!-- Compile services tests -->
-            <ant inheritAll="true" dir="tests" target="org.jboss.esb.services.tests.compile"/>
-        </target>
+   <!-- =================================================================== -->
+   <!-- Initialize                                                          -->
+   <!-- =================================================================== -->
+   <target name="org.jboss.esb.services.init">
+      <tstamp>
+         <format property="TODAY" pattern="dd-MM-yy"/>
+      </tstamp>
+   </target>
 
-        <target name="org.jboss.esb.services.internal.compile" depends="org.jboss.esb.services.prepare"
-	        description="Compile all classes">
+   <!-- =================================================================== -->
+   <!-- Prepares the directory structure                                    -->
+   <!-- =================================================================== -->
+   <target name="org.jboss.esb.services.prepare" depends="org.jboss.esb.services.init">
+      <mkdir dir="${org.jboss.esb.services.classes.dir}"/>
+   </target>
 
-	        <javac
-	            destdir="${org.jboss.esb.services.classes.dir}"
-	            classpathref="org.jboss.esb.services.default.classpath"
-	            debug="${org.jboss.esb.debug}"
-	            optimize="${org.jboss.esb.optimize}"
-	            >
-	            <src path="${org.jboss.esb.services.src.dir}"/>
-	        </javac>
+   <!-- =================================================================== -->
+   <!-- Compiles all the classes                                            -->
+   <!-- =================================================================== -->
 
-	    </target>
+   <target name="org.jboss.esb.services.compile">
+      <!-- Compile services -->
+      <antcall target="org.jboss.esb.services.internal.compile"/>
+      <!-- Compile services tests -->
+      <ant inheritAll="true" dir="tests" target="org.jboss.esb.services.tests.compile"/>
+   </target>
 
-	    <!-- =================================================================== -->
-	    <!-- Recompiles all the classes                                            -->
-	    <!-- =================================================================== -->
+   <target name="org.jboss.esb.services.internal.compile" depends="org.jboss.esb.services.prepare"
+           description="Compile all classes">
 
-	    <target name="recompile" depends="clean,org.jboss.esb.services.compile"
-	        description="Clean and compile"/>
+      <javac
+              destdir="${org.jboss.esb.services.classes.dir}"
+              classpathref="org.jboss.esb.services.default.classpath"
+              debug="${org.jboss.esb.debug}"
+              optimize="${org.jboss.esb.optimize}"
+              >
+         <src path="${org.jboss.esb.services.src.dir}"/>
+      </javac>
 
-	    <!-- =================================================================== -->
-	    <!-- Clean                                                               -->
-	    <!-- =================================================================== -->
-	    <target name="clean" description="Remove classes directory">
-			<ant dir="tests" target="clean"/>
-			<delete dir="${org.jboss.esb.services.classes.dir}"/>
-	    </target>
-	
-	    <!-- =================================================================== -->
-	    <!-- Rebuild everything from scratch                                     -->
-	    <!-- =================================================================== -->
-	    <target name="all" depends="recompile,jar" />
-	
-    <path id="org.jboss.esb.services.default.classpath">
-        <path refid="org.jboss.esb.services.base.classpath"/>
-		<pathelement location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
-    	<pathelement location="${org.jboss.esb.internal.dest}/classes/listeners"/>
-    </path>
+   </target>
 
-    <!-- =================================================================== -->
-    <!-- Jar                                                               -->
-    <!-- =================================================================== -->
-    <target name="jar" description="Assemble jar files"
-    	depends="org.jboss.esb.services.compile"
-	>
-        <jar    destfile="${org.jboss.esb.services.dist.dir}/lib/jbossesb-services.jar"
-                basedir="${org.jboss.esb.services.classes.dir}"
-                includes="**/*.class"
-                />
-    	<jar    destfile="${org.jboss.esb.services.dist.dir}/lib/jbossesb-rules.jar"
-    	                basedir="${org.jboss.esb.services.rules.dir}"
-    	                includes="**/*.drl,**/*.dsl"
-    	                />
+   <!-- =================================================================== -->
+   <!-- Recompiles all the classes                                            -->
+   <!-- =================================================================== -->
 
-    </target>
+   <target name="recompile" depends="clean,org.jboss.esb.services.compile"
+           description="Clean and compile"/>
 
-    <!-- =================================================================== -->
-    <!-- Test                                                               -->
-    <!-- =================================================================== -->
-    <target name="org.jboss.esb.services.test" description="Run tests for this module, excluding integration">
-        <!-- Compile tests -->
-        <ant dir="tests" target="org.jboss.esb.services.internal.test"/>
-    </target>
-	
-	<!-- =================================================================== -->
-	    <!-- Integration Test                                                               -->
-	    <!-- =================================================================== -->
-	    <target name="org.jboss.esb.services.integration.test" description="Run all tests for this module">
-	        <!-- Compile tests -->
-	        <ant dir="tests" target="org.jboss.esb.services.internal.integration.test"/>
-	    </target>
+   <!-- =================================================================== -->
+   <!-- Clean                                                               -->
+   <!-- =================================================================== -->
+   <target name="clean" description="Remove classes directory">
+      <ant dir="tests" target="clean"/>
+      <delete dir="${org.jboss.esb.services.classes.dir}"/>
+   </target>
 
+   <!-- =================================================================== -->
+   <!-- Rebuild everything from scratch                                     -->
+   <!-- =================================================================== -->
+   <target name="all" depends="recompile,jar"/>
+
+   <path id="org.jboss.esb.services.default.classpath">
+      <path refid="org.jboss.esb.services.base.classpath"/>
+      <pathelement location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
+      <pathelement location="${org.jboss.esb.internal.dest}/classes/listeners"/>
+   </path>
+
+   <!-- =================================================================== -->
+   <!-- Jar                                                               -->
+   <!-- =================================================================== -->
+   <target name="jar" description="Assemble jar files"
+           depends="org.jboss.esb.services.compile"
+           >
+      <jar destfile="${org.jboss.esb.services.dist.dir}/lib/jbossesb-services.jar"
+           basedir="${org.jboss.esb.services.classes.dir}"
+           includes="**/*.class"
+           excludes="org/jboss/internal/soa/esb/services/registry/*.class"/>
+      <!-- keep registry impl separate/isolated because it requires scoped jar in JBoss -->
+      <jar destfile="${org.jboss.esb.services.dist.dir}/lib/jbossesb-registry.jar"
+           basedir="${org.jboss.esb.services.classes.dir}"
+           includes="org/jboss/internal/soa/esb/services/registry/*.class"/>
+      <jar destfile="${org.jboss.esb.services.dist.dir}/lib/jbossesb-rules.jar"
+           basedir="${org.jboss.esb.services.rules.dir}"
+           includes="**/*.drl,**/*.dsl"
+              />
+
+   </target>
+
+   <!-- =================================================================== -->
+   <!-- Test                                                               -->
+   <!-- =================================================================== -->
+   <target name="org.jboss.esb.services.test" description="Run tests for this module, excluding integration">
+      <!-- Compile tests -->
+      <ant dir="tests" target="org.jboss.esb.services.internal.test"/>
+   </target>
+
+   <!-- =================================================================== -->
+   <!-- Integration Test                                                               -->
+   <!-- =================================================================== -->
+   <target name="org.jboss.esb.services.integration.test" description="Run all tests for this module">
+      <!-- Compile tests -->
+      <ant dir="tests" target="org.jboss.esb.services.internal.integration.test"/>
+   </target>
+
 </project>

Added: labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.services.registry;
+
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+/**
+ * Service to isolate registry because of classloader dependency
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JAXRRegistryService extends ServiceMBeanSupport implements JAXRRegistryServiceMBean
+{
+   @Override
+   protected void createService() throws Exception
+   {
+      final Registry registry = RegistryFactory.createRegistry();
+      Class[] intfs = {Registry.class};
+
+      RegistryFactory.singleton = (Registry) Proxy.newProxyInstance(Registry.class.getClassLoader(), intfs, new InvocationHandler()
+      {
+         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+         {
+            ClassLoader old = Thread.currentThread().getContextClassLoader();
+            Thread.currentThread().setContextClassLoader(JAXRRegistryService.class.getClassLoader());
+            try
+            {
+               return method.invoke(registry, args);
+            }
+            finally
+            {
+               Thread.currentThread().setContextClassLoader(old);
+            }
+         }
+
+      });
+   }
+}

Added: labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.services.registry;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JAXRRegistryServiceMBean extends ServiceMBean
+{
+}

Modified: labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
===================================================================
--- labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/core/services/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2007-02-15 23:04:56 UTC (rev 9542)
@@ -36,32 +36,43 @@
 {
 	private static Logger logger = Logger.getLogger(RegistryFactory.class);
 
-	public static Registry getRegistry() throws RegistryException
+   public static Registry singleton;
+
+
+   public static Registry getRegistry() throws RegistryException
 	{
-		Registry registry = null;
-		String className = Configuration.getRegistryImplementationClass();
-		logger.log(Priority.DEBUG, "Going to load " + className);
-		
-		try
+      // no synchronized block as there should be a service that initializes this
+      if (singleton != null) return singleton;
+      return createRegistry();
+	}
+
+   public static Registry createRegistry()
+           throws RegistryException
+   {
+      Registry registry = null;
+      String className = Configuration.getRegistryImplementationClass();
+      logger.log(Priority.DEBUG, "Going to load " + className);
+
+      try
 		{
 			// instruct class loader to load the Registry Implementation
-			Class registryClass = getClassForName(className);
-			// Try to instance the Registry
-			registry = (Registry) registryClass.newInstance();
-		}
-		catch (ClassNotFoundException cnfex)
-		{
-			throw new RegistryException("Registry Implementation=" + className
-					+ " not found", cnfex);
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-			
-			throw new RegistryException("Invocation exception. "
-					+ e.getLocalizedMessage(), e);
-		}
-		
-		return registry;
-	}
+         Class registryClass = getClassForName(className);
+         // Try to instance the Registry
+         registry = (Registry) registryClass.newInstance();
+      }
+      catch (ClassNotFoundException cnfex)
+      {
+         throw new RegistryException("Registry Implementation=" + className
+               + " not found", cnfex);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+
+         throw new RegistryException("Invocation exception. "
+               + e.getLocalizedMessage(), e);
+      }
+
+      return registry;
+   }
 }

Modified: labs/jbossesb/workspace/bburke/product/install/build.xml
===================================================================
--- labs/jbossesb/workspace/bburke/product/install/build.xml	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/install/build.xml	2007-02-15 23:04:56 UTC (rev 9542)
@@ -68,7 +68,9 @@
 		<copy  todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy">
 			<fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb-dependencies.sar/**"/></copy>
 		<copy  todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy">
-			<fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb.sar/**"/></copy>
+			<fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb-registry.sar/**"/></copy>
+      <copy  todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy">
+         <fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb.sar/**"/></copy>
 		<touch file="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy/jbossesb.sar/META-INF/jboss-service.xml"/>
 	</target>
 	
@@ -77,6 +79,8 @@
 		<delete dir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy/jbossesb-dependencies.sar"/>
 		<echo>Deleting jbossesb.sar</echo>
 		<delete dir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy/jbossesb.sar"/>
+      <echo>Deleting jbossesb-registry.sar</echo>
+      <delete dir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy/jbossesb-registry.sar"/>
 	</target>
 	
 	<target name="jboss.sar.jbossrules.deploy" description="Deploys JBoss Rules to the jbossesb-dependencies.sar">
@@ -160,22 +164,24 @@
 			
 	<target name="build.sar">
 		<echo message="Building JBoss ESB sar file"/>
-		<delete dir="${org.jboss.esb.dist.lib}/jbossesb.sar" />
-		<mkdir dir="${org.jboss.esb.dist.lib}/jbossesb.sar" />
-		<mkdir dir="${org.jboss.esb.dist.lib}/jbossesb.sar/META-INF" />
-		<copy file="jboss-service.xml" 
-			todir="${org.jboss.esb.dist.lib}/jbossesb.sar/META-INF"/>
-		<copy todir="${org.jboss.esb.dist.lib}/jbossesb.sar">
-			<fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb*.jar"
-				excludes="jbossesb-dependencies.jar" /></copy>
-		<copy todir="${org.jboss.esb.dist.lib}/jbossesb.sar">
-			<!-- properties-file reader -->
-			<fileset dir="${org.jboss.esb.dist.lib}/ext" includes="jbossts-common.jar"/>
-			<!-- jaxr and scout -->
-			<fileset dir="${org.jboss.esb.dist.lib}/ext" includes="jaxr-api-1.0-SNAPSHOT.jar,
-				scout-1.0-SNAPSHOT.jar"/>
-		</copy>
-		
+
+      <delete dir="${org.jboss.esb.dist.lib}/jbossesb.sar" />
+      <mkdir dir="${org.jboss.esb.dist.lib}/jbossesb.sar" />
+      <mkdir dir="${org.jboss.esb.dist.lib}/jbossesb.sar/META-INF" />
+      <copy file="jboss-service.xml"
+         todir="${org.jboss.esb.dist.lib}/jbossesb.sar/META-INF"/>
+      <delete dir="${org.jboss.esb.dist.lib}/jbossesb-registry.sar" />
+      <mkdir dir="${org.jboss.esb.dist.lib}/jbossesb-registry.sar" />
+      <mkdir dir="${org.jboss.esb.dist.lib}/jbossesb-registry.sar/META-INF" />
+      <copy todir="${org.jboss.esb.dist.lib}/jbossesb-registry.sar">
+         <!-- jaxr and scout -->
+         <fileset dir="${org.jboss.esb.dist.lib}/ext" includes="jaxr-api-1.0-SNAPSHOT.jar,
+            scout-1.0-SNAPSHOT.jar"/>
+         <fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb-registry.jar"/>
+      </copy>
+      <copy file="jboss-service-registry.xml"
+         tofile="${org.jboss.esb.dist.lib}/jbossesb-registry.sar/META-INF/jboss-service.xml"/>
+
 		<echo message="Building JBoss ESB dependencies sar file"/>
 		<delete dir="${org.jboss.esb.dist.lib}/jbossesb-dependencies.sar" />
 		<mkdir dir="${org.jboss.esb.dist.lib}/jbossesb-dependencies.sar" />
@@ -183,8 +189,9 @@
 		<copy file="jboss-service-dependencies.xml" 
 			tofile="${org.jboss.esb.dist.lib}/jbossesb-dependencies.sar/META-INF/jboss-service.xml"/>
 		<copy todir="${org.jboss.esb.dist.lib}/jbossesb-dependencies.sar">
-			<fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb-dependencies.jar"/></copy>    			
-		<copy todir="${org.jboss.esb.dist.lib}/jbossesb-dependencies.sar">
+         <fileset dir="${org.jboss.esb.dist.lib}/ext" includes="jbossts-common.jar"/>
+         <fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb*.jar"
+            excludes="jbossesb-registry.jar" />
 			<!-- xbean for reading/marchalling xml for configuration, and scout -->
 			<fileset dir="${org.jboss.esb.dist.lib}/ext" includes="xbean.jar,stax-api-1.0.1.jar,xmlpublic.jar"/>
 			<!-- jUDDI Registry -->

Modified: labs/jbossesb/workspace/bburke/product/install/jboss-service-dependencies.xml
===================================================================
--- labs/jbossesb/workspace/bburke/product/install/jboss-service-dependencies.xml	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/install/jboss-service-dependencies.xml	2007-02-15 23:04:56 UTC (rev 9542)
@@ -2,14 +2,7 @@
 
 <server>
     <mbean code="org.jboss.internal.soa.esb.dependencies.JBossESBDependenciesService" 
-        name="jboss.org:service=JBossESBDependencies"
+        name="jboss.esb:service=JBossESBDependencies"
         description="Container for the JBossESB Dependencies">
     </mbean>
-    <!--  Registers the Juddi RMI Service to JNDI -->
-    <mbean code="org.jboss.internal.soa.esb.dependencies.JuddiRMIService" 
-        name="jboss.org:service=JuddiRMI"
-        description="Juddi RMI Service">
-        <depends>jboss.org:service=JBossESBDependencies</depends>
-        <depends>jboss.jca:service=DataSourceBinding,name=juddiDB</depends>
-    </mbean>
 </server>
\ No newline at end of file

Added: labs/jbossesb/workspace/bburke/product/install/jboss-service-registry.xml
===================================================================
--- labs/jbossesb/workspace/bburke/product/install/jboss-service-registry.xml	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/install/jboss-service-registry.xml	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean code="org.jboss.internal.soa.esb.services.registry.JAXRRegistryService"
+           name="jboss.esb:service=ESBRegistry">
+     <depends>jboss.esb:service=JBossESBDependencies</depends>
+   </mbean>
+   <loader-repository>
+       org.jboss.soa.esb:loader=jbossesb.sar
+   </loader-repository>
+</server>
\ No newline at end of file

Modified: labs/jbossesb/workspace/bburke/product/install/jboss-service.xml
===================================================================
--- labs/jbossesb/workspace/bburke/product/install/jboss-service.xml	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/install/jboss-service.xml	2007-02-15 23:04:56 UTC (rev 9542)
@@ -2,15 +2,18 @@
 
 <server>
   <!--  Starts the listener controler -->
-  <mbean code="org.jboss.soa.esb.listeners.config.ConfigurationControllerService" 
-  	     name="jboss.org:service=ConfigurationController"
-  	     description="Configuration controller which generated the config files for the listener and gateway controllers">
-    <attribute name="ConfigurationFile">jbossesb.xml</attribute>
-    <depends>jboss.org:service=JBossESBDependencies</depends>
-    <depends>jboss.org:service=JuddiRMI</depends>
+   <!--  Registers the Juddi RMI Service to JNDI -->
+   <mbean code="org.jboss.internal.soa.esb.dependencies.JuddiRMIService"
+       name="jboss.esb:service=JuddiRMI"
+       description="Juddi RMI Service">
+      <depends>jboss.esb:service=JBossESBDependencies</depends>
+       <depends>jboss.jca:service=DataSourceBinding,name=juddiDB</depends>
+   </mbean>
+  <mbean code="org.jboss.soa.esb.listeners.config.JBoss4ESBDeployer"
+  	     name="jboss.esb:service=ESBDeployer">
+    <depends>jboss.esb:service=JBossESBDependencies</depends>
+    <depends>jboss.esb:service=ESBRegistry</depends>
+    <depends>jboss.esb:service=JuddiRMI</depends>
     <depends>jboss.jca:service=DataSourceBinding,name=JBossESBDS</depends>
   </mbean>
-  <loader-repository>
-		org.jboss.soa.esb:loader=jbossesb.sar
-  </loader-repository>
 </server>
\ No newline at end of file

Modified: labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/build.xml
===================================================================
--- labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/build.xml	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/build.xml	2007-02-15 23:04:56 UTC (rev 9542)
@@ -1,94 +1,105 @@
 <project name="Quickstart_helloworld" default="run" basedir=".">
-  
-  <property file="../quickstarts.properties" />
-  
-  <property name="build.dir" value="${basedir}/build"/>
-  <property name="src.dir" value="${basedir}/src"/>
-		
-  <property name="esb-config" value="${basedir}/jbossesb.xml"/>
 
-	<path id="classpath">
-    <!-- fileset dir="${basedir}" includes="jbossesb-properties.xml" -->
-    <!-- fileset dir="${basedir}" includes="juddi.properties" -->
-    <fileset dir="${basedir}/lib" includes="*jar"/>    
-	<fileset dir="${esb.product.lib.dir}" includes="*jar"/>
-	<fileset dir="${esb.product.lib.dir}" includes="*xml"/>
-	<fileset dir="${esb.product.lib.dir}/ext" includes="*jar"/>
-	<fileset dir="${jbosshome.dir}/client" includes="*jar"/>
-	<fileset dir="${jbosshome.dir}/server/default/lib">
-			<include name="jboss-j2ee.jar"/> <!-- added this for the JMS client -->
-	</fileset>		
-  	
-  <fileset dir="${basedir}" includes="build/**/*.jar"/>
-  <fileset dir="${basedir}" includes="build/**/*.xml"/>
-  <pathelement location="." />
-  
-  </path>
- 
-  <property name="cp" refid="classpath"/>
-  
-  <target name="echoCP">    
-  	<echo message="Classpath is ${cp}"/>
-  </target>
-  
-  <target name="prepare">
-	<mkdir dir="${build.dir}" />
-  </target>
+   <property file="../quickstarts.properties"/>
 
-  <target name="clean">
-	<delete dir="${build.dir}" />
-  </target>
+   <property name="build.dir" value="${basedir}/build"/>
+   <property name="src.dir" value="${basedir}/src"/>
 
-  <target name="compile" depends="prepare">
-	<javac srcdir="${src.dir}"
-	   destdir="${build.dir}">
-	  <classpath refid="classpath"/>
- 	</javac>
-  </target>
+   <property name="esb-config" value="${basedir}/jbossesb.xml"/>
 
-  <target name="jars" depends="compile">
-	<delete file="${build.dir}/${ant.project.name}.jar"/>
-        <jar destfile="${build.dir}/${ant.project.name}.jar"
-		basedir="${build.dir}"
-		includes="**/*.class"/>
-  </target>
+   <path id="classpath">
+      <!-- fileset dir="${basedir}" includes="jbossesb-properties.xml" -->
+      <!-- fileset dir="${basedir}" includes="juddi.properties" -->
+      <fileset dir="${basedir}/lib" includes="*jar"/>
+      <fileset dir="${esb.product.lib.dir}" includes="*jar"/>
+      <fileset dir="${esb.product.lib.dir}" includes="*xml"/>
+      <fileset dir="${esb.product.lib.dir}/ext" includes="*jar"/>
+      <fileset dir="${jbosshome.dir}/client" includes="*jar"/>
+      <fileset dir="${jbosshome.dir}/server/default/lib">
+         <include name="jboss-j2ee.jar"/>
+         <!-- added this for the JMS client -->
+      </fileset>
 
-  <target name="run" depends="jars">
-	     <echo>Basic JMS Gateway and Listener with Actions</echo>
-	     <java fork="yes" classname="org.jboss.soa.esb.listeners.StandAloneBootStrapper" failonerror="true">  
-	     	<arg value="${esb-config}"/>
-			<classpath refid="classpath"/>
-	     </java>     
-  </target>	
+      <fileset dir="${basedir}" includes="build/**/*.jar"/>
+      <fileset dir="${basedir}" includes="build/**/*.xml"/>
+      <pathelement location="."/>
 
-  <target name="deployToSAR" depends="jars">
-	    <echo>Deploys the project to the JBoss Application Server ESB SAR</echo>
-	  	<copy file="${build.dir}/${ant.project.name}.jar" overwrite="true"
-	  		todir="${jbosshome.dir}/server/default/deploy/jbossesb.sar"	
-	  	/>
-	  	<copy file="jbossesb.xml" overwrite="true"
-	  		todir="${jbosshome.dir}/server/default/conf"
-	  	/>
-	  	<touch file="${jbosshome.dir}/server/default/deploy/jbossesb.sar/META-INF/jboss-service.xml"/>
-	  	<echo>Check your AS console to see if everything deployed properly then run 'ant runtest'</echo>
-  </target>
-	
-  <target name="runtest">
-     <echo>Runs Test JMS Sender</echo>
-     <java fork="yes" classname="quickstart.helloworld.test.SendJMSMessage" failonerror="true">
-     	<arg value="Hello World"/>
-		<classpath refid="classpath"/>
-     </java>
-  </target>  
+   </path>
 
-  <target name="sendesb">
-     <echo>Runs Test ESB Message Sender</echo>
-     <java fork="yes" classname="quickstart.helloworld.test.SendEsbMessage" failonerror="true">
-     	<arg value="FirstServiceESB"/> <!--  service category -->
-     	<arg value="SimpleListener"/>  <!--  service name -->
-     	<arg value="Hello World - Straight to ESB listener - no Gateway"/> <!--  Message text -->
-		<classpath refid="classpath"/>
-     </java>
-  </target>  
+   <property name="cp" refid="classpath"/>
 
+   <target name="echoCP">
+      <echo message="Classpath is ${cp}"/>
+   </target>
+
+   <target name="prepare">
+      <mkdir dir="${build.dir}"/>
+   </target>
+
+   <target name="clean">
+      <delete dir="${build.dir}"/>
+   </target>
+
+   <target name="compile" depends="prepare">
+      <javac srcdir="${src.dir}"
+             destdir="${build.dir}">
+         <classpath refid="classpath"/>
+      </javac>
+   </target>
+
+   <target name="jars" depends="compile">
+      <delete file="${build.dir}/${ant.project.name}.jar"/>
+      <jar destfile="${build.dir}/${ant.project.name}.jar"
+           basedir="${build.dir}"
+           includes="**/*.class"/>
+      <mkdir dir="META-INF"/>
+      <copy file="jbossesb.xml" tofile="META-INF/jboss-esb.xml"/>
+      <jar destfile="${build.dir}/${ant.project.name}.esb">
+         <fileset dir="${build.dir}">
+            <include name="**/*.class"/>
+         </fileset>
+         <fileset dir=".">
+            <include name="esb-queues-service.xml"/>
+            <include name="META-INF/*.xml"/>
+         </fileset>
+      </jar>
+   </target>
+
+   <target name="run" depends="jars">
+      <echo>Basic JMS Gateway and Listener with Actions</echo>
+      <java fork="yes" classname="org.jboss.soa.esb.listeners.StandAloneBootStrapper" failonerror="true">
+         <arg value="${esb-config}"/>
+         <classpath refid="classpath"/>
+      </java>
+   </target>
+
+   <target name="deployToJBoss" depends="jars">
+      <echo>Deploys the project to the JBoss Application Server ESB SAR</echo>
+      <copy file="${build.dir}/${ant.project.name}.esb" overwrite="true"
+            todir="${jbosshome.dir}/server/default/deploy/"
+              />
+      <echo>Check your AS console to see if everything deployed properly then run 'ant runtest'</echo>
+   </target>
+
+   <target name="runtest">
+      <echo>Runs Test JMS Sender</echo>
+      <java fork="yes" classname="quickstart.helloworld.test.SendJMSMessage" failonerror="true">
+         <arg value="Hello World"/>
+         <classpath refid="classpath"/>
+      </java>
+   </target>
+
+   <target name="sendesb">
+      <echo>Runs Test ESB Message Sender</echo>
+      <java fork="yes" classname="quickstart.helloworld.test.SendEsbMessage" failonerror="true">
+         <arg value="FirstServiceESB"/>
+         <!--  service category -->
+         <arg value="SimpleListener"/>
+         <!--  service name -->
+         <arg value="Hello World - Straight to ESB listener - no Gateway"/>
+         <!--  Message text -->
+         <classpath refid="classpath"/>
+      </java>
+   </target>
+
 </project>
\ No newline at end of file

Added: labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/esb-queues-service.xml
===================================================================
--- labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/esb-queues-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/esb-queues-service.xml	2007-02-15 23:04:56 UTC (rev 9542)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=quickstart_helloworld_Request">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+  </mbean>
+
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=EsbChannel">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+  </mbean>
+
+</server>

Modified: labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/jbossesb.xml
===================================================================
--- labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/jbossesb.xml	2007-02-15 22:50:52 UTC (rev 9541)
+++ labs/jbossesb/workspace/bburke/product/samples/quickstarts/helloworld/jbossesb.xml	2007-02-15 23:04:56 UTC (rev 9542)
@@ -15,7 +15,7 @@
               <jms-bus busid="quickstartEsbChannel">
                   <jms-message-filter
                       dest-type="QUEUE"
-                      dest-name="queue/B"
+                      dest-name="queue/EsbChannel"
                   />
               </jms-bus>
 




More information about the jboss-svn-commits mailing list