[jboss-svn-commits] JBL Code SVN: r37031 - in labs/jbossesb/trunk/product: install and 32 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue May 24 20:45:18 EDT 2011


Author: tcunning
Date: 2011-05-24 20:45:17 -0400 (Tue, 24 May 2011)
New Revision: 37031

Added:
   labs/jbossesb/trunk/product/install/esb-deployers-jboss-beans-as6.xml
   labs/jbossesb/trunk/product/rosetta/deployer-as6/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/ivy-build.xml
   labs/jbossesb/trunk/product/rosetta/deployer-as6/ivysettings.xml
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java
   labs/jbossesb/trunk/product/rosetta/ivy.xml
   labs/jbossesb/trunk/product/services/jbpm/as6/
   labs/jbossesb/trunk/product/services/jbpm/as6/jbpm-identity-3.2.7.jar
Removed:
   labs/jbossesb/trunk/product/rosetta/deployer-as6/ivy-build.xml
   labs/jbossesb/trunk/product/rosetta/deployer-as6/ivysettings.xml
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/
   labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java
   labs/jbossesb/trunk/product/services/jbpm/as6/jbpm-identity-3.2.7.jar
Modified:
   labs/jbossesb/trunk/product/docs/
   labs/jbossesb/trunk/product/install/build.xml
   labs/jbossesb/trunk/product/rosetta/build.xml
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/WebDeploymentArchive.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/WebModel.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/templates/jboss-web.xml.ftl
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/JBossDeployerUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/camel/CamelGateway.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authdomain_jbosswebxml.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authdomain_webxml.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authmethod_jbosswebxml.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authmethod_webxml.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml
   labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
   labs/jbossesb/trunk/product/services/base-project-build.xml
   labs/jbossesb/trunk/product/services/jbossesb/build.properties
   labs/jbossesb/trunk/product/services/jbpm/build.properties
   labs/jbossesb/trunk/product/services/jbpm/build.xml
   labs/jbossesb/trunk/product/services/jbrules/build.properties
   labs/jbossesb/trunk/product/services/slsb/build.properties
   labs/jbossesb/trunk/product/services/smooks/build.properties
   labs/jbossesb/trunk/product/services/soap/build.properties
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/cxf/CXFFactory.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/cxf/ServletControllerExtProviderFactory.java
   labs/jbossesb/trunk/product/services/spring/build.properties
Log:
JBESB-2760
Merge from the workspace where all of the AS6 support work has gone on
into trunk.  Changes support AS6 vfs and CXF.



Property changes on: labs/jbossesb/trunk/product/docs
___________________________________________________________________
Deleted: svn:mergeinfo
   - /labs/jbossesb/branches/JBESB_4_9_CP/product/docs:34609-36879

Modified: labs/jbossesb/trunk/product/install/build.xml
===================================================================
--- labs/jbossesb/trunk/product/install/build.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/install/build.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -43,6 +43,10 @@
         <property name="wise.includes" value="jaxb-xjc.jar"/>
 
 	<!-- Check for JBossAS5 -->
+    <condition property="jbossas6">
+        <available file="${server.dir}/deployers/weld.deployer"/>
+    </condition>
+
     <condition property="jbossas5">
         <available file="${server.dir}/deployers"/>
     </condition>
@@ -115,7 +119,8 @@
             <copy todir="${plugin.dir}" file="${jopr.plugin.jar}"/>
         </target>
 
-	<target name="deploy" depends="undeploy, internal.deploy, internal.deploy.jbossas5, deploy.console, deploy.bindings, update.modfilter"   description="Wrapper for internal.deploy"/>
+	<target name="deploy" depends="undeploy, internal.deploy, internal.deploy.jbossas5, internal.deploy.jbossas6,
+		deploy.console, deploy.bindings, update.modfilter"   description="Wrapper for internal.deploy"/>
 
 	<target name="check.tomcat.props">
 		<fail unless="org.jboss.esb.tomcat.home" message="Cannot determine target deployment, please check deployment.properties"/>
@@ -420,8 +425,31 @@
 		<delete file="${deploy.dir}/${esbModuleName}/META-INF/deployment.xml" failonerror="false" />
 		<move file="${deploy.dir}/${esbModuleName}/META-INF/deployment.xml.transformed" tofile="${deploy.dir}/${esbModuleName}/META-INF/deployment.xml" />
 	</target>	
+
+    <target name="internal.deploy.jbossas6" if="jbossas6" description="Deploys Internal Services to the JBossAS6">
+	<copy tofile="${deployers.dir}/esb.deployer/META-INF/esb-deployers-jboss-beans.xml" overwrite="true"
+		file="esb-deployers-jboss-beans-as6.xml"/>
+	<copy todir="${deployers.dir}/esb.deployer/lib">
+		<fileset dir="${org.jboss.esb.dist.lib}/ext" includes="jbossts-common.jar"/>
+	</copy>
+	<move file="${deploy.dir}/jbossesb.sar"
+		tofile="${deploy.dir}/jboss-esb.sar"/> 	
+
+	<!-- Remove old jbpm-identity.jar, replace with the one 
+	     built against hibernate-3.6.0 			-->
+	<delete file="${deploy.dir}/jbpm.esb/jbpm-identity.jar"/>
+	<copy todir="${deploy.dir}/jbpm.esb"
+		file="${org.jboss.esb.dist}/install/as6-extras/jbpm/jbpm-identity-3.2.7.jar"/>
+
+	<!-- Need to copy the velocity JAR into the ws deployer -->
+	<copy todir="${deployers.dir}/jbossws.deployer"
+		file="${org.jboss.esb.server.home}/client/velocity.jar"
+		overwrite="true"/>
+
+	<mkdir dir="${server.dir}/data"/>
+    </target>
 	
-    <target name="undeploy" depends="check.deploy.props, undeploy.bindings, undeploy.jbossas5" description="Undeploy ESB components.">
+    <target name="undeploy" depends="check.deploy.props, undeploy.bindings, undeploy.jbossas5, undeploy.jbossas6" description="Undeploy ESB components.">
         <delete dir="${deploy.dir}/jbossesb.sar" quiet="true"/>
         <delete dir="${deploy.dir}/jbossesb-registry.sar" quiet="true"/>
         <delete dir="${deploy.dir}/jbossesb.esb" quiet="true"/>
@@ -445,7 +473,7 @@
         </delete>
     </target>
 	
-	<target name="undeploy.jbossas5" if="jbossas5" >
+    <target name="undeploy.jbossas5" if="jbossas5" >
         <delete dir="${server.dir}/deployers/esb.deployer" quiet="true"/>
         <delete quiet="false">
             <fileset dir="${server.lib.dir}" >
@@ -454,6 +482,11 @@
         </delete>
     </target>
 
+    <target name="undeploy.jbossas6" if="jbossas6" >
+        <delete dir="${server.dir}/jboss-esb.sar" quiet="true"/>
+    </target>
+
+
         <property name="org.jboss.esb.tomcat.55lib"
             location="${org.jboss.esb.tomcat.home}/common/lib"/>
         <property name="org.jboss.esb.tomcat.60lib"

Copied: labs/jbossesb/trunk/product/install/esb-deployers-jboss-beans-as6.xml (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/install/esb-deployers-jboss-beans-as6.xml)
===================================================================
--- labs/jbossesb/trunk/product/install/esb-deployers-jboss-beans-as6.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/install/esb-deployers-jboss-beans-as6.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+    
+    <bean name="EsbPropertyService" class="org.jboss.soa.esb.common.JBossESBPropertyService">
+        <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.esb:service=PropertyService", exposedInterface=org.jboss.soa.esb.common.JBossESBPropertyServiceMBean.class, registerDirectly=true)</annotation>
+        <property name="propertyFile">
+            <!-- Use the ServiceBindingManager to process (xslt) jbossesb-properties.xml and set the result to the PropertyFile attribute.-->
+            <value-factory bean="ServiceBindingManager" method="getResourceBinding">
+                <!-- serviceName -->
+                <parameter>EsbPropertyService</parameter>
+                <!-- input -->
+                <parameter>jbossesb-properties.xml</parameter>
+            </value-factory>
+        </property>
+        <property name="propertiesFileDir">${jboss.server.data.dir}</property>
+    </bean>
+
+    <bean name="GroupingStructure" class="org.jboss.soa.esb.listeners.deployers.mc.as6.GroupingStructure">
+        <property name="shortCircuitFilter">
+            <inject bean="EsbFilter"/>
+        </property>
+        <property name="metaDataPaths">
+            <array elementClass="java.lang.String">
+                <value>META-INF</value>
+                <value>.</value>
+            </array>
+        </property>
+        <property name="libs">
+            <set elementClass="java.lang.String">
+                <value>.</value>
+                <value>jars</value>
+                <value>lib</value>
+            </set>
+        </property>
+        <property name="libFilter">
+            <inject bean="JarFilter"/>
+        </property>
+        <property name="groups">
+            <set elementClass="java.lang.String">
+                <value>.</value>
+                <value>wars</value>
+            </set>
+        </property>
+        <property name="groupFilter">
+            <inject bean="WarFilter"/>
+        </property>
+    </bean>
+	
+	<bean name="EsbConfigParser" class="org.jboss.soa.esb.listeners.deployers.mc.as6.EsbConfigParser">
+		<property name="esbArtifactName">jbossesb</property>
+		<property name="esbDeploymentPrefix">jboss.esb:deployment=</property>
+		<property name="warDeploymentPrefix">jboss.web.deployment:war=</property>
+		<property name="actionArtifactsFile">/actionArtifactMap.properties</property>
+	</bean>
+
+	<bean name="EsbDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.as6.EsbDeployer">
+		<property name="esbBeanPrefix">jboss.esb</property>
+		<property name="mainDeployer"><inject bean="MainDeployer"/></property>
+		<property name="warFilesDir">${jboss.server.temp.dir}</property>
+		<depends>EsbPropertyService</depends>
+	</bean>
+	
+	<bean name="EsbFilter" class="org.jboss.soa.esb.listeners.deployers.mc.as6.util.VfsFileFilter">
+        <constructor>
+            <parameter>.esb</parameter>
+        </constructor>
+    </bean>
+    
+    <bean name="JarFilter" class="org.jboss.soa.esb.listeners.deployers.mc.as6.util.VfsFileFilter">
+        <constructor>
+            <parameter>.jar</parameter>
+        </constructor>
+    </bean>
+    
+    <bean name="WarFilter" class="org.jboss.soa.esb.listeners.deployers.mc.as6.util.VfsFileFilter">
+        <constructor>
+            <parameter>.war</parameter>
+        </constructor>
+    </bean>
+
+</deployment>

Modified: labs/jbossesb/trunk/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/build.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/build.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 <project name="BuildJbossEsbRosetta" default="org.jboss.esb.rosetta.compile" basedir=".">
 
-	<property name="org.jboss.esb.rosetta.jar.name" value="jbossesb-rosetta"/>
-	<property name="org.jboss.esb.registry.jar.name" value="jbossesb-registry"/>
-	<property name="org.jboss.esb.registry.war.name" value="juddiv3.war"/>
-	<property name="org.jboss.esb.rosetta.distrib.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
-	<property name="org.jboss.esb.rosetta.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
+    <property name="org.jboss.esb.rosetta.jar.name" value="jbossesb-rosetta"/>
+    <property name="org.jboss.esb.registry.jar.name" value="jbossesb-registry"/>
+    <property name="org.jboss.esb.registry.war.name" value="juddiv3.war"/>
+    <property name="org.jboss.esb.rosetta.distrib.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
+    <property name="org.jboss.esb.rosetta.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
 
     <property name="uddi.webservices.jar" value="uddi-ws-3.0.4.jar"/>
     <property name="juddi.v3.war" value="juddiv3-3.0.2.war"/>
@@ -17,13 +17,17 @@
     <property name="org.jboss.esb.registry.war.resources.dir" location="${org.jboss.esb.registry.war.dir}/resources"/>
     <property name="org.jboss.esb.registry.war.classes.dir" location="${org.jboss.esb.internal.dest}/classes/registry"/>
 
+    <property name="org.jboss.esb.rosetta.as6.dir" location="deployer-as6"/>
+    <property name="org.jboss.esb.rosetta.as6.build.dir" location="${org.jboss.esb.internal.dest}/as6"/>
+    <property name="org.jboss.esb.rosetta.as6.src.dir" location="${org.jboss.esb.rosetta.as6.dir}/src"/>
+
     <property name="org.jboss.esb.rosetta.src.dir" location="src"/>
-	<property name="org.jboss.esb.root.dir" location="../"/>
-	<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
-	<property name="schema101.src.dir" location="${gendir}/src" />
-	<property name="schema101.classes.dir" location="${gendir}/classes" />
-	<property name="schema110.src.dir" location="${gendir}/src110" />
-	<property name="schema110.classes.dir" location="${gendir}/classes110" />
+    <property name="org.jboss.esb.root.dir" location="../"/>
+    <property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
+    <property name="schema101.src.dir" location="${gendir}/src" />
+    <property name="schema101.classes.dir" location="${gendir}/classes" />
+    <property name="schema110.src.dir" location="${gendir}/src110" />
+    <property name="schema110.classes.dir" location="${gendir}/classes110" />
     <property name="schema120.src.dir" location="${gendir}/src120" />
     <property name="schema120.classes.dir" location="${gendir}/classes120" />
     <property name="schema130.src.dir" location="${gendir}/src130" />
@@ -31,23 +35,42 @@
     <property environment="env"/>
 
     <property name="org.jboss.esb.lib.dir" location="${org.jboss.esb.internal.dest}/lib"/>
-	<property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
+    <property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
 	
-	<property name="security.jars" value="jboss-security-spi*.jar jbosssx*.jar"/>
+    <property name="security.jars" value="jboss-security-spi*.jar jbosssx*.jar"/>
 
-	<path id="org.jboss.esb.rosetta.base.classpath">
+    <path id="org.jboss.esb.rosetta.base.classpath">
         <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
         <fileset dir="${org.jboss.esb.ext.lib.dir}/endorsed" includes="jboss-saaj.jar"/>
         <fileset dir="${org.jboss.esb.lib.dir}" includes="${security.jars}"/>
         <fileset dir="${org.jboss.esb.lib.dir}" includes="*.jar" excludes="${security.jars}"/>
         <fileset dir="../../testlib" includes="emma*.jar"/>
         <fileset dir="${org.jboss.esb.ext.lib.dir}/standalone" includes="*.jar"/>
-		<pathelement location="${schema101.classes.dir}"/>
-		<pathelement location="${schema110.classes.dir}"/>
+	<pathelement location="${schema101.classes.dir}"/>
+	<pathelement location="${schema110.classes.dir}"/>
         <pathelement location="${schema120.classes.dir}"/>
         <pathelement location="${schema130.classes.dir}"/>
-	</path>
+    </path>
 
+    <path id="org.jboss.esb.rosetta.as6.classpath">
+        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
+        <fileset dir="${org.jboss.esb.ext.lib.dir}/endorsed" includes="jboss-saaj.jar"/>
+	<fileset dir="${org.jboss.esb.rosetta.as6.build.dir}/lib" includes="*.jar"/>
+        <fileset dir="${org.jboss.esb.lib.dir}">
+          <patternset id="as6.jars">
+	    <include name="*.jar"/>
+            <exclude name="*jboss-deployers*"/>
+ 	    <exclude name="*vfs*"/>
+          </patternset>
+	</fileset>
+        <fileset dir="../../testlib" includes="emma*.jar"/>
+        <fileset dir="${org.jboss.esb.ext.lib.dir}/standalone" includes="*.jar"/>
+	<pathelement location="${schema101.classes.dir}"/>
+	<pathelement location="${schema110.classes.dir}"/>
+        <pathelement location="${schema120.classes.dir}"/>
+        <pathelement location="${schema130.classes.dir}"/>
+    </path>
+
     <target name="org.jboss.esb.rosetta.init">
         <tstamp>
             <format property="TODAY" pattern="dd-MM-yy"/>
@@ -65,12 +88,36 @@
     <target name="clean" description="Remove classes directory">
         <ant dir="tests" target="clean"/>
     	<delete dir="${org.jboss.esb.rosetta.classes.dir}"/>
+	<delete dir="${org.jboss.esb.rosetta.as6.build.dir}"/>
     </target>
 
-    <target name="org.jboss.esb.rosetta.compile" depends="generate-config-model, org.jboss.esb.rosetta.internal.compile, war">
+    <target name="org.jboss.esb.rosetta.compile" depends="generate-config-model, org.jboss.esb.rosetta.internal.compile, as6.compile, war">
         <ant inheritAll="true" dir="tests" target="org.jboss.esb.rosetta.tests.compile"/>
     </target>
 
+    <target name="as6.dependencies.get">
+        <ant antfile="${org.jboss.esb.rosetta.as6.dir}/ivy-build.xml"/>
+	<property name="as6.jar.files" refid="org.jboss.esb.rosetta.as6.classpath"/>
+        <echo>as6.jar.files=${as6.jar.files}</echo>
+	<echo/>
+	<echo/>
+	<property name="base.classpath" refid="org.jboss.esb.rosetta.base.classpath"/>
+        <echo>base.classpath=${base.classpath}</echo>
+
+    </target>
+    
+    <target name="as6.compile" depends="org.jboss.esb.rosetta.prepare, as6.dependencies.get"
+        description="Compile the AS6 deployer">
+        <javac
+            destdir="${org.jboss.esb.rosetta.classes.dir}"
+            classpathref="org.jboss.esb.rosetta.as6.classpath"
+            debug="${org.jboss.esb.debug}"
+            optimize="${org.jboss.esb.optimize}"
+            >
+            <src path="${org.jboss.esb.rosetta.as6.src.dir}"/>
+        </javac>
+    </target>
+
     <target name="org.jboss.esb.rosetta.internal.compile" depends="org.jboss.esb.rosetta.prepare"
         description="Compile all classes">
 

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/ivy-build.xml
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/ivy-build.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/ivy-build.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,30 +0,0 @@
-<project name="as6.dependencies" default="retrieve" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
-
-    <property name="ivy.lib.dir" value="${basedir}/../build/as6/lib" />
-    <path id="classpath.ivy">
-        <fileset dir="${basedir}/../../antlib" includes="ivy-*.jar" />
-    </path>
-    <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="classpath.ivy" />
-
-    <target name="ivy.init">
-	<mkdir dir="${ivy.lib.dir}"/>
-        <ivy:settings file="${basedir}/deployer-as6/ivysettings.xml"/>
-    </target>
-
-    <target name="retrieve" depends="ivy.init">
-        <ivy:retrieve log="quiet"/>
-    </target>
-
-    <target name="clean">
-        <delete dir="${ivy.lib.dir}" quiet="true"/>
-    </target>
-
-    <target name="cleancache" depends="ivy.init">
-        <ivy:cleancache />
-    </target>
-
-    <target name="report" depends="retrieve" description="--> generates a report of dependencies">
-        <ivy:report todir="${ivy.lib.dir}"/>
-    </target>
-
-</project>

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/ivy-build.xml (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/ivy-build.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/ivy-build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/ivy-build.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,30 @@
+<project name="as6.dependencies" default="retrieve" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
+
+    <property name="ivy.lib.dir" value="${basedir}/../build/as6/lib" />
+    <path id="classpath.ivy">
+        <fileset dir="${basedir}/../../antlib" includes="ivy-*.jar" />
+    </path>
+    <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="classpath.ivy" />
+
+    <target name="ivy.init">
+	<mkdir dir="${ivy.lib.dir}"/>
+        <ivy:settings file="${basedir}/deployer-as6/ivysettings.xml"/>
+    </target>
+
+    <target name="retrieve" depends="ivy.init">
+        <ivy:retrieve log="quiet"/>
+    </target>
+
+    <target name="clean">
+        <delete dir="${ivy.lib.dir}" quiet="true"/>
+    </target>
+
+    <target name="cleancache" depends="ivy.init">
+        <ivy:cleancache />
+    </target>
+
+    <target name="report" depends="retrieve" description="--> generates a report of dependencies">
+        <ivy:report todir="${ivy.lib.dir}"/>
+    </target>
+
+</project>

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/ivysettings.xml
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/ivysettings.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/ivysettings.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,17 +0,0 @@
-<ivysettings>
-
-    <settings defaultResolver="chained"/>
-    <resolvers>
-        <chain name="chained">
-            <url name="jboss" m2compatible="true">
-                <artifact pattern="http://repository.jboss.org/maven2/[organisation]/[artifact]/[revision]/[artifact]-[revision].[ext]"/>
-            </url>
-            <url name="jboss-nexus" m2compatible="true">
-                <artifact pattern="https://repository.jboss.org/nexus/content/groups/public/[organisation]/[artifact]/[revision]/[artifact]-[revision].[ext]"/>
-            </url>
-            <ibiblio name="ibiblio" m2compatible="true"/> 
-        </chain>
-    </resolvers>
-    <modules>
-    </modules>
-</ivysettings>

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/ivysettings.xml (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/ivysettings.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/ivysettings.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/ivysettings.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,17 @@
+<ivysettings>
+
+    <settings defaultResolver="chained"/>
+    <resolvers>
+        <chain name="chained">
+            <url name="jboss" m2compatible="true">
+                <artifact pattern="http://repository.jboss.org/maven2/[organisation]/[artifact]/[revision]/[artifact]-[revision].[ext]"/>
+            </url>
+            <url name="jboss-nexus" m2compatible="true">
+                <artifact pattern="https://repository.jboss.org/nexus/content/groups/public/[organisation]/[artifact]/[revision]/[artifact]-[revision].[ext]"/>
+            </url>
+            <ibiblio name="ibiblio" m2compatible="true"/> 
+        </chain>
+    </resolvers>
+    <modules>
+    </modules>
+</ivysettings>

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,385 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- * 
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * 
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.deployers.mc.as6;
-    
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.log4j.Logger;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
-import org.jboss.metadata.MetaData;
-import org.jboss.metadata.XmlFileLoader;
-import org.jboss.mx.util.ObjectNameConverter;
-import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
-import org.jboss.vfs.VirtualFile;
-import org.jboss.vfs.VirtualFileFilter;
-import org.w3c.dom.Element;
-
-/**
- * EsbConfigParser is a Microcontainer deployer that picks up jboss-esb.xml files, parses the content
- * and produces an {@link EsbMetaData} instance.
- * <p/>
- * Other implementations could read/parse a configuration form another source, for example store
- * the configurations in a database. As long as they produce the EsbMetaData they will be able to
- * be deployed.
- * 
- * Sample configuration:
- * <pre>{@code
- *  <bean name="EsbConfigParser" class="org.jboss.soa.esb.listeners.deployers.mc.EsbConfigParser">
- *   <property name="esbDeploymentPrefix">jboss.esb:deployment=</property>
- *   <property name="warDeploymentPrefix">jboss.web.deployment:war=</property>
- *   <property name="actionArtifactsFile">/actionArtifactMap.properties</property>
- * </bean>
- * }</pre>
- * 
- * <lu>
- *  <li><i>esbDeploymentPrefix</i> This is the prefix that a ESB archive deployments will have in JBoss AS. Defaults to 'jboss.esb:deployment='.</li>
- *  <li><i>warDeploymentPrefix</i> This is the prefix that a war archive deployments will have in JBoss AS. These  
- *      are used for .war archives specified in the 'esb-depends' section of a deployment.xml file. Defaults to 'jboss.web.deployment:war='
- *  </li>
- *  <li><i>actionArtifactsFile</i> Properties file containing an action name to .esb archive mapping. Defaults to '/actionArtifactMap.properties'.  
- *  <br>
- *  For example, and entry in the file could look like this: <br>
- *  org.jboss.soa.esb.smooks.SmooksAction=smooks.esb
- *  <br>
- *  This says that the SmooksAction exists in the smooks.esb archive. Adding these mappings means that commonly 
- *  used actions don't need to be explicetely added to the deployment.xml of all deployments. These will be implicit
- *  instead.
- *  </li>
- * </lu>
- * 
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
- */
-public class EsbConfigParser extends AbstractVFSParsingDeployer<EsbMetaData>
-{
-    /**
-     * Name and path of the esb deployment.xml file.
-     */
-    private static final String ESB_DEPLOYMENT_XML = "META-INF/deployment.xml";
-    
-    /**
-     * File filter for esb config files.
-     */
-    private static EsbConfigFileFilter configFileFilter = new EsbConfigFileFilter();
-    
-    /**
-     * Default actions file name.
-     */
-    private String actionArtifactsFile = "/actionArtifactMap.properties";
-    
-    /**
-     * The actions to .esb archive mappings file.
-     */
-    private Properties actionArtifactProperties;
-    
-    /**
-     * Deployment prefix for esb deployments.
-     */
-    private String esbDeploymentPrefix = "jboss.esb:deployment=";
-    
-    /**
-     * The simple name of the jbossesb.esb deployment.
-     */
-    private String esbArtifactName = "jbossesb" ;
-    
-    /**
-     * Deployment prefix for war deployments. The are for the war declared in the 'esb-depends' section
-     * of deployment.xml.
-     */
-    private String warDeploymentPrefix = "jboss.web.deployment:war=";
-
-    /**
-     * Logger.
-     */
-    private Logger log = Logger.getLogger(EsbConfigParser.class);
-
-    /**
-     * Sole constructor that performs the following steps:
-     * <lu>
-     *  <li>Sets the output of this deployer to be {@link EsbMetaData}.</li>
-     *  <li>Sets the suffix to {@link EsbConfigParser#ESB_FILE_SUFFIX}.</li>
-     *  <li>Sets the jar extension to {@link EsbConfigParser#ESB_ARCHIVE_SUFFIX}.</li>
-     *  <li>Sets this deployers deployment stage to {@link DeploymentStages#PARSE}./li>
-     * </lu>
-     */
-    public EsbConfigParser()
-    {
-        super(EsbMetaData.class);
-        setSuffix(EsbConstants.ESB_FILE_SUFFIX);
-        setJarExtension(EsbConstants.ESB_ARCHIVE_SUFFIX);
-        setStage(DeploymentStages.PARSE);
-    }
-
-    /**
-     * Create will load the action artifacts file configured.
-     * 
-     * @throws Exception If the action artifacts files cannot be loaded.
-     */
-    public void create() throws Exception
-    {
-        log.info("Created");
-        actionArtifactProperties = JBossDeployerUtil.getArtifactProperties(actionArtifactsFile);
-    }
-
-    /**
-     * Will parse the VirtualFile representing the deployment and parse the esb configuration xml and extract information from 
-     * the archive to create an {@link EsbMetaData} instance that will be returned.
-     */
-    @Override
-    protected EsbMetaData parse(final VFSDeploymentUnit deploymentUnit, final VirtualFile file, final EsbMetaData metadata) throws Exception
-    {
-        VirtualFile configFile = findEsbConfigFile(file);
-        final String esbConfigXml = JBossDeployerUtil.readEsbConfig(configFile.openStream());
-        final String archiveName = deploymentUnit.getSimpleName();
-        final String deploymentName = getDeploymentName(deploymentUnit);
-
-        //This model is used only to add the action dependecies, later the model is recreated in EsbDeployment destroy/create cycle.
-        final ModelAdapter model = JBossDeployerUtil.getJbossEsbModel(esbConfigXml);
-        
-        // Get dependencies from deployment.xml.
-        final Set<ObjectName> dependencies = getDependenciesFromDeploymentXml(deploymentUnit);
-        
-        // Get implicit action dependencies.
-        final Set<ObjectName> actionDependencies = getActionDependencies(deploymentName, model, actionArtifactProperties);
-        
-        // Add all dependencies to set.
-        dependencies.addAll(actionDependencies);
-        
-        final EsbMetaData esbMetaData = new EsbMetaData(configFile, archiveName, deploymentName, dependencies);
-        esbMetaData.setModel(model);
-        log.debug("Parsed ESB configuration'" + esbMetaData + "'");
-        return esbMetaData;
-    }
-    
-    /**
-     * Tries to rescursively find a file that ends with "-esb.xml".
-     *
-     * @param file          The virtual file. Can point to a file or a directory which will be searched.
-     * @return VirtualFile  VirtualFile representing a found configuration file.
-     * @throws DeploymentException If not configuration file could be found, or more than one was found.
-     * @throws IOException 
-     */
-    private VirtualFile findEsbConfigFile(final VirtualFile file) throws DeploymentException, IOException
-    {
-        if (file.getName().endsWith(EsbConstants.ESB_FILE_SUFFIX))
-        {
-            return file;
-        }
-        
-        VirtualFile child = file.getChild("META-INF");
-        log.info("META-INF : " + child);
-
-        List<VirtualFile> esbConfigFiles;
-        try
-        {
-            esbConfigFiles = file.getChildrenRecursively(configFileFilter);
-        }
-        catch (final IOException e)
-        {
-            throw new DeploymentException(e.getMessage(), e);
-        }
-
-        if (esbConfigFiles.size() == 0)
-        {
-            throw new DeploymentException("No JBossESB configuration could be located the archive '" + file + "'");
-        }
-        else if (esbConfigFiles.size() > 1)
-        {
-            throw new DeploymentException("Only one JBossESB configuration can exist in an archive. Please check '" + file + "'");
-        }
-        else
-        {
-            return esbConfigFiles.get(0);
-        }
-    }
-    
-    Set<ObjectName> getDependenciesFromDeploymentXml(final VFSDeploymentUnit unit) throws DeploymentException
-    {
-        final Set<ObjectName> dependencies = new HashSet<ObjectName>();
-        final VirtualFile deploymentXml = unit.getFile(ESB_DEPLOYMENT_XML);
-        
-        try
-        {
-            if (deploymentXml != null && deploymentXml.exists())
-            {
-                try
-                {
-                    XmlFileLoader xfl = new XmlFileLoader();
-                    Element jboss = xfl.getDocument(deploymentXml.openStream(), ESB_DEPLOYMENT_XML).getDocumentElement();
-                    // Check for a ejb level class loading config
-                    @SuppressWarnings("unchecked")
-                    Iterator depends = MetaData.getChildrenByTagName(jboss, "depends");
-                    if (depends != null)
-                    {
-                        while (depends.hasNext())
-                        {
-                            Element depend = (Element) depends.next();
-                            dependencies.add(new ObjectName(MetaData.getElementContent(depend)));
-                        }
-                    }
-                    @SuppressWarnings("unchecked")
-                    Iterator esbDepends = MetaData.getChildrenByTagName(jboss, "esb-depends");
-                    if ((esbDepends != null) && esbDepends.hasNext())
-                    {
-                        Element depend = (Element) esbDepends.next();
-                        final String deployable = MetaData.getElementContent(depend);
-                        if (deployable.endsWith(".war"))
-                        {
-                            String objectName = warDeploymentPrefix + "/" + deployable.substring(0, deployable.indexOf('.'));
-                            dependencies.add(new ObjectName(objectName));
-                        }
-                    }
-                }
-                catch (final MalformedObjectNameException e)
-                {
-                    throw new org.jboss.deployment.DeploymentException(e.getMessage(), e);
-                } 
-            }
-        } 
-        catch (final IOException e)
-        {
-            throw new DeploymentException(e.getMessage(), e);
-        }
-        return dependencies;
-    }
-    
-    
-    /**
-     * Will go through the actions defined in the model (model of the esb configuration) and for every
-     * action that is defined in action artifacts properties adds that action as a dependency.
-     * This way there is no need to explicetely define dependencies in a separate deployment.xml file.
-     * 
-     * @param deploymentName The name of the deployment
-     * @param model The {@link ModelAdapter} representing the esb configuration.
-     * @param actionArtifactProperties The predefined actions that are to be automatically included as dependencies.
-     * @return Set<ObjectName> A set of {@link ObjectName}s that this esb deployment depends on.
-     * @throws DeploymentException
-     */
-    private Set<ObjectName> getActionDependencies(final String deploymentName, final ModelAdapter model, final Properties actionArtifactProperties) throws DeploymentException
-    {
-        final Set<ObjectName> deps = new HashSet<ObjectName>();
-        
-        final Set<String> artifacts = new HashSet<String>() ;
-        
-        if (!deploymentName.equals(esbArtifactName))
-        {
-            artifacts.add(esbArtifactName + EsbConstants.ESB_ARCHIVE_SUFFIX) ;
-        }
-        
-        final Set<String> actionClasses = model.getActions() ;
-          
-        if (actionArtifactProperties != null)
-        {
-            final int numActionClasses = (actionClasses == null ? 0 : actionClasses.size()) ;
-            if (numActionClasses > 0)
-            {
-                for(final String actionClass: actionClasses)
-                {
-                    final String artifact = (String) actionArtifactProperties.get(actionClass) ;
-                    if (artifact != null)
-                    {
-                        artifacts.add(artifact) ;
-                    }
-                }
-            }
-        }
-          
-        for(final String artifact: artifacts)
-        {
-            if (!deploymentName.equals(artifact))
-            {
-                final String canonicalName = esbDeploymentPrefix + artifact ;
-                try
-                {
-                    ObjectName on = ObjectNameConverter.convert(canonicalName);
-                    deps.add(on) ;
-                } 
-                catch (MalformedObjectNameException e)
-                {
-                    throw new DeploymentException(e.getMessage(), e);
-                }
-            }
-        }
-        return deps;
-    }
-    
-    String getDeploymentName(final VFSDeploymentUnit deploymentUnit)
-    {
-        final String simpleName = deploymentUnit.getSimpleName();
-        int idx = simpleName.indexOf(EsbConstants.ESB_ARCHIVE_SUFFIX);
-        if (idx == -1)
-        {
-            return simpleName;
-        }
-        return simpleName.substring(0, simpleName.indexOf(EsbConstants.ESB_ARCHIVE_SUFFIX));
-    }
-
-    public void setActionArtifactsFile(final String actionArtifactsFile)
-    {
-        this.actionArtifactsFile = actionArtifactsFile;
-    }
-    
-    public void setEsbDeploymentPrefix(final String deploymentPrefix)
-    {
-        this.esbDeploymentPrefix = deploymentPrefix;
-    }
-    
-    public void setEsbArtifactName(final String esbArtifactName)
-    {
-        this.esbArtifactName = esbArtifactName;
-    }
-    
-    public void setWarDeploymentPrefix(final String deploymentPrefix)
-    {
-        this.warDeploymentPrefix = deploymentPrefix;
-    }
-
-    /**
-     * Filter for filtering out ESB configuration files.
-     *
-     */
-    private static class EsbConfigFileFilter implements VirtualFileFilter
-    {
-        /**
-         * Accepts only files ending with the ESB_FILE_SUFFIX.
-         * 
-         * @param file  The file to filter.
-         * @return true If the file name ends with "-esb.xml".
-         */
-        public boolean accepts(final VirtualFile file)
-        {
-            return file.getName().endsWith(EsbConstants.ESB_FILE_SUFFIX);
-        }
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConfigParser.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,385 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.as6;
+    
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.log4j.Logger;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.deployment.DeploymentException;
+import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
+import org.jboss.metadata.MetaData;
+import org.jboss.metadata.XmlFileLoader;
+import org.jboss.mx.util.ObjectNameConverter;
+import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VirtualFileFilter;
+import org.w3c.dom.Element;
+
+/**
+ * EsbConfigParser is a Microcontainer deployer that picks up jboss-esb.xml files, parses the content
+ * and produces an {@link EsbMetaData} instance.
+ * <p/>
+ * Other implementations could read/parse a configuration form another source, for example store
+ * the configurations in a database. As long as they produce the EsbMetaData they will be able to
+ * be deployed.
+ * 
+ * Sample configuration:
+ * <pre>{@code
+ *  <bean name="EsbConfigParser" class="org.jboss.soa.esb.listeners.deployers.mc.EsbConfigParser">
+ *   <property name="esbDeploymentPrefix">jboss.esb:deployment=</property>
+ *   <property name="warDeploymentPrefix">jboss.web.deployment:war=</property>
+ *   <property name="actionArtifactsFile">/actionArtifactMap.properties</property>
+ * </bean>
+ * }</pre>
+ * 
+ * <lu>
+ *  <li><i>esbDeploymentPrefix</i> This is the prefix that a ESB archive deployments will have in JBoss AS. Defaults to 'jboss.esb:deployment='.</li>
+ *  <li><i>warDeploymentPrefix</i> This is the prefix that a war archive deployments will have in JBoss AS. These  
+ *      are used for .war archives specified in the 'esb-depends' section of a deployment.xml file. Defaults to 'jboss.web.deployment:war='
+ *  </li>
+ *  <li><i>actionArtifactsFile</i> Properties file containing an action name to .esb archive mapping. Defaults to '/actionArtifactMap.properties'.  
+ *  <br>
+ *  For example, and entry in the file could look like this: <br>
+ *  org.jboss.soa.esb.smooks.SmooksAction=smooks.esb
+ *  <br>
+ *  This says that the SmooksAction exists in the smooks.esb archive. Adding these mappings means that commonly 
+ *  used actions don't need to be explicetely added to the deployment.xml of all deployments. These will be implicit
+ *  instead.
+ *  </li>
+ * </lu>
+ * 
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class EsbConfigParser extends AbstractVFSParsingDeployer<EsbMetaData>
+{
+    /**
+     * Name and path of the esb deployment.xml file.
+     */
+    private static final String ESB_DEPLOYMENT_XML = "META-INF/deployment.xml";
+    
+    /**
+     * File filter for esb config files.
+     */
+    private static EsbConfigFileFilter configFileFilter = new EsbConfigFileFilter();
+    
+    /**
+     * Default actions file name.
+     */
+    private String actionArtifactsFile = "/actionArtifactMap.properties";
+    
+    /**
+     * The actions to .esb archive mappings file.
+     */
+    private Properties actionArtifactProperties;
+    
+    /**
+     * Deployment prefix for esb deployments.
+     */
+    private String esbDeploymentPrefix = "jboss.esb:deployment=";
+    
+    /**
+     * The simple name of the jbossesb.esb deployment.
+     */
+    private String esbArtifactName = "jbossesb" ;
+    
+    /**
+     * Deployment prefix for war deployments. The are for the war declared in the 'esb-depends' section
+     * of deployment.xml.
+     */
+    private String warDeploymentPrefix = "jboss.web.deployment:war=";
+
+    /**
+     * Logger.
+     */
+    private Logger log = Logger.getLogger(EsbConfigParser.class);
+
+    /**
+     * Sole constructor that performs the following steps:
+     * <lu>
+     *  <li>Sets the output of this deployer to be {@link EsbMetaData}.</li>
+     *  <li>Sets the suffix to {@link EsbConfigParser#ESB_FILE_SUFFIX}.</li>
+     *  <li>Sets the jar extension to {@link EsbConfigParser#ESB_ARCHIVE_SUFFIX}.</li>
+     *  <li>Sets this deployers deployment stage to {@link DeploymentStages#PARSE}./li>
+     * </lu>
+     */
+    public EsbConfigParser()
+    {
+        super(EsbMetaData.class);
+        setSuffix(EsbConstants.ESB_FILE_SUFFIX);
+        setJarExtension(EsbConstants.ESB_ARCHIVE_SUFFIX);
+        setStage(DeploymentStages.PARSE);
+    }
+
+    /**
+     * Create will load the action artifacts file configured.
+     * 
+     * @throws Exception If the action artifacts files cannot be loaded.
+     */
+    public void create() throws Exception
+    {
+        log.info("Created");
+        actionArtifactProperties = JBossDeployerUtil.getArtifactProperties(actionArtifactsFile);
+    }
+
+    /**
+     * Will parse the VirtualFile representing the deployment and parse the esb configuration xml and extract information from 
+     * the archive to create an {@link EsbMetaData} instance that will be returned.
+     */
+    @Override
+    protected EsbMetaData parse(final VFSDeploymentUnit deploymentUnit, final VirtualFile file, final EsbMetaData metadata) throws Exception
+    {
+        VirtualFile configFile = findEsbConfigFile(file);
+        final String esbConfigXml = JBossDeployerUtil.readEsbConfig(configFile.openStream());
+        final String archiveName = deploymentUnit.getSimpleName();
+        final String deploymentName = getDeploymentName(deploymentUnit);
+
+        //This model is used only to add the action dependecies, later the model is recreated in EsbDeployment destroy/create cycle.
+        final ModelAdapter model = JBossDeployerUtil.getJbossEsbModel(esbConfigXml);
+        
+        // Get dependencies from deployment.xml.
+        final Set<ObjectName> dependencies = getDependenciesFromDeploymentXml(deploymentUnit);
+        
+        // Get implicit action dependencies.
+        final Set<ObjectName> actionDependencies = getActionDependencies(deploymentName, model, actionArtifactProperties);
+        
+        // Add all dependencies to set.
+        dependencies.addAll(actionDependencies);
+        
+        final EsbMetaData esbMetaData = new EsbMetaData(configFile, archiveName, deploymentName, dependencies);
+        esbMetaData.setModel(model);
+        log.debug("Parsed ESB configuration'" + esbMetaData + "'");
+        return esbMetaData;
+    }
+    
+    /**
+     * Tries to rescursively find a file that ends with "-esb.xml".
+     *
+     * @param file          The virtual file. Can point to a file or a directory which will be searched.
+     * @return VirtualFile  VirtualFile representing a found configuration file.
+     * @throws DeploymentException If not configuration file could be found, or more than one was found.
+     * @throws IOException 
+     */
+    private VirtualFile findEsbConfigFile(final VirtualFile file) throws DeploymentException, IOException
+    {
+        if (file.getName().endsWith(EsbConstants.ESB_FILE_SUFFIX))
+        {
+            return file;
+        }
+        
+        VirtualFile child = file.getChild("META-INF");
+        log.info("META-INF : " + child);
+
+        List<VirtualFile> esbConfigFiles;
+        try
+        {
+            esbConfigFiles = file.getChildrenRecursively(configFileFilter);
+        }
+        catch (final IOException e)
+        {
+            throw new DeploymentException(e.getMessage(), e);
+        }
+
+        if (esbConfigFiles.size() == 0)
+        {
+            throw new DeploymentException("No JBossESB configuration could be located the archive '" + file + "'");
+        }
+        else if (esbConfigFiles.size() > 1)
+        {
+            throw new DeploymentException("Only one JBossESB configuration can exist in an archive. Please check '" + file + "'");
+        }
+        else
+        {
+            return esbConfigFiles.get(0);
+        }
+    }
+    
+    Set<ObjectName> getDependenciesFromDeploymentXml(final VFSDeploymentUnit unit) throws DeploymentException
+    {
+        final Set<ObjectName> dependencies = new HashSet<ObjectName>();
+        final VirtualFile deploymentXml = unit.getFile(ESB_DEPLOYMENT_XML);
+        
+        try
+        {
+            if (deploymentXml != null && deploymentXml.exists())
+            {
+                try
+                {
+                    XmlFileLoader xfl = new XmlFileLoader();
+                    Element jboss = xfl.getDocument(deploymentXml.openStream(), ESB_DEPLOYMENT_XML).getDocumentElement();
+                    // Check for a ejb level class loading config
+                    @SuppressWarnings("unchecked")
+                    Iterator depends = MetaData.getChildrenByTagName(jboss, "depends");
+                    if (depends != null)
+                    {
+                        while (depends.hasNext())
+                        {
+                            Element depend = (Element) depends.next();
+                            dependencies.add(new ObjectName(MetaData.getElementContent(depend)));
+                        }
+                    }
+                    @SuppressWarnings("unchecked")
+                    Iterator esbDepends = MetaData.getChildrenByTagName(jboss, "esb-depends");
+                    if ((esbDepends != null) && esbDepends.hasNext())
+                    {
+                        Element depend = (Element) esbDepends.next();
+                        final String deployable = MetaData.getElementContent(depend);
+                        if (deployable.endsWith(".war"))
+                        {
+                            String objectName = warDeploymentPrefix + "/" + deployable.substring(0, deployable.indexOf('.'));
+                            dependencies.add(new ObjectName(objectName));
+                        }
+                    }
+                }
+                catch (final MalformedObjectNameException e)
+                {
+                    throw new org.jboss.deployment.DeploymentException(e.getMessage(), e);
+                } 
+            }
+        } 
+        catch (final IOException e)
+        {
+            throw new DeploymentException(e.getMessage(), e);
+        }
+        return dependencies;
+    }
+    
+    
+    /**
+     * Will go through the actions defined in the model (model of the esb configuration) and for every
+     * action that is defined in action artifacts properties adds that action as a dependency.
+     * This way there is no need to explicetely define dependencies in a separate deployment.xml file.
+     * 
+     * @param deploymentName The name of the deployment
+     * @param model The {@link ModelAdapter} representing the esb configuration.
+     * @param actionArtifactProperties The predefined actions that are to be automatically included as dependencies.
+     * @return Set<ObjectName> A set of {@link ObjectName}s that this esb deployment depends on.
+     * @throws DeploymentException
+     */
+    private Set<ObjectName> getActionDependencies(final String deploymentName, final ModelAdapter model, final Properties actionArtifactProperties) throws DeploymentException
+    {
+        final Set<ObjectName> deps = new HashSet<ObjectName>();
+        
+        final Set<String> artifacts = new HashSet<String>() ;
+        
+        if (!deploymentName.equals(esbArtifactName))
+        {
+            artifacts.add(esbArtifactName + EsbConstants.ESB_ARCHIVE_SUFFIX) ;
+        }
+        
+        final Set<String> actionClasses = model.getActions() ;
+          
+        if (actionArtifactProperties != null)
+        {
+            final int numActionClasses = (actionClasses == null ? 0 : actionClasses.size()) ;
+            if (numActionClasses > 0)
+            {
+                for(final String actionClass: actionClasses)
+                {
+                    final String artifact = (String) actionArtifactProperties.get(actionClass) ;
+                    if (artifact != null)
+                    {
+                        artifacts.add(artifact) ;
+                    }
+                }
+            }
+        }
+          
+        for(final String artifact: artifacts)
+        {
+            if (!deploymentName.equals(artifact))
+            {
+                final String canonicalName = esbDeploymentPrefix + artifact ;
+                try
+                {
+                    ObjectName on = ObjectNameConverter.convert(canonicalName);
+                    deps.add(on) ;
+                } 
+                catch (MalformedObjectNameException e)
+                {
+                    throw new DeploymentException(e.getMessage(), e);
+                }
+            }
+        }
+        return deps;
+    }
+    
+    String getDeploymentName(final VFSDeploymentUnit deploymentUnit)
+    {
+        final String simpleName = deploymentUnit.getSimpleName();
+        int idx = simpleName.indexOf(EsbConstants.ESB_ARCHIVE_SUFFIX);
+        if (idx == -1)
+        {
+            return simpleName;
+        }
+        return simpleName.substring(0, simpleName.indexOf(EsbConstants.ESB_ARCHIVE_SUFFIX));
+    }
+
+    public void setActionArtifactsFile(final String actionArtifactsFile)
+    {
+        this.actionArtifactsFile = actionArtifactsFile;
+    }
+    
+    public void setEsbDeploymentPrefix(final String deploymentPrefix)
+    {
+        this.esbDeploymentPrefix = deploymentPrefix;
+    }
+    
+    public void setEsbArtifactName(final String esbArtifactName)
+    {
+        this.esbArtifactName = esbArtifactName;
+    }
+    
+    public void setWarDeploymentPrefix(final String deploymentPrefix)
+    {
+        this.warDeploymentPrefix = deploymentPrefix;
+    }
+
+    /**
+     * Filter for filtering out ESB configuration files.
+     *
+     */
+    private static class EsbConfigFileFilter implements VirtualFileFilter
+    {
+        /**
+         * Accepts only files ending with the ESB_FILE_SUFFIX.
+         * 
+         * @param file  The file to filter.
+         * @return true If the file name ends with "-esb.xml".
+         */
+        public boolean accepts(final VirtualFile file)
+        {
+            return file.getName().endsWith(EsbConstants.ESB_FILE_SUFFIX);
+        }
+    }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- * 
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * 
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.deployers.mc.as6;
-
-/**
- * Contstants for ESB Microecontainer Deployers.
- * 
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- *
- */
-public final class EsbConstants
-{
-    /**
-     * The default suffix of JBossESB configuration files that should be picked up.
-     */
-    public static final String ESB_FILE_SUFFIX = "-esb.xml";
-    
-    /**
-     * The default suffix of JBossESB archives that should be accepted.
-     */
-    public static final String ESB_ARCHIVE_SUFFIX = ".esb";
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbConstants.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.as6;
+
+/**
+ * Contstants for ESB Microecontainer Deployers.
+ * 
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public final class EsbConstants
+{
+    /**
+     * The default suffix of JBossESB configuration files that should be picked up.
+     */
+    public static final String ESB_FILE_SUFFIX = "-esb.xml";
+    
+    /**
+     * The default suffix of JBossESB archives that should be accepted.
+     */
+    public static final String ESB_ARCHIVE_SUFFIX = ".esb";
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,249 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.deployers.mc.as6;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.apache.log4j.Logger;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
-import org.jboss.vfs.VirtualFile;
-
-/**
- * EsbDeployer takes care of the deployment of an {@link EsbDeployment}.
- * <p/>
- * 
- * This deployer actually only creates a BeanMetaData object describing a
- * {@link EsbDeployment}. The MicroContainer will take care of the actual
- * creation and starting of the deployment using it's lifecycle callbacks. <p/>
- * 
- * Example configuration:
- * 
- * <pre>{@code
- *     <bean name="EsbDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.EsbDeployer">
- *        <property name="esbBeanPrefix">jboss.esb</property>
- *        <property name="defaultDependencies">
- *           <list elementClass="java.lang.String">
- *              <value>jboss.esb:service=ESBRegistry</value>
- *              <value>jboss.esb:service=JuddiRMI</value>
- *            </list>
- *        </property>
- *     </bean>
- * }</pre>
- * 
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
- */
-public class EsbDeployer extends AbstractSimpleVFSRealDeployer<EsbMetaData>
-{
-    /**
-     * Logger.
-     */
-    private Logger log = Logger.getLogger(EsbDeployer.class);
-    
-    /**
-     * Prefix used for the BeanMetaData and for the managenment bean name.
-     */
-    private String esbBeanPrefix = "jboss.esb";
-    
-    /**
-     * Default dependencies that will be added to all {@link EsbDeployment}s.
-     */
-    private List<String> defaultDeps = new ArrayList<String>();
-
-    private DeployerClient mainDeployer;
-    
-    /**
-     * The path the the directory that will be used to generate the war file
-     * for all web gateway deployments (EBWS and HTTP Gateways).
-     */
-    private String warFilesDir;
-    
-    /**
-     * No args constructor.
-     */
-    public EsbDeployer()
-    {
-        super(EsbMetaData.class);
-        // Tell the MicroContainer that we are producing BeanMetaData.
-        setOutput(BeanMetaData.class);
-        // Need access to classloaders
-        setStage(DeploymentStages.POST_CLASSLOADER);
-    }
-
-    public void setMainDeployer(DeployerClient mainDeployer)
-    {
-        this.mainDeployer = mainDeployer;
-    }
-    
-    /**
-     * Sets the directory that will be used for generating ESWS wars.
-     * @param dir The directory to be used.
-     */
-    public void setWarFilesDir(final String dir)
-    {
-        this.warFilesDir = dir;
-    }
-
-    /**
-     * Creates an {@link BeanMetaData} instance that describes the JBossESB
-     * deployment. The BeanMetaData is created using the information from the
-     * EsbMetaData object, such as the contents of jboss-esb.xml, archive name etc.
-     * 
-     * The BeanMeatData is then attached to the Microcontainers deployment unit
-     * and will be picked up by the BeanMetaDataDeployer.
-     * 
-     * @param deploymentUnit The deployment unit to deploy.
-     * @param esbMetaData The ESB MetaData that is associated with the deployment unit.
-     */
-    @Override
-    public final void deploy(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData) throws org.jboss.deployers.spi.DeploymentException
-    {
-        try
-        {
-            final BeanMetaData beanMetaData = createBeanMetaData(deploymentUnit, esbMetaData);
-            deploymentUnit.addAttachment(BeanMetaData.class.getName() + "_ESB", beanMetaData);
-            log.debug("Created beanMetaData : " + beanMetaData);
-        } 
-        catch (final DeploymentException e)
-        {
-            throw new org.jboss.deployers.spi.DeploymentException(e.getMessage(), e);
-        } 
-        catch (final IOException e)
-        {
-            throw new org.jboss.deployers.spi.DeploymentException(e.getMessage(), e);
-        }
-    }
-    
-    /**
-     * Creates a {@link BeanMetaData} that describes the
-     * 
-     * @param deploymentUnit The deployment unit to deploy.
-     * @param esbMetaData The ESB MetaData that is associated with the deployment unit.
-     * @return BeanMetaData The {@link BeanMetaData} describing the EsbDeployment.
-     * 
-     * @throws IOException
-     * @throws DeploymentException
-     */
-    private BeanMetaData createBeanMetaData(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData) throws DeploymentException, IOException
-    {
-        log.debug(esbMetaData);
-        BeanMetaDataBuilder bmdBuilder = BeanMetaDataBuilder.createBuilder(esbBeanPrefix + "." + deploymentUnit.getName(), EsbDeployment.class.getName());
-        // Setup the first constructor argument (esb meta data).
-        bmdBuilder.addConstructorParameter(EsbMetaData.class.getName(), esbMetaData);
-        // Setup the second constructor argument (the name of the mbean).
-        final String mbeanName = esbBeanPrefix + ":deployment=" + deploymentUnit.getSimpleName();
-        bmdBuilder.addConstructorParameter(String.class.getName(), mbeanName);
-        // Setup the third constructor argument (vfs deployment unit).
-        bmdBuilder.addConstructorParameter(VFSDeploymentUnit.class.getName(), deploymentUnit);
-        if (warFilesDir == null)
-        {
-            final String errorMsg = String.format("No property named '%s' was configured in jbossesb.sar/META-INF/jboss-service.xml for %s", "warFilesDir", getClass().getName());
-            throw new DeploymentException(errorMsg);
-        }
-        
-        final File tmpDir = new File(warFilesDir);
-        if (!tmpDir.exists())
-        {
-            final String errorMsg = String.format("The directory configured for %s='%s' does not exist.", "warFilesDir", tmpDir);
-            throw new DeploymentException(errorMsg);
-        }
-        // Setup the fourth constructor argument (temp war directory).
-        File esbWarFiles = JBossDeployerUtil.createDir(tmpDir, "esbwarfiles");
-        bmdBuilder.addConstructorParameter(File.class.getName(), esbWarFiles);
-        // Add management annotation.
-        bmdBuilder.addAnnotation("@org.jboss.aop.microcontainer.aspects.jmx.JMX(registerDirectly=true, exposedInterface=void.class, name=\"" + mbeanName + "\")");
-
-        // Add default dependencies.
-        for (String dependency : defaultDeps)
-        {
-            bmdBuilder.addDependency(dependency);
-        }
-
-        // Add the dependencies for this deployment.
-        Set<ObjectName> dependencies = esbMetaData.getDependencies();
-        for (ObjectName objectName : dependencies)
-        {
-            // The dependencies are added as demands. If we add them as dependencies
-            // they will get undeployed when this unit is undeployed.
-            log.debug("Adding depend " + objectName.toString() + " for " + esbMetaData.getDeploymentName());
-            bmdBuilder.addDemand(objectName.toString(), ControllerState.PRE_INSTALL, ControllerState.INSTALLED, null);
-        }
-
-        if (esbMetaData.getPublishers().size() > 0)
-        {
-            // set publishers on the deployment instance, or rather tell MC to do this for us.
-            log.debug("Adding publishers : " + esbMetaData.getPublishers());
-            bmdBuilder.addPropertyMetaData("publishers", esbMetaData.getPublishers());
-        }
-        
-        if (esbMetaData.getServlets().size() > 0)
-        {
-            // set servlets on the deployment instance, or rather tell MC to do this for us.
-            log.debug("Adding servlets : " + esbMetaData.getServlets());
-            bmdBuilder.addPropertyMetaData("servlets", esbMetaData.getServlets());
-        }
-        
-        bmdBuilder.addPropertyMetaData("mainDeployer", mainDeployer);
-        return bmdBuilder.getBeanMetaData();
-    }
-    
-    public void setEsbBeanPrefix(final String prefix)
-    {
-        this.esbBeanPrefix = prefix;
-    }
-    
-    public String getEsbBeanPrefix()
-    {
-        return esbBeanPrefix;
-    }
-    
-    public void setDefaultDependencies(final List<String> deps)
-    {
-        if (deps != null)
-        {
-            defaultDeps.addAll(deps);
-        }
-    }
-    
-    public List<String> getDefaultDependencies()
-    {
-        return Collections.unmodifiableList(defaultDeps);
-    }
-    
-    
-    
-}
-        

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployer.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,249 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.as6;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.apache.log4j.Logger;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.deployment.DeploymentException;
+import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * EsbDeployer takes care of the deployment of an {@link EsbDeployment}.
+ * <p/>
+ * 
+ * This deployer actually only creates a BeanMetaData object describing a
+ * {@link EsbDeployment}. The MicroContainer will take care of the actual
+ * creation and starting of the deployment using it's lifecycle callbacks. <p/>
+ * 
+ * Example configuration:
+ * 
+ * <pre>{@code
+ *     <bean name="EsbDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.EsbDeployer">
+ *        <property name="esbBeanPrefix">jboss.esb</property>
+ *        <property name="defaultDependencies">
+ *           <list elementClass="java.lang.String">
+ *              <value>jboss.esb:service=ESBRegistry</value>
+ *              <value>jboss.esb:service=JuddiRMI</value>
+ *            </list>
+ *        </property>
+ *     </bean>
+ * }</pre>
+ * 
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class EsbDeployer extends AbstractSimpleVFSRealDeployer<EsbMetaData>
+{
+    /**
+     * Logger.
+     */
+    private Logger log = Logger.getLogger(EsbDeployer.class);
+    
+    /**
+     * Prefix used for the BeanMetaData and for the managenment bean name.
+     */
+    private String esbBeanPrefix = "jboss.esb";
+    
+    /**
+     * Default dependencies that will be added to all {@link EsbDeployment}s.
+     */
+    private List<String> defaultDeps = new ArrayList<String>();
+
+    private DeployerClient mainDeployer;
+    
+    /**
+     * The path the the directory that will be used to generate the war file
+     * for all web gateway deployments (EBWS and HTTP Gateways).
+     */
+    private String warFilesDir;
+    
+    /**
+     * No args constructor.
+     */
+    public EsbDeployer()
+    {
+        super(EsbMetaData.class);
+        // Tell the MicroContainer that we are producing BeanMetaData.
+        setOutput(BeanMetaData.class);
+        // Need access to classloaders
+        setStage(DeploymentStages.POST_CLASSLOADER);
+    }
+
+    public void setMainDeployer(DeployerClient mainDeployer)
+    {
+        this.mainDeployer = mainDeployer;
+    }
+    
+    /**
+     * Sets the directory that will be used for generating ESWS wars.
+     * @param dir The directory to be used.
+     */
+    public void setWarFilesDir(final String dir)
+    {
+        this.warFilesDir = dir;
+    }
+
+    /**
+     * Creates an {@link BeanMetaData} instance that describes the JBossESB
+     * deployment. The BeanMetaData is created using the information from the
+     * EsbMetaData object, such as the contents of jboss-esb.xml, archive name etc.
+     * 
+     * The BeanMeatData is then attached to the Microcontainers deployment unit
+     * and will be picked up by the BeanMetaDataDeployer.
+     * 
+     * @param deploymentUnit The deployment unit to deploy.
+     * @param esbMetaData The ESB MetaData that is associated with the deployment unit.
+     */
+    @Override
+    public final void deploy(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData) throws org.jboss.deployers.spi.DeploymentException
+    {
+        try
+        {
+            final BeanMetaData beanMetaData = createBeanMetaData(deploymentUnit, esbMetaData);
+            deploymentUnit.addAttachment(BeanMetaData.class.getName() + "_ESB", beanMetaData);
+            log.debug("Created beanMetaData : " + beanMetaData);
+        } 
+        catch (final DeploymentException e)
+        {
+            throw new org.jboss.deployers.spi.DeploymentException(e.getMessage(), e);
+        } 
+        catch (final IOException e)
+        {
+            throw new org.jboss.deployers.spi.DeploymentException(e.getMessage(), e);
+        }
+    }
+    
+    /**
+     * Creates a {@link BeanMetaData} that describes the
+     * 
+     * @param deploymentUnit The deployment unit to deploy.
+     * @param esbMetaData The ESB MetaData that is associated with the deployment unit.
+     * @return BeanMetaData The {@link BeanMetaData} describing the EsbDeployment.
+     * 
+     * @throws IOException
+     * @throws DeploymentException
+     */
+    private BeanMetaData createBeanMetaData(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData) throws DeploymentException, IOException
+    {
+        log.debug(esbMetaData);
+        BeanMetaDataBuilder bmdBuilder = BeanMetaDataBuilder.createBuilder(esbBeanPrefix + "." + deploymentUnit.getName(), EsbDeployment.class.getName());
+        // Setup the first constructor argument (esb meta data).
+        bmdBuilder.addConstructorParameter(EsbMetaData.class.getName(), esbMetaData);
+        // Setup the second constructor argument (the name of the mbean).
+        final String mbeanName = esbBeanPrefix + ":deployment=" + deploymentUnit.getSimpleName();
+        bmdBuilder.addConstructorParameter(String.class.getName(), mbeanName);
+        // Setup the third constructor argument (vfs deployment unit).
+        bmdBuilder.addConstructorParameter(VFSDeploymentUnit.class.getName(), deploymentUnit);
+        if (warFilesDir == null)
+        {
+            final String errorMsg = String.format("No property named '%s' was configured in jbossesb.sar/META-INF/jboss-service.xml for %s", "warFilesDir", getClass().getName());
+            throw new DeploymentException(errorMsg);
+        }
+        
+        final File tmpDir = new File(warFilesDir);
+        if (!tmpDir.exists())
+        {
+            final String errorMsg = String.format("The directory configured for %s='%s' does not exist.", "warFilesDir", tmpDir);
+            throw new DeploymentException(errorMsg);
+        }
+        // Setup the fourth constructor argument (temp war directory).
+        File esbWarFiles = JBossDeployerUtil.createDir(tmpDir, "esbwarfiles");
+        bmdBuilder.addConstructorParameter(File.class.getName(), esbWarFiles);
+        // Add management annotation.
+        bmdBuilder.addAnnotation("@org.jboss.aop.microcontainer.aspects.jmx.JMX(registerDirectly=true, exposedInterface=void.class, name=\"" + mbeanName + "\")");
+
+        // Add default dependencies.
+        for (String dependency : defaultDeps)
+        {
+            bmdBuilder.addDependency(dependency);
+        }
+
+        // Add the dependencies for this deployment.
+        Set<ObjectName> dependencies = esbMetaData.getDependencies();
+        for (ObjectName objectName : dependencies)
+        {
+            // The dependencies are added as demands. If we add them as dependencies
+            // they will get undeployed when this unit is undeployed.
+            log.debug("Adding depend " + objectName.toString() + " for " + esbMetaData.getDeploymentName());
+            bmdBuilder.addDemand(objectName.toString(), ControllerState.PRE_INSTALL, ControllerState.INSTALLED, null);
+        }
+
+        if (esbMetaData.getPublishers().size() > 0)
+        {
+            // set publishers on the deployment instance, or rather tell MC to do this for us.
+            log.debug("Adding publishers : " + esbMetaData.getPublishers());
+            bmdBuilder.addPropertyMetaData("publishers", esbMetaData.getPublishers());
+        }
+        
+        if (esbMetaData.getServlets().size() > 0)
+        {
+            // set servlets on the deployment instance, or rather tell MC to do this for us.
+            log.debug("Adding servlets : " + esbMetaData.getServlets());
+            bmdBuilder.addPropertyMetaData("servlets", esbMetaData.getServlets());
+        }
+        
+        bmdBuilder.addPropertyMetaData("mainDeployer", mainDeployer);
+        return bmdBuilder.getBeanMetaData();
+    }
+    
+    public void setEsbBeanPrefix(final String prefix)
+    {
+        this.esbBeanPrefix = prefix;
+    }
+    
+    public String getEsbBeanPrefix()
+    {
+        return esbBeanPrefix;
+    }
+    
+    public void setDefaultDependencies(final List<String> deps)
+    {
+        if (deps != null)
+        {
+            defaultDeps.addAll(deps);
+        }
+    }
+    
+    public List<String> getDefaultDependencies()
+    {
+        return Collections.unmodifiableList(defaultDeps);
+    }
+    
+    
+    
+}
+        

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,313 +0,0 @@
-/*
- * 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.deployers.mc.as6;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.management.JMException;
-import javax.management.ObjectName;
-import javax.management.MBeanServer;
-
-import org.apache.log4j.Logger;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.deployers.client.plugins.deployment.AbstractDeployment;
-import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.client.spi.DeploymentFactory;
-import org.jboss.deployers.spi.attachments.MutableAttachments;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.ClassLoaderFactory;
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.internal.soa.esb.listeners.war.Filter;
-import org.jboss.internal.soa.esb.listeners.war.Servlet;
-import org.jboss.internal.soa.esb.listeners.war.WebDeploymentArchive;
-import org.jboss.internal.soa.esb.listeners.war.WebModel;
-import org.jboss.internal.soa.esb.publish.ContractReferencePublisher;
-import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
-import org.jboss.internal.soa.esb.webservice.ESBContractGenerator;
-import org.jboss.internal.soa.esb.webservice.ESBResponseFilter;
-import org.jboss.internal.soa.esb.webservice.ESBServiceContractReferencePublisher;
-import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.Service;
-import org.jboss.soa.esb.lifecycle.LifecycleResourceManager;
-import org.jboss.soa.esb.listeners.config.Configuration;
-import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
-import org.jboss.soa.esb.listeners.config.ModelUtil;
-import org.jboss.soa.esb.listeners.config.ServicePublisher;
-import org.jboss.soa.esb.listeners.deployers.mc.as6.WebGatewayBuilder;
-import org.jboss.soa.esb.listeners.config.WebserviceInfo;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.soa.esb.util.DeploymentArchive;
-
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VirtualFile;
-
-/**
- * EsbDeployment for the Microcontainer. 
- * <p/> 
- * 
- * Microcontainer will call the lifecycle methods:
- * <lu>
- *  <li><i>create</i> will create the ESB deployment.</i>
- *  <li><i>start</i> will start the ESB deployment.</i>
- *  <li><i>stop</i> will stop the ESB deployment.</i>
- *  <li><i>destroy</i> will destroy the ESB deployment.</i>
- * </lu>
- * 
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
- */
-public class EsbDeployment implements EsbDeploymentMBean
-{
-    private Logger log = Logger.getLogger(EsbDeployment.class);
-    
-    private int state = CREATED;
-
-    private String jbossEsbXml;
-    private String deploymentName;
-    private List<ContractReferencePublisher> publishers;
-    private List<Servlet> servlets;
-    private ManagedLifecycleController controller;
-    private final String mbeanName;
-    //private File subDeployment;
-    private ClassLoader localCl;
-
-    /** The meta data */
-    private EsbMetaData esbMetaData;
-
-    private VFSDeployment deployment;
-    private DeploymentFactory factory = new DeploymentFactory();
-
-    private DeployerClient mainDeployer;
-    private File esbWarFiles;
-    private File esbArchive;
-        
-    public EsbDeployment(final EsbMetaData esbMetaData, final String mbeanName, final VFSDeploymentUnit deploymentUnit, final File esbWarFiles) throws Exception
-    {
-        this.deploymentName = esbMetaData.getArchiveName();
-        this.mbeanName = mbeanName;
-        this.esbMetaData = esbMetaData;
-        this.esbWarFiles = esbWarFiles;
-        this.jbossEsbXml = JBossDeployerUtil.readEsbConfig(esbMetaData.getFile().openStream());
-        this.esbArchive = new File(deploymentUnit.getRoot().toURL().getPath());
-        this.localCl = deploymentUnit.getClassLoader();
-    }
-    
-    public String getJbossEsbXml()
-    {
-        return jbossEsbXml;
-    }
-
-    public String getJbossEsbXmlAsHtml()
-    {
-        return jbossEsbXml.replace("<", "&lt;").replace(">", "&gt;");
-    }
-
-    public void setPublishers(final List<ContractReferencePublisher> publishers)
-    {
-        this.publishers = publishers;
-    }
-    
-    public void setServlets(final List<Servlet> servlets)
-    {
- 	   this.servlets = servlets;
-    }
-    
-    public List<Servlet> getServlets()
-    {
- 	   return servlets;
-    }
-
-    public void setMainDeployer(final DeployerClient mainDeployer)
-    {
-        this.mainDeployer = mainDeployer;
-    }
-
-    public ManagedLifecycleController getController()
-    {
-        return controller;
-    }
-
-    public String getDeploymentName()
-    {
-        return deploymentName;
-    }
-
-    public void setDeploymentName(final String deploymentName)
-    {
-        this.deploymentName = deploymentName;
-    }
-
-    public List<ContractReferencePublisher> getPublishers()
-    {
-        return publishers;
-    }
-
-    public void create() throws Exception
-    {
-    	state = CREATING;
-    	
-        // Redo initialization as the properties could have changed
-        this.jbossEsbXml = JBossDeployerUtil.readEsbConfig(esbMetaData.getFile().openStream());
-        esbMetaData.setModel(JBossDeployerUtil.getJbossEsbModel(jbossEsbXml));
-
-        LifecycleResourceManager.getSingleton().associateDeployment(deploymentName);
-        LifecycleResourceManager.deactivateHook();
-
-        WebGatewayBuilder builder = new WebGatewayBuilder(esbWarFiles, esbArchive, deploymentName, localCl, esbMetaData.getModel());
-        File subDeployment = builder.build();
-        if (subDeployment != null)
-        {
-            VFSDeployment vfsDeployment = null;
-            try
-            {
-                vfsDeployment = createVFSDeployment(subDeployment);
-                mainDeployer.deploy(vfsDeployment);
-                log.info("Deploying '" + vfsDeployment.getName() + "'");
-                this.setPublishers(builder.getPublishers());
-                this.setServlets(builder.getServlets());
-                this.deployment = vfsDeployment;
-            }
-            catch (Throwable throwable)
-            {
-                if (vfsDeployment != null)
-                {
-                    VirtualFile deploymentFile = vfsDeployment.getRoot();
-                    if(deploymentFile.exists())
-                    {
-                        log.info("Deleting '" + vfsDeployment.getSimpleName() + "'");
-                        deploymentFile.delete();
-                    }
-                }
-                throw new ConfigurationException("Error deploying '" + vfsDeployment.getName() + "'.", throwable);
-            }
-        }
-        this.state = CREATED;
-    }
-
-    public void start() throws Exception
-    {    
-    	if ((state == STARTING) || (state == STARTED))
-    		return;
-    	state = STARTING;
-
-    	try {
-	        if (controller == null)
-	        {
-	        	log.info("Starting ESB Deployment '" + deploymentName + "'");
-	            controller = Configuration.create(jbossEsbXml, new ObjectName(mbeanName), publishers, servlets);
-	            controller.start();
-	        }
-	        state = STARTED;
-    	} catch (Exception e) {
-    		state = FAILED;
-    		throw e;
-    	}
-    }
-
-	public boolean isStarted() {
-		return (controller != null);
-	}
-
-	public String getStateString() {
-		return states[state];
-	}
-	
-	public int getState() {
-		return state;
-	}
-	
-    public void stop() throws Exception
-    {        
-    	if (state != STARTED)
-    		return;
-    	
-    	state = STOPPING;
-    	try {
-	        if (controller != null)
-	        {
-	        	log.info("Stopping '" + deploymentName + "'");
-		        ServicePublisher.removeServicePublishers(controller);
-		        controller.stop();
-		        controller = null;
-		        state = STOPPED;
-	        }
-    	} catch (Exception e) {
-    		throw e;
-    	}
-    }
-
-    public void destroy() throws Exception
-    {
-    	if (state == DESTROYED)
-    		return;
-    	
-        log.info("Destroying '" + deploymentName + "'");
-        state = DESTROYING;
-        
-        try {
-	        if (deployment != null)
-	        {
-	            log.info("Undeploying '" + deployment.getSimpleName() + "'");
-	            mainDeployer.undeploy(deployment);
-	            VirtualFile deploymentFile = deployment.getRoot();
-	            if(deploymentFile.exists())
-	            {
-	                log.info("Deleting '" + deployment.getSimpleName() + "'");
-	                if(!deploymentFile.delete())
-	                {
-	                    log.debug("Failed to delete sub deployment '" + deployment.getName() + "'.");
-	                }
-	            }
-	        }
-	
-	        LifecycleResourceManager.getSingleton().disassociateDeployment(deploymentName);
-	        LifecycleResourceManager.getSingleton().destroyResources();
-	        state = DESTROYED;
-        } catch (Exception e) {
-        	throw e;
-        }
-    }
-    
-    private VFSDeployment createVFSDeployment(File war) throws IOException, URISyntaxException
-    {
-        VirtualFile webAppVFS = VFS.getChild(war.toURL());
-        //VirtualFile webAppVFS = VFS.getRoot(war.toURL());
-        return VFSDeploymentFactory.getInstance().createVFSDeployment(webAppVFS);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeployment.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,313 @@
+/*
+ * 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.deployers.mc.as6;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.management.JMException;
+import javax.management.ObjectName;
+import javax.management.MBeanServer;
+
+import org.apache.log4j.Logger;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.deployers.client.plugins.deployment.AbstractDeployment;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.DeploymentFactory;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.ClassLoaderFactory;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.deployment.DeploymentException;
+import org.jboss.internal.soa.esb.listeners.war.Filter;
+import org.jboss.internal.soa.esb.listeners.war.Servlet;
+import org.jboss.internal.soa.esb.listeners.war.WebDeploymentArchive;
+import org.jboss.internal.soa.esb.listeners.war.WebModel;
+import org.jboss.internal.soa.esb.publish.ContractReferencePublisher;
+import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
+import org.jboss.internal.soa.esb.webservice.ESBContractGenerator;
+import org.jboss.internal.soa.esb.webservice.ESBResponseFilter;
+import org.jboss.internal.soa.esb.webservice.ESBServiceContractReferencePublisher;
+import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.lifecycle.LifecycleResourceManager;
+import org.jboss.soa.esb.listeners.config.Configuration;
+import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
+import org.jboss.soa.esb.listeners.config.ModelUtil;
+import org.jboss.soa.esb.listeners.config.ServicePublisher;
+import org.jboss.soa.esb.listeners.deployers.mc.as6.WebGatewayBuilder;
+import org.jboss.soa.esb.listeners.config.WebserviceInfo;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.soa.esb.util.DeploymentArchive;
+
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * EsbDeployment for the Microcontainer. 
+ * <p/> 
+ * 
+ * Microcontainer will call the lifecycle methods:
+ * <lu>
+ *  <li><i>create</i> will create the ESB deployment.</i>
+ *  <li><i>start</i> will start the ESB deployment.</i>
+ *  <li><i>stop</i> will stop the ESB deployment.</i>
+ *  <li><i>destroy</i> will destroy the ESB deployment.</i>
+ * </lu>
+ * 
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class EsbDeployment implements EsbDeploymentMBean
+{
+    private Logger log = Logger.getLogger(EsbDeployment.class);
+    
+    private int state = CREATED;
+
+    private String jbossEsbXml;
+    private String deploymentName;
+    private List<ContractReferencePublisher> publishers;
+    private List<Servlet> servlets;
+    private ManagedLifecycleController controller;
+    private final String mbeanName;
+    //private File subDeployment;
+    private ClassLoader localCl;
+
+    /** The meta data */
+    private EsbMetaData esbMetaData;
+
+    private VFSDeployment deployment;
+    private DeploymentFactory factory = new DeploymentFactory();
+
+    private DeployerClient mainDeployer;
+    private File esbWarFiles;
+    private File esbArchive;
+        
+    public EsbDeployment(final EsbMetaData esbMetaData, final String mbeanName, final VFSDeploymentUnit deploymentUnit, final File esbWarFiles) throws Exception
+    {
+        this.deploymentName = esbMetaData.getArchiveName();
+        this.mbeanName = mbeanName;
+        this.esbMetaData = esbMetaData;
+        this.esbWarFiles = esbWarFiles;
+        this.jbossEsbXml = JBossDeployerUtil.readEsbConfig(esbMetaData.getFile().openStream());
+        this.esbArchive = new File(deploymentUnit.getRoot().toURL().getPath());
+        this.localCl = deploymentUnit.getClassLoader();
+    }
+    
+    public String getJbossEsbXml()
+    {
+        return jbossEsbXml;
+    }
+
+    public String getJbossEsbXmlAsHtml()
+    {
+        return jbossEsbXml.replace("<", "&lt;").replace(">", "&gt;");
+    }
+
+    public void setPublishers(final List<ContractReferencePublisher> publishers)
+    {
+        this.publishers = publishers;
+    }
+    
+    public void setServlets(final List<Servlet> servlets)
+    {
+ 	   this.servlets = servlets;
+    }
+    
+    public List<Servlet> getServlets()
+    {
+ 	   return servlets;
+    }
+
+    public void setMainDeployer(final DeployerClient mainDeployer)
+    {
+        this.mainDeployer = mainDeployer;
+    }
+
+    public ManagedLifecycleController getController()
+    {
+        return controller;
+    }
+
+    public String getDeploymentName()
+    {
+        return deploymentName;
+    }
+
+    public void setDeploymentName(final String deploymentName)
+    {
+        this.deploymentName = deploymentName;
+    }
+
+    public List<ContractReferencePublisher> getPublishers()
+    {
+        return publishers;
+    }
+
+    public void create() throws Exception
+    {
+    	state = CREATING;
+    	
+        // Redo initialization as the properties could have changed
+        this.jbossEsbXml = JBossDeployerUtil.readEsbConfig(esbMetaData.getFile().openStream());
+        esbMetaData.setModel(JBossDeployerUtil.getJbossEsbModel(jbossEsbXml));
+
+        LifecycleResourceManager.getSingleton().associateDeployment(deploymentName);
+        LifecycleResourceManager.deactivateHook();
+
+        WebGatewayBuilder builder = new WebGatewayBuilder(esbWarFiles, esbArchive, deploymentName, localCl, esbMetaData.getModel());
+        File subDeployment = builder.build();
+        if (subDeployment != null)
+        {
+            VFSDeployment vfsDeployment = null;
+            try
+            {
+                vfsDeployment = createVFSDeployment(subDeployment);
+                mainDeployer.deploy(vfsDeployment);
+                log.info("Deploying '" + vfsDeployment.getName() + "'");
+                this.setPublishers(builder.getPublishers());
+                this.setServlets(builder.getServlets());
+                this.deployment = vfsDeployment;
+            }
+            catch (Throwable throwable)
+            {
+                if (vfsDeployment != null)
+                {
+                    VirtualFile deploymentFile = vfsDeployment.getRoot();
+                    if(deploymentFile.exists())
+                    {
+                        log.info("Deleting '" + vfsDeployment.getSimpleName() + "'");
+                        deploymentFile.delete();
+                    }
+                }
+                throw new ConfigurationException("Error deploying '" + vfsDeployment.getName() + "'.", throwable);
+            }
+        }
+        this.state = CREATED;
+    }
+
+    public void start() throws Exception
+    {    
+    	if ((state == STARTING) || (state == STARTED))
+    		return;
+    	state = STARTING;
+
+    	try {
+	        if (controller == null)
+	        {
+	        	log.info("Starting ESB Deployment '" + deploymentName + "'");
+	            controller = Configuration.create(jbossEsbXml, new ObjectName(mbeanName), publishers, servlets);
+	            controller.start();
+	        }
+	        state = STARTED;
+    	} catch (Exception e) {
+    		state = FAILED;
+    		throw e;
+    	}
+    }
+
+	public boolean isStarted() {
+		return (controller != null);
+	}
+
+	public String getStateString() {
+		return states[state];
+	}
+	
+	public int getState() {
+		return state;
+	}
+	
+    public void stop() throws Exception
+    {        
+    	if (state != STARTED)
+    		return;
+    	
+    	state = STOPPING;
+    	try {
+	        if (controller != null)
+	        {
+	        	log.info("Stopping '" + deploymentName + "'");
+		        ServicePublisher.removeServicePublishers(controller);
+		        controller.stop();
+		        controller = null;
+		        state = STOPPED;
+	        }
+    	} catch (Exception e) {
+    		throw e;
+    	}
+    }
+
+    public void destroy() throws Exception
+    {
+    	if (state == DESTROYED)
+    		return;
+    	
+        log.info("Destroying '" + deploymentName + "'");
+        state = DESTROYING;
+        
+        try {
+	        if (deployment != null)
+	        {
+	            log.info("Undeploying '" + deployment.getSimpleName() + "'");
+	            mainDeployer.undeploy(deployment);
+	            VirtualFile deploymentFile = deployment.getRoot();
+	            if(deploymentFile.exists())
+	            {
+	                log.info("Deleting '" + deployment.getSimpleName() + "'");
+	                if(!deploymentFile.delete())
+	                {
+	                    log.debug("Failed to delete sub deployment '" + deployment.getName() + "'.");
+	                }
+	            }
+	        }
+	
+	        LifecycleResourceManager.getSingleton().disassociateDeployment(deploymentName);
+	        LifecycleResourceManager.getSingleton().destroyResources();
+	        state = DESTROYED;
+        } catch (Exception e) {
+        	throw e;
+        }
+    }
+    
+    private VFSDeployment createVFSDeployment(File war) throws IOException, URISyntaxException
+    {
+        VirtualFile webAppVFS = VFS.getChild(war.toURL());
+        //VirtualFile webAppVFS = VFS.getRoot(war.toURL());
+        return VFSDeploymentFactory.getInstance().createVFSDeployment(webAppVFS);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.deployers.mc.as6;
-
-/**
- * Interface for exposing JMX operations.
- * 
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- */
-public interface EsbDeploymentMBean
-{
-    /**
-     * Start a deployment.
-     * 
-     * @throws Exception  If an exception occurs while starting.
-     */
-    void start() throws Exception;
-
-    /**
-     * Is the deployment started.
-     * 
-     * @return True if the deployment is started, otherwise false.
-     */
-    boolean isStarted();
-
-    /**
-     * Stop a deployment.
-     * 
-     * @throws Exception  If an exeption occurs while stoping.
-     */
-    void stop() throws Exception;
-
-    /**
-     * Gets the jboss-esb.xml configuration.
-     * 
-     * @return String   The jboss-esb.xml files content.
-     */
-    String getJbossEsbXml();
-
-    /**
-     * Gets the jboss-esb.xml configuration as html.
-     * 
-     * @return String   The jboss-esb.xml files content as html.
-     */
-    String getJbossEsbXmlAsHtml();
-    
-	String getStateString();
-	
-	int getState();
-
-    public static final String[] states = {
-        "Stopped", "Stopping", "Starting", "Started", "Failed",
-        "Destroying", "Destroyed", "Creating", "Created", 
-        "Initializing", "Initialized", "Unregistered"
-     };
-
-     /** stop has completed */
-     public static final int STOPPED  = 0;
-     /** stop has been invoked */
-     public static final int STOPPING = 1;
-     /** start has been invoked */
-     public static final int STARTING = 2;
-     /** start has completed */
-     public static final int STARTED  = 3;
-     /** There has been an error during some operation */
-     public static final int FAILED  = 4;
-     /** destroy has been invoked */ 
-     public static final int DESTROYING = 5;
-     /** destroy has completed */
-     public static final int DESTROYED = 6;
-     /** create has been invoked */
-     public static final int CREATING = 7;
-     /** create has completed */
-     public static final int CREATED = 8;
-     /** initialize has been invoked */
-     public static final int INITIALIZING = 9;
-     /** initialize has completed */
-     public static final int INITIALIZED = 10;
-     /** not yet created */
-     public static final int UNREGISTERED = 11;
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbDeploymentMBean.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.as6;
+
+/**
+ * Interface for exposing JMX operations.
+ * 
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public interface EsbDeploymentMBean
+{
+    /**
+     * Start a deployment.
+     * 
+     * @throws Exception  If an exception occurs while starting.
+     */
+    void start() throws Exception;
+
+    /**
+     * Is the deployment started.
+     * 
+     * @return True if the deployment is started, otherwise false.
+     */
+    boolean isStarted();
+
+    /**
+     * Stop a deployment.
+     * 
+     * @throws Exception  If an exeption occurs while stoping.
+     */
+    void stop() throws Exception;
+
+    /**
+     * Gets the jboss-esb.xml configuration.
+     * 
+     * @return String   The jboss-esb.xml files content.
+     */
+    String getJbossEsbXml();
+
+    /**
+     * Gets the jboss-esb.xml configuration as html.
+     * 
+     * @return String   The jboss-esb.xml files content as html.
+     */
+    String getJbossEsbXmlAsHtml();
+    
+	String getStateString();
+	
+	int getState();
+
+    public static final String[] states = {
+        "Stopped", "Stopping", "Starting", "Started", "Failed",
+        "Destroying", "Destroyed", "Creating", "Created", 
+        "Initializing", "Initialized", "Unregistered"
+     };
+
+     /** stop has completed */
+     public static final int STOPPED  = 0;
+     /** stop has been invoked */
+     public static final int STOPPING = 1;
+     /** start has been invoked */
+     public static final int STARTING = 2;
+     /** start has completed */
+     public static final int STARTED  = 3;
+     /** There has been an error during some operation */
+     public static final int FAILED  = 4;
+     /** destroy has been invoked */ 
+     public static final int DESTROYING = 5;
+     /** destroy has completed */
+     public static final int DESTROYED = 6;
+     /** create has been invoked */
+     public static final int CREATING = 7;
+     /** create has completed */
+     public static final int CREATED = 8;
+     /** initialize has been invoked */
+     public static final int INITIALIZING = 9;
+     /** initialize has completed */
+     public static final int INITIALIZED = 10;
+     /** not yet created */
+     public static final int UNREGISTERED = 11;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,196 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.deployers.mc.as6;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.internal.soa.esb.listeners.war.Servlet;
-import org.jboss.internal.soa.esb.publish.ContractReferencePublisher;
-import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
-import org.jboss.vfs.VirtualFile;
-
-/**
- * Metadata for an ESB deployment.
- * <p/>
- *
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
- */
-public class EsbMetaData implements Serializable
-{
-    /** Serial version unique identifier. */
-    private static final long serialVersionUID = 0L;
-
-    /** The name of the .esb archive. */
-    private String archiveName;
-
-    /** The adapter for querying the model */
-    private ModelAdapter model;
-
-    /** The virtual file. */
-    private final VirtualFile file;
-    
-    /** The deployments dependencies */
-    private final Set<ObjectName> dependencies ;
-    
-    /** The deployment name. The .esb archive name without the .esb suffix */
-    private final String deploymentName;
-    
-    /** The publishers for this deployment */
-    private List<ContractReferencePublisher> publishers = new ArrayList<ContractReferencePublisher>();
-    
-    /** The servlets for this deployment */
-    private List<Servlet> servlets = new ArrayList<Servlet>();
-    
-    /**
-     * Sole constructor.
-     *
-     * @param file              The virtual file. Can point to a file or a directory which will be searched..
-     * @param archiveName       The name of the .esb archive from which this deployment comes from.
-     * @param dependencies      Dependencies of this deployment. This might be object names or simply bean names.
-     */
-    public EsbMetaData(final VirtualFile file, final String archiveName, final String deploymentName, final Set<ObjectName> dependencies)
-    {
-        AssertArgument.isNotNull(file, "file");
-        AssertArgument.isNotNullAndNotEmpty(archiveName, "archiveName");
-        AssertArgument.isNotNullAndNotEmpty(deploymentName, "deploymentName");
-        
-        this.file = file;
-        this.archiveName = archiveName;
-        this.deploymentName = deploymentName;
-        this.dependencies = dependencies;
-    }
-
-    /**
-     * Gets the name of the archive that this metadata came from.
-     *
-     * @return String   The name of the archive that this metadata came from.
-     */
-    public final String getArchiveName()
-    {
-        return archiveName;
-    }
-
-    /**
-     * Gets the The virtual file. This is a file path
-     * @return String The esb xml configuration.
-     */
-    public VirtualFile getFile()
-    {
-        return file;
-    }
-    
-    /**
-     * Gets a set of dependencies of this deployment.
-     * 
-     * @return Set<ObjectName> A set of object names that the deployment represented by this instance depends on.
-     */
-    public Set<ObjectName> getDependencies()
-    {
-        return Collections.unmodifiableSet(dependencies);
-    }
-    
-    /**
-     * The deployment name is the name of the .esb archive without the .esb suffix.
-     * 
-     * @return String The name of the deployment. This is the archive name without the .esb suffix.
-     */
-    public String getDeploymentName()
-    {
-        return deploymentName;
-    }
-    
-    /**
-     * The model adapter for the configuration.
-     * 
-     * @return ModelAdapter The model adapter for the configuration.
-     */
-    public ModelAdapter getModel()
-    { 
-        return model;
-    }
-    
-    /**
-     * Set the model adapter for the configuration.
-     * 
-     * @param model The model adapter for the configuration.
-     */
-    public void setModel(ModelAdapter model)
-    { 
-        this.model = model;
-    }
-    
-    /**
-     * Sets the publishers for this deployment.
-     * 
-     * @param publishers The publishers for this deployment.
-     */
-    public void setPublishers(final List<ContractReferencePublisher> publishers)
-    {
-        this.publishers = publishers;
-    }
-    
-    /**
-     * Gets the publishers for this deployment.
-     * 
-     * @return List<ContractReferencePublishers> List of publishers for this deployment.
-     */
-    public List<ContractReferencePublisher> getPublishers()
-    {
-        return Collections.unmodifiableList(publishers);
-    }
-    
-    /**
-     * Sets the servlets for this deployment.
-     * 
-     * @param servlets The servlets for this deployment.
-     */
-    public void setServlets(final List<Servlet> servlets)
-    {
-        this.servlets = servlets;
-    }
-    
-    /**
-     * Gets the servlets for this deployment.
-     * 
-     * @return List<Servlet> List of servlets for this deployment.
-     */
-    public List<Servlet> getServlets()
-    {
-        return Collections.unmodifiableList(servlets);
-    }
-
-    /**
-     * @return String   String representation of this metadata.
-     */
-    @Override
-    public final String toString()
-    {
-        return String.format("EsbMetaData [archiveName='%s', deploymentName='%s', dependencies='%s']", archiveName, deploymentName, dependencies);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/EsbMetaData.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,196 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.as6;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.internal.soa.esb.listeners.war.Servlet;
+import org.jboss.internal.soa.esb.publish.ContractReferencePublisher;
+import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * Metadata for an ESB deployment.
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class EsbMetaData implements Serializable
+{
+    /** Serial version unique identifier. */
+    private static final long serialVersionUID = 0L;
+
+    /** The name of the .esb archive. */
+    private String archiveName;
+
+    /** The adapter for querying the model */
+    private ModelAdapter model;
+
+    /** The virtual file. */
+    private final VirtualFile file;
+    
+    /** The deployments dependencies */
+    private final Set<ObjectName> dependencies ;
+    
+    /** The deployment name. The .esb archive name without the .esb suffix */
+    private final String deploymentName;
+    
+    /** The publishers for this deployment */
+    private List<ContractReferencePublisher> publishers = new ArrayList<ContractReferencePublisher>();
+    
+    /** The servlets for this deployment */
+    private List<Servlet> servlets = new ArrayList<Servlet>();
+    
+    /**
+     * Sole constructor.
+     *
+     * @param file              The virtual file. Can point to a file or a directory which will be searched..
+     * @param archiveName       The name of the .esb archive from which this deployment comes from.
+     * @param dependencies      Dependencies of this deployment. This might be object names or simply bean names.
+     */
+    public EsbMetaData(final VirtualFile file, final String archiveName, final String deploymentName, final Set<ObjectName> dependencies)
+    {
+        AssertArgument.isNotNull(file, "file");
+        AssertArgument.isNotNullAndNotEmpty(archiveName, "archiveName");
+        AssertArgument.isNotNullAndNotEmpty(deploymentName, "deploymentName");
+        
+        this.file = file;
+        this.archiveName = archiveName;
+        this.deploymentName = deploymentName;
+        this.dependencies = dependencies;
+    }
+
+    /**
+     * Gets the name of the archive that this metadata came from.
+     *
+     * @return String   The name of the archive that this metadata came from.
+     */
+    public final String getArchiveName()
+    {
+        return archiveName;
+    }
+
+    /**
+     * Gets the The virtual file. This is a file path
+     * @return String The esb xml configuration.
+     */
+    public VirtualFile getFile()
+    {
+        return file;
+    }
+    
+    /**
+     * Gets a set of dependencies of this deployment.
+     * 
+     * @return Set<ObjectName> A set of object names that the deployment represented by this instance depends on.
+     */
+    public Set<ObjectName> getDependencies()
+    {
+        return Collections.unmodifiableSet(dependencies);
+    }
+    
+    /**
+     * The deployment name is the name of the .esb archive without the .esb suffix.
+     * 
+     * @return String The name of the deployment. This is the archive name without the .esb suffix.
+     */
+    public String getDeploymentName()
+    {
+        return deploymentName;
+    }
+    
+    /**
+     * The model adapter for the configuration.
+     * 
+     * @return ModelAdapter The model adapter for the configuration.
+     */
+    public ModelAdapter getModel()
+    { 
+        return model;
+    }
+    
+    /**
+     * Set the model adapter for the configuration.
+     * 
+     * @param model The model adapter for the configuration.
+     */
+    public void setModel(ModelAdapter model)
+    { 
+        this.model = model;
+    }
+    
+    /**
+     * Sets the publishers for this deployment.
+     * 
+     * @param publishers The publishers for this deployment.
+     */
+    public void setPublishers(final List<ContractReferencePublisher> publishers)
+    {
+        this.publishers = publishers;
+    }
+    
+    /**
+     * Gets the publishers for this deployment.
+     * 
+     * @return List<ContractReferencePublishers> List of publishers for this deployment.
+     */
+    public List<ContractReferencePublisher> getPublishers()
+    {
+        return Collections.unmodifiableList(publishers);
+    }
+    
+    /**
+     * Sets the servlets for this deployment.
+     * 
+     * @param servlets The servlets for this deployment.
+     */
+    public void setServlets(final List<Servlet> servlets)
+    {
+        this.servlets = servlets;
+    }
+    
+    /**
+     * Gets the servlets for this deployment.
+     * 
+     * @return List<Servlet> List of servlets for this deployment.
+     */
+    public List<Servlet> getServlets()
+    {
+        return Collections.unmodifiableList(servlets);
+    }
+
+    /**
+     * @return String   String representation of this metadata.
+     */
+    @Override
+    public final String toString()
+    {
+        return String.format("EsbMetaData [archiveName='%s', deploymentName='%s', dependencies='%s']", archiveName, deploymentName, dependencies);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,321 +0,0 @@
-package org.jboss.soa.esb.listeners.deployers.mc.as6;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.vfs.plugins.structure.AbstractVFSArchiveStructureDeployer;
-import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
-
-import org.jboss.deployers.vfs.spi.deployer.ArchiveMatcher;
-import org.jboss.deployers.vfs.spi.structure.StructureContext;
-import org.jboss.util.collection.CollectionsFactory;
-import org.jboss.vfs.VirtualFile;
-import org.jboss.vfs.VirtualFileFilter;
-
-/**
- * Similar to jar or directory structure, being able to handle sub-dirs, but a
- * bit more strict then dir structure. Only listed sub-directories are
- * candidates for potential sub-deployments.
- * 
- * It also allows you to set metadata paths, libs and should the root be part of
- * classpath. Each of sub-dirs can be filtered per path or by default per lib or
- * group.
- * 
- * In order to accept anything one must first set shortCircuitFilter instance.
- * 
- * @see org.jboss.deployers.vfs.plugins.structure.jar.JARStructure
- * @see org.jboss.deployers.vfs.plugins.structure.dir.DirectoryStructure
- * 
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class GroupingStructure extends AbstractVFSArchiveStructureDeployer implements ArchiveMatcher
-{
-    private final Set<String> suffixes = Collections.synchronizedSet(new HashSet<String>());
-    private static final String[] META_INF = { "META-INF" };
-
-    private VirtualFileFilter shortCircuitFilter; // by default null, so we
-                                                  // don't accept anything
-    private boolean rootClasspathEntry;
-
-    // paths
-    private String[] metaDataPaths;
-    private Set<String> libs;
-    private Set<String> groups;
-
-    // filters
-    private VirtualFileFilter libFilter;
-    private VirtualFileFilter groupFilter;
-    private Map<String, VirtualFileFilter> filters; // filter per path
-
-    public static Set<String> DEFAULT_JAR_SUFFIXES = new HashSet<String>();
-    static
-    {
-       DEFAULT_JAR_SUFFIXES = new HashSet<String>();
-       DEFAULT_JAR_SUFFIXES.add(".esb");
-       DEFAULT_JAR_SUFFIXES.add(".zip");
-       DEFAULT_JAR_SUFFIXES.add(".ear");
-       DEFAULT_JAR_SUFFIXES.add(".jar");
-       DEFAULT_JAR_SUFFIXES.add(".rar");
-       DEFAULT_JAR_SUFFIXES.add(".war");
-       DEFAULT_JAR_SUFFIXES.add(".sar");
-       DEFAULT_JAR_SUFFIXES.add(".har");
-       DEFAULT_JAR_SUFFIXES.add(".aop");
-    }
-    
-    public GroupingStructure()
-    {
-        this(DEFAULT_JAR_SUFFIXES);
-        setRelativeOrder(9000); // before jar structure
-        setRootClasspathEntry(true); // by default root is part of classpath
-        setLibs(Collections.<String> emptySet()); // empty libs
-        setMetaDataPaths(META_INF); // default metadata locations
-        setGroups(CollectionsFactory.<String> createLazySet()); // lazy groups
-        setFilters(Collections.<String, VirtualFileFilter> emptyMap()); // empty                                                                        // filters
-    }
-    
-    public GroupingStructure(Set<String> suffixes)
-    {
-       if (suffixes != null)
-          setSuffixes(suffixes);
-       setRelativeOrder(10000);
-    }
-
-    /**
-     * Gets the set of suffixes recognised as jars
-     *
-     * @param suffixes - the set of suffixes
-     */
-    public void setSuffixes(Set<String> suffixes)
-    {
-       this.suffixes.retainAll(suffixes);
-       this.suffixes.addAll(suffixes);
-    }
-
-    
-    protected boolean hasValidSuffix(String name)
-    {
-       if (name == null)
-          return false;
-
-       int idx = name.lastIndexOf('.');
-       return (idx != -1) && suffixes.contains(name.substring(idx).toLowerCase());
-    }
-
-    public boolean doDetermineStructure(StructureContext structureContext) throws DeploymentException
-    {
-        VirtualFile file = structureContext.getFile();
-
-        if (shortCircuitFileCheck(file) == false)
-            return false;
-        
-        ContextInfo context = null;
-        try
-        {
-            context = createContext(structureContext, metaDataPaths);
-            
-            if (rootClasspathEntry)
-                addClassPath(structureContext, file, true, true, context);
-            
-            // add any archives in libs
-            for (String lib : libs)
-            {
-                VirtualFile libVF = file.getChild(lib);
-                if (libVF != null)
-                {
-                    VirtualFileFilter lf = filters.get(lib);
-                    if (lf == null)
-                        lf = libFilter;
-
-                    List<VirtualFile> archives = libVF.getChildren(lf);
-                    for (VirtualFile archive : archives)
-                        addClassPath(structureContext, archive, true, true, context);
-                } else
-                {
-                    if (log.isTraceEnabled())
-                        log.info("No such lib: " + lib + ", " + file);
-                }
-            }
-
-            // check only children of defined sub-dirs / groups
-            for (String group : groups)
-            {
-                VirtualFile groupVF = file.getChild(group);
-                if (groupVF != null)
-                {
-                    VirtualFileFilter gf = filters.get(group);
-                    if (gf == null)
-                        gf = groupFilter;
-
-                    List<VirtualFile> children = groupVF.getChildren(gf);
-                    for (VirtualFile child : children)
-                        structureContext.determineChildStructure(child);
-                } else
-                {
-                    if (log.isTraceEnabled())
-                        log.info("No such group: " + group + ", " + file);
-                }
-            }
-
-            return true;
-        } 
-        catch (Exception e)
-        {
-            // Remove the invalid context
-            if (context != null)
-                structureContext.removeChild(context);
-
-            throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
-        }
-    }
-
-    /**
-     * Do short circuit file check.
-     * 
-     * @param file
-     *            the file
-     * @return true if we accept the file
-     */
-    protected boolean shortCircuitFileCheck(VirtualFile file)
-    {
-        return shortCircuitFilter != null && shortCircuitFilter.accepts(file);
-    }
-
-    /**
-     * Set short circuit file filter.
-     * 
-     * @param shortCircuitFilter
-     *            the short circuit file filter
-     */
-    public void setShortCircuitFilter(VirtualFileFilter shortCircuitFilter)
-    {
-        this.shortCircuitFilter = shortCircuitFilter;
-    }
-
-    /**
-     * Is root part of classpath.
-     * 
-     * @param rootClasspathEntry
-     *            root cp flag
-     */
-    public void setRootClasspathEntry(boolean rootClasspathEntry)
-    {
-        this.rootClasspathEntry = rootClasspathEntry;
-    }
-
-    /**
-     * Set libs; added as cp entries.
-     * 
-     * @param libs
-     *            the libs
-     */
-    public void setLibs(Set<String> libs)
-    {
-        if (libs == null)
-            throw new IllegalArgumentException("Null libs");
-
-        this.libs = libs;
-    }
-
-    /**
-     * Set default lib filter.
-     * 
-     * @param libFilter
-     *            the filter
-     */
-    public void setLibFilter(VirtualFileFilter libFilter)
-    {
-        this.libFilter = libFilter;
-    }
-
-    /**
-     * Set the default metadata paths.
-     * 
-     * @param metaDataPaths
-     *            the meta data paths
-     */
-    public void setMetaDataPaths(String[] metaDataPaths)
-    {
-        this.metaDataPaths = metaDataPaths;
-    }
-
-    /**
-     * Set groups. Aka grouping sub-directories.
-     * 
-     * @param groups
-     *            the groups
-     */
-    public void setGroups(Set<String> groups)
-    {
-        if (groups == null)
-            throw new IllegalArgumentException("Null groups");
-
-        this.groups = groups;
-    }
-
-    /**
-     * Add group.
-     * 
-     * @param group
-     *            the group
-     */
-    public void addGroup(String group)
-    {
-        groups.add(group);
-    }
-
-    /**
-     * Remove group.
-     * 
-     * @param group
-     *            the group
-     */
-    public void removeGroup(String group)
-    {
-        groups.remove(group);
-    }
-
-    /**
-     * Set default group filter.
-     * 
-     * @param groupFilter
-     *            the filter
-     */
-    public void setGroupFilter(VirtualFileFilter groupFilter)
-    {
-        this.groupFilter = groupFilter;
-    }
-
-    /**
-     * Set filter per path.
-     * 
-     * @param filters
-     *            the filters
-     */
-    public void setFilters(Map<String, VirtualFileFilter> filters)
-    {
-        if (filters == null)
-            throw new IllegalArgumentException("Null filters");
-
-        this.filters = filters;
-    }
-
-    @Override
-    public boolean hasArchiveSuffix(VirtualFile file) {
-        return file != null && hasArchiveSuffix(file.getName());
-    }
-
-    @Override
-    public boolean hasArchiveSuffix(String file) {
-        return hasValidSuffix(file);
-    }
-
-    @Override
-    public boolean isArchive(VirtualFile file) {
-        return shouldMount(file);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/GroupingStructure.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,321 @@
+package org.jboss.soa.esb.listeners.deployers.mc.as6;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.vfs.plugins.structure.AbstractVFSArchiveStructureDeployer;
+import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
+
+import org.jboss.deployers.vfs.spi.deployer.ArchiveMatcher;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.util.collection.CollectionsFactory;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VirtualFileFilter;
+
+/**
+ * Similar to jar or directory structure, being able to handle sub-dirs, but a
+ * bit more strict then dir structure. Only listed sub-directories are
+ * candidates for potential sub-deployments.
+ * 
+ * It also allows you to set metadata paths, libs and should the root be part of
+ * classpath. Each of sub-dirs can be filtered per path or by default per lib or
+ * group.
+ * 
+ * In order to accept anything one must first set shortCircuitFilter instance.
+ * 
+ * @see org.jboss.deployers.vfs.plugins.structure.jar.JARStructure
+ * @see org.jboss.deployers.vfs.plugins.structure.dir.DirectoryStructure
+ * 
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class GroupingStructure extends AbstractVFSArchiveStructureDeployer implements ArchiveMatcher
+{
+    private final Set<String> suffixes = Collections.synchronizedSet(new HashSet<String>());
+    private static final String[] META_INF = { "META-INF" };
+
+    private VirtualFileFilter shortCircuitFilter; // by default null, so we
+                                                  // don't accept anything
+    private boolean rootClasspathEntry;
+
+    // paths
+    private String[] metaDataPaths;
+    private Set<String> libs;
+    private Set<String> groups;
+
+    // filters
+    private VirtualFileFilter libFilter;
+    private VirtualFileFilter groupFilter;
+    private Map<String, VirtualFileFilter> filters; // filter per path
+
+    public static Set<String> DEFAULT_JAR_SUFFIXES = new HashSet<String>();
+    static
+    {
+       DEFAULT_JAR_SUFFIXES = new HashSet<String>();
+       DEFAULT_JAR_SUFFIXES.add(".esb");
+       DEFAULT_JAR_SUFFIXES.add(".zip");
+       DEFAULT_JAR_SUFFIXES.add(".ear");
+       DEFAULT_JAR_SUFFIXES.add(".jar");
+       DEFAULT_JAR_SUFFIXES.add(".rar");
+       DEFAULT_JAR_SUFFIXES.add(".war");
+       DEFAULT_JAR_SUFFIXES.add(".sar");
+       DEFAULT_JAR_SUFFIXES.add(".har");
+       DEFAULT_JAR_SUFFIXES.add(".aop");
+    }
+    
+    public GroupingStructure()
+    {
+        this(DEFAULT_JAR_SUFFIXES);
+        setRelativeOrder(9000); // before jar structure
+        setRootClasspathEntry(true); // by default root is part of classpath
+        setLibs(Collections.<String> emptySet()); // empty libs
+        setMetaDataPaths(META_INF); // default metadata locations
+        setGroups(CollectionsFactory.<String> createLazySet()); // lazy groups
+        setFilters(Collections.<String, VirtualFileFilter> emptyMap()); // empty                                                                        // filters
+    }
+    
+    public GroupingStructure(Set<String> suffixes)
+    {
+       if (suffixes != null)
+          setSuffixes(suffixes);
+       setRelativeOrder(10000);
+    }
+
+    /**
+     * Gets the set of suffixes recognised as jars
+     *
+     * @param suffixes - the set of suffixes
+     */
+    public void setSuffixes(Set<String> suffixes)
+    {
+       this.suffixes.retainAll(suffixes);
+       this.suffixes.addAll(suffixes);
+    }
+
+    
+    protected boolean hasValidSuffix(String name)
+    {
+       if (name == null)
+          return false;
+
+       int idx = name.lastIndexOf('.');
+       return (idx != -1) && suffixes.contains(name.substring(idx).toLowerCase());
+    }
+
+    public boolean doDetermineStructure(StructureContext structureContext) throws DeploymentException
+    {
+        VirtualFile file = structureContext.getFile();
+
+        if (shortCircuitFileCheck(file) == false)
+            return false;
+        
+        ContextInfo context = null;
+        try
+        {
+            context = createContext(structureContext, metaDataPaths);
+            
+            if (rootClasspathEntry)
+                addClassPath(structureContext, file, true, true, context);
+            
+            // add any archives in libs
+            for (String lib : libs)
+            {
+                VirtualFile libVF = file.getChild(lib);
+                if (libVF != null)
+                {
+                    VirtualFileFilter lf = filters.get(lib);
+                    if (lf == null)
+                        lf = libFilter;
+
+                    List<VirtualFile> archives = libVF.getChildren(lf);
+                    for (VirtualFile archive : archives)
+                        addClassPath(structureContext, archive, true, true, context);
+                } else
+                {
+                    if (log.isTraceEnabled())
+                        log.info("No such lib: " + lib + ", " + file);
+                }
+            }
+
+            // check only children of defined sub-dirs / groups
+            for (String group : groups)
+            {
+                VirtualFile groupVF = file.getChild(group);
+                if (groupVF != null)
+                {
+                    VirtualFileFilter gf = filters.get(group);
+                    if (gf == null)
+                        gf = groupFilter;
+
+                    List<VirtualFile> children = groupVF.getChildren(gf);
+                    for (VirtualFile child : children)
+                        structureContext.determineChildStructure(child);
+                } else
+                {
+                    if (log.isTraceEnabled())
+                        log.info("No such group: " + group + ", " + file);
+                }
+            }
+
+            return true;
+        } 
+        catch (Exception e)
+        {
+            // Remove the invalid context
+            if (context != null)
+                structureContext.removeChild(context);
+
+            throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
+        }
+    }
+
+    /**
+     * Do short circuit file check.
+     * 
+     * @param file
+     *            the file
+     * @return true if we accept the file
+     */
+    protected boolean shortCircuitFileCheck(VirtualFile file)
+    {
+        return shortCircuitFilter != null && shortCircuitFilter.accepts(file);
+    }
+
+    /**
+     * Set short circuit file filter.
+     * 
+     * @param shortCircuitFilter
+     *            the short circuit file filter
+     */
+    public void setShortCircuitFilter(VirtualFileFilter shortCircuitFilter)
+    {
+        this.shortCircuitFilter = shortCircuitFilter;
+    }
+
+    /**
+     * Is root part of classpath.
+     * 
+     * @param rootClasspathEntry
+     *            root cp flag
+     */
+    public void setRootClasspathEntry(boolean rootClasspathEntry)
+    {
+        this.rootClasspathEntry = rootClasspathEntry;
+    }
+
+    /**
+     * Set libs; added as cp entries.
+     * 
+     * @param libs
+     *            the libs
+     */
+    public void setLibs(Set<String> libs)
+    {
+        if (libs == null)
+            throw new IllegalArgumentException("Null libs");
+
+        this.libs = libs;
+    }
+
+    /**
+     * Set default lib filter.
+     * 
+     * @param libFilter
+     *            the filter
+     */
+    public void setLibFilter(VirtualFileFilter libFilter)
+    {
+        this.libFilter = libFilter;
+    }
+
+    /**
+     * Set the default metadata paths.
+     * 
+     * @param metaDataPaths
+     *            the meta data paths
+     */
+    public void setMetaDataPaths(String[] metaDataPaths)
+    {
+        this.metaDataPaths = metaDataPaths;
+    }
+
+    /**
+     * Set groups. Aka grouping sub-directories.
+     * 
+     * @param groups
+     *            the groups
+     */
+    public void setGroups(Set<String> groups)
+    {
+        if (groups == null)
+            throw new IllegalArgumentException("Null groups");
+
+        this.groups = groups;
+    }
+
+    /**
+     * Add group.
+     * 
+     * @param group
+     *            the group
+     */
+    public void addGroup(String group)
+    {
+        groups.add(group);
+    }
+
+    /**
+     * Remove group.
+     * 
+     * @param group
+     *            the group
+     */
+    public void removeGroup(String group)
+    {
+        groups.remove(group);
+    }
+
+    /**
+     * Set default group filter.
+     * 
+     * @param groupFilter
+     *            the filter
+     */
+    public void setGroupFilter(VirtualFileFilter groupFilter)
+    {
+        this.groupFilter = groupFilter;
+    }
+
+    /**
+     * Set filter per path.
+     * 
+     * @param filters
+     *            the filters
+     */
+    public void setFilters(Map<String, VirtualFileFilter> filters)
+    {
+        if (filters == null)
+            throw new IllegalArgumentException("Null filters");
+
+        this.filters = filters;
+    }
+
+    @Override
+    public boolean hasArchiveSuffix(VirtualFile file) {
+        return file != null && hasArchiveSuffix(file.getName());
+    }
+
+    @Override
+    public boolean hasArchiveSuffix(String file) {
+        return hasValidSuffix(file);
+    }
+
+    @Override
+    public boolean isArchive(VirtualFile file) {
+        return shouldMount(file);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,283 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- * 
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * 
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.deployers.mc.as6;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.log4j.Logger;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.internal.soa.esb.listeners.war.Filter;
-import org.jboss.internal.soa.esb.listeners.war.Servlet;
-import org.jboss.internal.soa.esb.listeners.war.WebDeploymentArchive;
-import org.jboss.internal.soa.esb.listeners.war.WebModel;
-import org.jboss.internal.soa.esb.publish.ContractReferencePublisher;
-import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
-import org.jboss.internal.soa.esb.webservice.ESBContractGenerator;
-import org.jboss.internal.soa.esb.webservice.ESBResponseFilter;
-import org.jboss.internal.soa.esb.webservice.ESBServiceContractReferencePublisher;
-import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
-import org.jboss.internal.soa.esb.webservice.JAXWSProviderClassGenerator;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
-import org.jboss.soa.esb.Service;
-import org.jboss.soa.esb.util.DeploymentArchive;
-
-import org.jboss.soa.esb.listeners.config.ModelUtil;
-import org.jboss.soa.esb.listeners.config.WebserviceInfo;
-
-/**
- * A builder that builds EBWS/HTTP Gateway web archives
- *
- * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
- * @version $Revision: 1.0 $
- */
-public class WebGatewayBuilder
-{
-    private Logger log = Logger.getLogger(WebGatewayBuilder.class);
-
-    private String deploymentName;
-    private File esbWarFiles;
-    private File esbArchive;
-    private ClassLoader localCl;
-    private List<ContractReferencePublisher> publishers;
-    private List<Servlet> servlets;
-    private ModelAdapter model;
-
-    public WebGatewayBuilder(final File esbWarFiles, final File esbArchive, final String deploymentName, final ClassLoader localCl, final ModelAdapter model)
-    {
-       this.esbWarFiles = esbWarFiles;
-       this.esbArchive = esbArchive;
-       this.deploymentName = deploymentName;
-       this.localCl = localCl;
-       this.model = model;
-    }
-
-    public void setPublishers(final List<ContractReferencePublisher> publishers)
-    {
-        this.publishers = publishers;
-    }
-    
-    public List<ContractReferencePublisher> getPublishers()
-    {
-       return publishers;
-    }
-    
-    public void setServlets(final List<Servlet> servlets)
-    {
-       this.servlets = servlets;
-    }
-    
-    public List<Servlet> getServlets()
-    {
-       return servlets;
-    }
-
-    public File build() throws ConfigurationException, DeploymentException
-    {
-        File war = null;
-        WebDeploymentArchive webDeployment = new WebDeploymentArchive(getESBDeploymentName(), getESBWarFileName());
-        WebModel webModel = webDeployment.getWebModel();
-
-        // Set the global security domain and global security method.
-        // These setting are shared for all http-providers and EBWSs 
-        // in a jboss-esb.xml file. 
-        webModel.setAuthDomain(model.getAuthDomain());
-        webModel.setAuthMethod(model.getAuthMethod());
-
-        // Add the EBWS components...
-        createWebserviceWars(webDeployment);
-
-        // Add the web deployments info to the WebModel...
-        ModelUtil.updateWebModel(deploymentName, ModelUtil.getListenerGroups(model), webModel);
-
-        // Add a sub-deloyment for the web model...
-        this.servlets = webModel.getServlets();
-        if(!servlets.isEmpty()) {
-            
-            // Finalize the webDeployment...
-            webDeployment.finalizeArchive();
-
-            // Now create the web deployment...
-            war = createGatewayTempDeployment(webDeployment);
-
-        }
-        return war;
-    }
-
-    private void createWebserviceWars(WebDeploymentArchive webDeployment) throws DeploymentException
-    {
-        this.publishers = new ArrayList<ContractReferencePublisher>();
-        final List<WebserviceInfo> endpointServices =  model.getWebserviceServices();
-        if (endpointServices != null)
-        {
-            if (endpointServices.size() > 0)
-            {
-                try
-                {
-                    final JAXWSProviderClassGenerator generator = new JAXWSProviderClassGenerator();
-                    
-                    for(WebserviceInfo webserviceInfo: endpointServices)
-                    {
-                        final Service service = webserviceInfo.getService();
- 
-                        // Copy all schemas to the wsdl directory to support imports.
-                        final Map<String, String> schemasMap = JBossDeployerUtil.getSchemas(esbArchive);
-                        final String wsdlDir = "WEB-INF/wsdl/" + service.getCategory().replace('/', '_') + "/";
-                        for (Entry<String, String> schemaEntry : schemasMap.entrySet())
-                        {
-                            webDeployment.addEntry(wsdlDir + schemaEntry.getKey(), schemaEntry.getValue().getBytes());
-                            log.debug("Added schema " + wsdlDir + schemaEntry.getKey());
-                        }
-                        
-                        final ESBServiceEndpointInfo serviceInfo = new ESBServiceEndpointInfo(webserviceInfo);
-                        final String wsdl = ESBContractGenerator.generateWSDL(webserviceInfo, serviceInfo, new WebDeploymentClassLoader(localCl, schemasMap));
-                        webDeployment.addEntry(serviceInfo.getWSDLFileName(), wsdl.getBytes("UTF-8"));
- 
-                        final String handlers = JBossDeployerUtil.getHandlers(serviceInfo);
-                        final boolean includeHandlers = (handlers != null);
-                        if (includeHandlers)
-                        {
-                            final String wsHandlerName = "WEB-INF/classes/" + serviceInfo.getPackageName().replace('.', '/') + "/esb-jaxws-handlers.xml";
-                            webDeployment.addEntry(wsHandlerName, handlers.getBytes("UTF-8"));
-                        }
-                        
-                        final byte[] wsClass = generator.generate(deploymentName, service.getCategory(),
-                            service.getName(), serviceInfo, includeHandlers);
-                        final String wsClassName = serviceInfo.getClassName().replace('.', '/') + ".class";
-                        webDeployment.addEntry("WEB-INF/classes/" + wsClassName, wsClass);
- 
-                        // Servlet....
-                        final Servlet servlet = new Servlet(serviceInfo.getServletName(), serviceInfo.getClassName(), webDeployment.getWebModel());
-                        servlet.getUrlMappings().add("/ebws" + serviceInfo.getServletPath());
- 
-                        // Filter...
-                        // At the moment we only need the filter to overcome a bug in JBossWS re In-Only endpoints, so
-                        // we only include for one way services...
-                        if(serviceInfo.isOneWay()) {
-                            new Filter(serviceInfo.getServletName() + "_Filter", ESBResponseFilter.class.getName(), servlet);
-                        }
- 
-                        final ContractReferencePublisher publisher = new ESBServiceContractReferencePublisher(service, webserviceInfo.getDescription(), serviceInfo.getServletName());
-                        publishers.add(publisher);
-                    }
-                }
-                catch (final Exception ex)
-                {
-                    throw new DeploymentException("Failed to create webservice artifact", ex);
-                }
-            }
-        }
-    }
-
-    private File createGatewayTempDeployment(DeploymentArchive deploymentArchive) throws ConfigurationException
-    {
-
-        File gatewayDeployFile = createTempDeploymentFile(esbWarFiles, getESBWarFileName(), true);
-        FileOutputStream fileOutStream;
-
-        try {
-            fileOutStream = new FileOutputStream(gatewayDeployFile);
-        } catch (FileNotFoundException e) {
-            throw new ConfigurationException("Unexpected exception.", e);
-        }
-
-        try {
-            deploymentArchive.toOutputStream(fileOutStream);
-        } catch (IOException e) {
-            throw new ConfigurationException("Error writing deployment archive '" + gatewayDeployFile.getAbsolutePath() + "'.", e);
-        } finally {
-            try {
-                fileOutStream.close();
-            } catch (IOException e) {
-                log.warn("Error closing deployment archive stream '" + gatewayDeployFile.getAbsolutePath() + "'", e);
-            }
-        }
-
-        return gatewayDeployFile;
-    }
-
-    private File createTempDeploymentFile(final File tempDir, final String archiveName, final boolean createDir) throws ConfigurationException
-    {
-        if (!tempDir.exists())
-        {
-            if (!createDir)
-            {
-                return null;
-            }
-            tempDir.mkdir();
-        }
-
-        File file = new File(tempDir, archiveName);
-        if(file.exists()) {
-            log.debug("Deployment archive '" + archiveName + "' already exists.  Overwriting!!");
-        }
-
-        return file;
-    }
-
-    private String getESBDeploymentName()
-    {
-        final String esbName = deploymentName;
-        final int lastSeparator = esbName.lastIndexOf('.');
-        return ((lastSeparator >= 0) ? esbName.substring(0, lastSeparator) : esbName);
-    }
-    
-    private String getESBWarFileName()
-    {
-        final String esbName = deploymentName;
-        final int lastSeparator = esbName.lastIndexOf('.');
-        return ((lastSeparator >= 0) ? esbName.substring(0, lastSeparator) : esbName) + "-web" +".war";
-    }
-
-    private class WebDeploymentClassLoader extends ClassLoader
-    {
-           
-       private Map<String, String> schemas;
-
-       WebDeploymentClassLoader(final ClassLoader parent, final Map<String, String> schemas)
-       {
-          super(parent);
-          this.schemas = schemas;
-       }
-
-       @Override
-       public InputStream getResourceAsStream (final String name)
-       {
-           if (schemas != null)
-           {
-               String schema = schemas.get(name);
-               if (schema != null)
-                   return new ByteArrayInputStream(schema.getBytes());
-           }
-          
-           return super.getResourceAsStream(name);
-       }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/WebGatewayBuilder.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,283 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.as6;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.log4j.Logger;
+import org.jboss.deployment.DeploymentException;
+import org.jboss.internal.soa.esb.listeners.war.Filter;
+import org.jboss.internal.soa.esb.listeners.war.Servlet;
+import org.jboss.internal.soa.esb.listeners.war.WebDeploymentArchive;
+import org.jboss.internal.soa.esb.listeners.war.WebModel;
+import org.jboss.internal.soa.esb.publish.ContractReferencePublisher;
+import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
+import org.jboss.internal.soa.esb.webservice.ESBContractGenerator;
+import org.jboss.internal.soa.esb.webservice.ESBResponseFilter;
+import org.jboss.internal.soa.esb.webservice.ESBServiceContractReferencePublisher;
+import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
+import org.jboss.internal.soa.esb.webservice.JAXWSProviderClassGenerator;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
+import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.util.DeploymentArchive;
+
+import org.jboss.soa.esb.listeners.config.ModelUtil;
+import org.jboss.soa.esb.listeners.config.WebserviceInfo;
+
+/**
+ * A builder that builds EBWS/HTTP Gateway web archives
+ *
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ * @version $Revision: 1.0 $
+ */
+public class WebGatewayBuilder
+{
+    private Logger log = Logger.getLogger(WebGatewayBuilder.class);
+
+    private String deploymentName;
+    private File esbWarFiles;
+    private File esbArchive;
+    private ClassLoader localCl;
+    private List<ContractReferencePublisher> publishers;
+    private List<Servlet> servlets;
+    private ModelAdapter model;
+
+    public WebGatewayBuilder(final File esbWarFiles, final File esbArchive, final String deploymentName, final ClassLoader localCl, final ModelAdapter model)
+    {
+       this.esbWarFiles = esbWarFiles;
+       this.esbArchive = esbArchive;
+       this.deploymentName = deploymentName;
+       this.localCl = localCl;
+       this.model = model;
+    }
+
+    public void setPublishers(final List<ContractReferencePublisher> publishers)
+    {
+        this.publishers = publishers;
+    }
+    
+    public List<ContractReferencePublisher> getPublishers()
+    {
+       return publishers;
+    }
+    
+    public void setServlets(final List<Servlet> servlets)
+    {
+       this.servlets = servlets;
+    }
+    
+    public List<Servlet> getServlets()
+    {
+       return servlets;
+    }
+
+    public File build() throws ConfigurationException, DeploymentException
+    {
+        File war = null;
+        WebDeploymentArchive webDeployment = new WebDeploymentArchive(getESBDeploymentName(), getESBWarFileName());
+        WebModel webModel = webDeployment.getWebModel();
+
+        // Set the global security domain and global security method.
+        // These setting are shared for all http-providers and EBWSs 
+        // in a jboss-esb.xml file. 
+        webModel.setAuthDomain(model.getAuthDomain());
+        webModel.setAuthMethod(model.getAuthMethod());
+
+        // Add the EBWS components...
+        createWebserviceWars(webDeployment);
+
+        // Add the web deployments info to the WebModel...
+        ModelUtil.updateWebModel(deploymentName, ModelUtil.getListenerGroups(model), webModel);
+
+        // Add a sub-deloyment for the web model...
+        this.servlets = webModel.getServlets();
+        if(!servlets.isEmpty()) {
+            
+            // Finalize the webDeployment...
+            webDeployment.finalizeArchive();
+
+            // Now create the web deployment...
+            war = createGatewayTempDeployment(webDeployment);
+
+        }
+        return war;
+    }
+
+    private void createWebserviceWars(WebDeploymentArchive webDeployment) throws DeploymentException
+    {
+        this.publishers = new ArrayList<ContractReferencePublisher>();
+        final List<WebserviceInfo> endpointServices =  model.getWebserviceServices();
+        if (endpointServices != null)
+        {
+            if (endpointServices.size() > 0)
+            {
+                try
+                {
+                    final JAXWSProviderClassGenerator generator = new JAXWSProviderClassGenerator();
+                    
+                    for(WebserviceInfo webserviceInfo: endpointServices)
+                    {
+                        final Service service = webserviceInfo.getService();
+ 
+                        // Copy all schemas to the wsdl directory to support imports.
+                        final Map<String, String> schemasMap = JBossDeployerUtil.getSchemas(esbArchive);
+                        final String wsdlDir = "WEB-INF/wsdl/" + service.getCategory().replace('/', '_') + "/";
+                        for (Entry<String, String> schemaEntry : schemasMap.entrySet())
+                        {
+                            webDeployment.addEntry(wsdlDir + schemaEntry.getKey(), schemaEntry.getValue().getBytes());
+                            log.debug("Added schema " + wsdlDir + schemaEntry.getKey());
+                        }
+                        
+                        final ESBServiceEndpointInfo serviceInfo = new ESBServiceEndpointInfo(webserviceInfo);
+                        final String wsdl = ESBContractGenerator.generateWSDL(webserviceInfo, serviceInfo, new WebDeploymentClassLoader(localCl, schemasMap));
+                        webDeployment.addEntry(serviceInfo.getWSDLFileName(), wsdl.getBytes("UTF-8"));
+ 
+                        final String handlers = JBossDeployerUtil.getHandlers(serviceInfo);
+                        final boolean includeHandlers = (handlers != null);
+                        if (includeHandlers)
+                        {
+                            final String wsHandlerName = "WEB-INF/classes/" + serviceInfo.getPackageName().replace('.', '/') + "/esb-jaxws-handlers.xml";
+                            webDeployment.addEntry(wsHandlerName, handlers.getBytes("UTF-8"));
+                        }
+                        
+                        final byte[] wsClass = generator.generate(deploymentName, service.getCategory(),
+                            service.getName(), serviceInfo, includeHandlers);
+                        final String wsClassName = serviceInfo.getClassName().replace('.', '/') + ".class";
+                        webDeployment.addEntry("WEB-INF/classes/" + wsClassName, wsClass);
+ 
+                        // Servlet....
+                        final Servlet servlet = new Servlet(serviceInfo.getServletName(), serviceInfo.getClassName(), webDeployment.getWebModel());
+                        servlet.getUrlMappings().add("/ebws" + serviceInfo.getServletPath());
+ 
+                        // Filter...
+                        // At the moment we only need the filter to overcome a bug in JBossWS re In-Only endpoints, so
+                        // we only include for one way services...
+                        if(serviceInfo.isOneWay()) {
+                            new Filter(serviceInfo.getServletName() + "_Filter", ESBResponseFilter.class.getName(), servlet);
+                        }
+ 
+                        final ContractReferencePublisher publisher = new ESBServiceContractReferencePublisher(service, webserviceInfo.getDescription(), serviceInfo.getServletName());
+                        publishers.add(publisher);
+                    }
+                }
+                catch (final Exception ex)
+                {
+                    throw new DeploymentException("Failed to create webservice artifact", ex);
+                }
+            }
+        }
+    }
+
+    private File createGatewayTempDeployment(DeploymentArchive deploymentArchive) throws ConfigurationException
+    {
+
+        File gatewayDeployFile = createTempDeploymentFile(esbWarFiles, getESBWarFileName(), true);
+        FileOutputStream fileOutStream;
+
+        try {
+            fileOutStream = new FileOutputStream(gatewayDeployFile);
+        } catch (FileNotFoundException e) {
+            throw new ConfigurationException("Unexpected exception.", e);
+        }
+
+        try {
+            deploymentArchive.toOutputStream(fileOutStream);
+        } catch (IOException e) {
+            throw new ConfigurationException("Error writing deployment archive '" + gatewayDeployFile.getAbsolutePath() + "'.", e);
+        } finally {
+            try {
+                fileOutStream.close();
+            } catch (IOException e) {
+                log.warn("Error closing deployment archive stream '" + gatewayDeployFile.getAbsolutePath() + "'", e);
+            }
+        }
+
+        return gatewayDeployFile;
+    }
+
+    private File createTempDeploymentFile(final File tempDir, final String archiveName, final boolean createDir) throws ConfigurationException
+    {
+        if (!tempDir.exists())
+        {
+            if (!createDir)
+            {
+                return null;
+            }
+            tempDir.mkdir();
+        }
+
+        File file = new File(tempDir, archiveName);
+        if(file.exists()) {
+            log.debug("Deployment archive '" + archiveName + "' already exists.  Overwriting!!");
+        }
+
+        return file;
+    }
+
+    private String getESBDeploymentName()
+    {
+        final String esbName = deploymentName;
+        final int lastSeparator = esbName.lastIndexOf('.');
+        return ((lastSeparator >= 0) ? esbName.substring(0, lastSeparator) : esbName);
+    }
+    
+    private String getESBWarFileName()
+    {
+        final String esbName = deploymentName;
+        final int lastSeparator = esbName.lastIndexOf('.');
+        return ((lastSeparator >= 0) ? esbName.substring(0, lastSeparator) : esbName) + "-web" +".war";
+    }
+
+    private class WebDeploymentClassLoader extends ClassLoader
+    {
+           
+       private Map<String, String> schemas;
+
+       WebDeploymentClassLoader(final ClassLoader parent, final Map<String, String> schemas)
+       {
+          super(parent);
+          this.schemas = schemas;
+       }
+
+       @Override
+       public InputStream getResourceAsStream (final String name)
+       {
+           if (schemas != null)
+           {
+               String schema = schemas.get(name);
+               if (schema != null)
+                   return new ByteArrayInputStream(schema.getBytes());
+           }
+          
+           return super.getResourceAsStream(name);
+       }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- * 
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * 
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.deployers.mc.as6.util;
-
-import org.jboss.vfs.VirtualFile;
-import org.jboss.vfs.VirtualFileFilter;
-
-/**
- * A {@link VirtualFileFilter} implementation that takes a suffix as a parameter to its 
- * constructor.
- * 
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- *
- */
-public class VfsFileFilter implements VirtualFileFilter
-{
-    private final String suffix;
-    
-    /**
-     * Creates a instance using the passed in suffix
-     * @param suffix The suffix for this filter. 
-     * 
-     * @throws IllegalArgumentException If the passed in suffix is null.
-     */
-    public VfsFileFilter(final String suffix)
-    {
-        if (suffix == null)
-            throw new IllegalArgumentException("suffix argument must not be null");
-            
-        this.suffix = suffix;
-        
-    }
-    
-    /**
-     * Accepts only files ending with the suffix.
-     * 
-     * @param file  The file to filter.
-     * @return true If the file name ends with suffix.
-     */
-    public boolean accepts(final VirtualFile file)
-    {
-        return file.getName().endsWith(suffix);
-    }
-    
-    public String getSuffix()
-    {
-        return suffix;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsFileFilter.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.as6.util;
+
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VirtualFileFilter;
+
+/**
+ * A {@link VirtualFileFilter} implementation that takes a suffix as a parameter to its 
+ * constructor.
+ * 
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class VfsFileFilter implements VirtualFileFilter
+{
+    private final String suffix;
+    
+    /**
+     * Creates a instance using the passed in suffix
+     * @param suffix The suffix for this filter. 
+     * 
+     * @throws IllegalArgumentException If the passed in suffix is null.
+     */
+    public VfsFileFilter(final String suffix)
+    {
+        if (suffix == null)
+            throw new IllegalArgumentException("suffix argument must not be null");
+            
+        this.suffix = suffix;
+        
+    }
+    
+    /**
+     * Accepts only files ending with the suffix.
+     * 
+     * @param file  The file to filter.
+     * @return true If the file name ends with suffix.
+     */
+    public boolean accepts(final VirtualFile file)
+    {
+        return file.getName().endsWith(suffix);
+    }
+    
+    public String getSuffix()
+    {
+        return suffix;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,189 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- * 
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * 
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.deployers.mc.as6.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import org.jboss.internal.soa.esb.util.StreamUtils;
-//import org.jboss.vfs.MemoryFileFactory;
-import org.jboss.vfs.VirtualFile;
-
-/**
- * Util methods for interacting with JBoss VFS
- * <p/>
- * 
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- *
- */
-public final class VfsUtil
-{
-    /**
-     * Protocol for VFS in-memory URLs.
-     */
-    private static final String IN_MEMORY_PROTOCOL = "vfsmemory";
-    
-    private VfsUtil() {}
-    
-    /**
-     * Creates a new in-memory virtual file system or returns an already existing one..
-     * 
-     * @param url The url which of which this host property will be the root of the fs.
-     * @return VirtualFile The {@link VirtualFile} that represents the root of the fs.
-     * @throws IOException
-     */
-    /*
-    public static VirtualFile createInMemoryFs(final VirtualFile inMemRootDir, final URL rootUrl) throws IOException
-    {
-    	
-    	VirtualFile file = inMemRootDir.getChild(rootUrl);
-        
-    	return file;
-    	//return MemoryFileFactory.createRoot(rootUrl).getRoot();
-    }
-    */
-    
-    /**
-     * Will add the fileContent to the in-memory rootUrl a the location specified by filePath. 
-     * </p>
-     * 
-     * @param rootUrl The root of the in-memory fs.
-     * @param filePath The path relative to the rootUrl.
-     * @param fileContent The contents of the file to add.
-     * @return {@link VirtualFile} A reference to the newly created file in the in-memory file system.
-     * @throws MalformedURLException
-     */
-    /*
-    public static VirtualFile addFile(final URL rootUrl, final String filePath, final byte[] fileContent) throws MalformedURLException
-    {
-        final URL fileUrl = new URL(rootUrl + "/" + filePath);
-        return MemoryFileFactory.putFile(fileUrl, fileContent);
-    }
-    */
-
-    /**
-     * A simple method that creates a new url with a protocol of 'vfsmemory'.
-     * 
-     * @param root Will be the name (hostname) of the root in-memory file system. 
-     * @return {@link URL} An url that represents a root of an in-memory file system.
-     * @throws MalformedURLException
-     */
-    public static URL createInMemUrl(final String root) throws MalformedURLException
-    {
-        return new URL(IN_MEMORY_PROTOCOL, root, "");
-    }
-    
-    public static URL createInMemUrl(final String root, final String path) throws MalformedURLException
-    {
-        return new URL(IN_MEMORY_PROTOCOL, root, "/" + path);
-    }
-    
-    public static URL createInMemUrl(final URL root, final String path) throws MalformedURLException
-    {
-        return new URL(IN_MEMORY_PROTOCOL, root.getHost(), root.getPath() + "/" + path);
-    }
-    /*
-    public static void addFiles(final List<VirtualFile> files, final URL destUrl, final String subPath) throws IOException, URISyntaxException
-    {
-        addFiles(files, destUrl, subPath, null);
-    }
-    
-    public static void addFiles(final List<VirtualFile> files, final URL destUrl, final String subPath, final String pathPrefix) throws IOException, URISyntaxException
-    {
-        for (final VirtualFile file : files)
-        {
-            String path = subpath(file.getPathName(), subPath, pathPrefix);
-            addFile(file, destUrl, path);
-        }
-    }
-    
-    public static void addFiles(final Map<VirtualFile, String> filesToNamesMap, final URL destUrl, final String pathPrefix) throws IOException, URISyntaxException
-    {
-        Set<Entry<VirtualFile, String>> entrySet = filesToNamesMap.entrySet();
-        for (Entry<VirtualFile, String> entry : entrySet)
-        {
-            VirtualFile file = entry.getKey();
-            String path = entry.getValue();
-            addFile(file, destUrl, pathPrefix + path);
-        }
-    }
-    
-    private static void addFile(final VirtualFile file, final URL destUrl, final String path) throws IOException
-    {
-        InputStream in = null;
-        try
-        {
-            in = file.openStream();
-            final URL newUrl = createInMemUrl(destUrl.getHost(), path);
-            MemoryFileFactory.putFile(newUrl, StreamUtils.readStream(in));
-        }
-        finally
-        {
-            in.close();
-        }
-    }
-
-*/
-    
-    static String subpath(final String path, final String pathName, final String pathPrefix)
-    {
-        if (path == null || pathName == null)
-        {
-            return path;
-        }
-        
-        final int idx = path.indexOf(pathName);
-        final String subpath ;
-        if (idx != -1)
-        {
-            subpath = path.substring(idx + pathName.length());
-        }
-        else
-        {
-            subpath = path ;
-        }
-        if (pathPrefix == null)
-        {
-            return subpath;
-        }
-        else if (subpath.startsWith("/")) 
-        {
-            return pathPrefix + subpath;
-        }
-        else
-        {
-            return pathPrefix + "/" + subpath;
-        }
-    }
-    
-    static String subpath(final String path, final String pathName)
-    {
-        return subpath(path, pathName, null);
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/deployers/mc/as6/util/VfsUtil.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.as6.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+//import org.jboss.vfs.MemoryFileFactory;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * Util methods for interacting with JBoss VFS
+ * <p/>
+ * 
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public final class VfsUtil
+{
+    /**
+     * Protocol for VFS in-memory URLs.
+     */
+    private static final String IN_MEMORY_PROTOCOL = "vfsmemory";
+    
+    private VfsUtil() {}
+    
+    /**
+     * Creates a new in-memory virtual file system or returns an already existing one..
+     * 
+     * @param url The url which of which this host property will be the root of the fs.
+     * @return VirtualFile The {@link VirtualFile} that represents the root of the fs.
+     * @throws IOException
+     */
+    /*
+    public static VirtualFile createInMemoryFs(final VirtualFile inMemRootDir, final URL rootUrl) throws IOException
+    {
+    	
+    	VirtualFile file = inMemRootDir.getChild(rootUrl);
+        
+    	return file;
+    	//return MemoryFileFactory.createRoot(rootUrl).getRoot();
+    }
+    */
+    
+    /**
+     * Will add the fileContent to the in-memory rootUrl a the location specified by filePath. 
+     * </p>
+     * 
+     * @param rootUrl The root of the in-memory fs.
+     * @param filePath The path relative to the rootUrl.
+     * @param fileContent The contents of the file to add.
+     * @return {@link VirtualFile} A reference to the newly created file in the in-memory file system.
+     * @throws MalformedURLException
+     */
+    /*
+    public static VirtualFile addFile(final URL rootUrl, final String filePath, final byte[] fileContent) throws MalformedURLException
+    {
+        final URL fileUrl = new URL(rootUrl + "/" + filePath);
+        return MemoryFileFactory.putFile(fileUrl, fileContent);
+    }
+    */
+
+    /**
+     * A simple method that creates a new url with a protocol of 'vfsmemory'.
+     * 
+     * @param root Will be the name (hostname) of the root in-memory file system. 
+     * @return {@link URL} An url that represents a root of an in-memory file system.
+     * @throws MalformedURLException
+     */
+    public static URL createInMemUrl(final String root) throws MalformedURLException
+    {
+        return new URL(IN_MEMORY_PROTOCOL, root, "");
+    }
+    
+    public static URL createInMemUrl(final String root, final String path) throws MalformedURLException
+    {
+        return new URL(IN_MEMORY_PROTOCOL, root, "/" + path);
+    }
+    
+    public static URL createInMemUrl(final URL root, final String path) throws MalformedURLException
+    {
+        return new URL(IN_MEMORY_PROTOCOL, root.getHost(), root.getPath() + "/" + path);
+    }
+    /*
+    public static void addFiles(final List<VirtualFile> files, final URL destUrl, final String subPath) throws IOException, URISyntaxException
+    {
+        addFiles(files, destUrl, subPath, null);
+    }
+    
+    public static void addFiles(final List<VirtualFile> files, final URL destUrl, final String subPath, final String pathPrefix) throws IOException, URISyntaxException
+    {
+        for (final VirtualFile file : files)
+        {
+            String path = subpath(file.getPathName(), subPath, pathPrefix);
+            addFile(file, destUrl, path);
+        }
+    }
+    
+    public static void addFiles(final Map<VirtualFile, String> filesToNamesMap, final URL destUrl, final String pathPrefix) throws IOException, URISyntaxException
+    {
+        Set<Entry<VirtualFile, String>> entrySet = filesToNamesMap.entrySet();
+        for (Entry<VirtualFile, String> entry : entrySet)
+        {
+            VirtualFile file = entry.getKey();
+            String path = entry.getValue();
+            addFile(file, destUrl, pathPrefix + path);
+        }
+    }
+    
+    private static void addFile(final VirtualFile file, final URL destUrl, final String path) throws IOException
+    {
+        InputStream in = null;
+        try
+        {
+            in = file.openStream();
+            final URL newUrl = createInMemUrl(destUrl.getHost(), path);
+            MemoryFileFactory.putFile(newUrl, StreamUtils.readStream(in));
+        }
+        finally
+        {
+            in.close();
+        }
+    }
+
+*/
+    
+    static String subpath(final String path, final String pathName, final String pathPrefix)
+    {
+        if (path == null || pathName == null)
+        {
+            return path;
+        }
+        
+        final int idx = path.indexOf(pathName);
+        final String subpath ;
+        if (idx != -1)
+        {
+            subpath = path.substring(idx + pathName.length());
+        }
+        else
+        {
+            subpath = path ;
+        }
+        if (pathPrefix == null)
+        {
+            return subpath;
+        }
+        else if (subpath.startsWith("/")) 
+        {
+            return pathPrefix + subpath;
+        }
+        else
+        {
+            return pathPrefix + "/" + subpath;
+        }
+    }
+    
+    static String subpath(final String path, final String pathName)
+    {
+        return subpath(path, pathName, null);
+    }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java
===================================================================
--- labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,102 +0,0 @@
-/*
- * =========================================================================
- * ==  NOTICE file corresponding to the section 4 d of                    ==
- * ==  the Apache License, Version 2.0,                                   ==
- * ==  in this case for the Apache Camel distribution.                    ==
- * =========================================================================
- * 
- * This product includes software developed by
- * The Apache Software Foundation (http://www.apache.org/).
- * 
- * Please read the different LICENSE files present in the licenses directory of
- * this distribution
- */
-package org.jboss.soa.esb.listeners.gateway.camel.as6;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Set;
-
-import org.apache.camel.impl.DefaultPackageScanClassResolver;
-import org.apache.camel.spi.PackageScanFilter;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VirtualFile;
-import org.jboss.vfs.VisitorAttributes;
-import org.jboss.vfs.util.AbstractVirtualFileVisitor;
-
-/**
- * JBoss specific package scan classloader to be used when Camel is running
- * inside JBoss Application Server.
- * 
- * <p>The camel-jboss jar is unavailable in the maven repository, so we have to build this class ourselves.</p>
- * Explanation: http://camel.apache.org/camel-jboss.html<br/>
- * Source: http://code.google.com/p/camel-extra/source/browse/trunk/components/camel-jboss/src/main/java/org/apache/camel/jboss/JBossPackageScanClassResolver.java<br/>
- * NOTICE: http://code.google.com/p/camel-extra/source/browse/trunk/components/camel-jboss/src/main/resources/META-INF/NOTICE.txt<br/>
- * LICENSE: http://code.google.com/p/camel-extra/source/browse/trunk/components/camel-jboss/src/main/resources/META-INF/LICENSE.txt
- */
-public class JBossPackageScanClassResolver extends DefaultPackageScanClassResolver {
-
-    @Override
-    protected void find(PackageScanFilter test, String packageName, ClassLoader loader, Set<Class<?>> classes) {
-        if (log.isTraceEnabled()) {
-            log.trace("Searching for: " + test + " in package: " + packageName
-                    + " using classloader: " + loader.getClass().getName());
-        }
-
-        Enumeration<URL> urls;
-        try {
-            urls = getResources(loader, packageName);
-            if (!urls.hasMoreElements()) {
-                log.trace("No URLs returned by classloader");
-            }
-        }
-        catch (IOException ioe) {
-            log.warn("Could not read package: " + packageName, ioe);
-            return;
-        }
-
-        while (urls.hasMoreElements()) {
-            URL url = null;
-            try {
-                url = urls.nextElement();
-                if (log.isTraceEnabled()) {
-                    log.trace("URL from classloader: " + url);
-                }
-                VirtualFile root = VFS.getChild(url);
-                root.visit(new MatchingClassVisitor(test, classes));
-            } catch (IOException ioe) {
-                log.warn("Could not read entries in url: " + url, ioe);
-            } catch (URISyntaxException e) {
-                log.warn("Could not read entries in url: " + url, e);
-            }
-        }
-    }
-
-    private class MatchingClassVisitor extends AbstractVirtualFileVisitor {
-        private PackageScanFilter filter;
-        private Set<Class<?>> classes;
-
-        private MatchingClassVisitor(PackageScanFilter filter, Set<Class<?>> classes) {
-            super(VisitorAttributes.RECURSE_LEAVES_ONLY);
-            this.filter = filter;
-            this.classes = classes;
-        }
-
-        public void visit(VirtualFile file) {
-            if (file.getName().endsWith(".class")) {
-                String fqn = file.getPathName();
-                String qn;
-                if (fqn.indexOf("jar/") != -1) {
-                    qn = fqn.substring(fqn.indexOf("jar/") + 4);
-                } else {
-                    qn = fqn.substring(fqn.indexOf("/") + 1);
-                }
-
-                addIfMatching(filter, qn, classes);
-            }
-        }
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/deployer-as6/src/org/jboss/soa/esb/listeners/gateway/camel/as6/JBossPackageScanClassResolver.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,102 @@
+/*
+ * =========================================================================
+ * ==  NOTICE file corresponding to the section 4 d of                    ==
+ * ==  the Apache License, Version 2.0,                                   ==
+ * ==  in this case for the Apache Camel distribution.                    ==
+ * =========================================================================
+ * 
+ * This product includes software developed by
+ * The Apache Software Foundation (http://www.apache.org/).
+ * 
+ * Please read the different LICENSE files present in the licenses directory of
+ * this distribution
+ */
+package org.jboss.soa.esb.listeners.gateway.camel.as6;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Set;
+
+import org.apache.camel.impl.DefaultPackageScanClassResolver;
+import org.apache.camel.spi.PackageScanFilter;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VisitorAttributes;
+import org.jboss.vfs.util.AbstractVirtualFileVisitor;
+
+/**
+ * JBoss specific package scan classloader to be used when Camel is running
+ * inside JBoss Application Server.
+ * 
+ * <p>The camel-jboss jar is unavailable in the maven repository, so we have to build this class ourselves.</p>
+ * Explanation: http://camel.apache.org/camel-jboss.html<br/>
+ * Source: http://code.google.com/p/camel-extra/source/browse/trunk/components/camel-jboss/src/main/java/org/apache/camel/jboss/JBossPackageScanClassResolver.java<br/>
+ * NOTICE: http://code.google.com/p/camel-extra/source/browse/trunk/components/camel-jboss/src/main/resources/META-INF/NOTICE.txt<br/>
+ * LICENSE: http://code.google.com/p/camel-extra/source/browse/trunk/components/camel-jboss/src/main/resources/META-INF/LICENSE.txt
+ */
+public class JBossPackageScanClassResolver extends DefaultPackageScanClassResolver {
+
+    @Override
+    protected void find(PackageScanFilter test, String packageName, ClassLoader loader, Set<Class<?>> classes) {
+        if (log.isTraceEnabled()) {
+            log.trace("Searching for: " + test + " in package: " + packageName
+                    + " using classloader: " + loader.getClass().getName());
+        }
+
+        Enumeration<URL> urls;
+        try {
+            urls = getResources(loader, packageName);
+            if (!urls.hasMoreElements()) {
+                log.trace("No URLs returned by classloader");
+            }
+        }
+        catch (IOException ioe) {
+            log.warn("Could not read package: " + packageName, ioe);
+            return;
+        }
+
+        while (urls.hasMoreElements()) {
+            URL url = null;
+            try {
+                url = urls.nextElement();
+                if (log.isTraceEnabled()) {
+                    log.trace("URL from classloader: " + url);
+                }
+                VirtualFile root = VFS.getChild(url);
+                root.visit(new MatchingClassVisitor(test, classes));
+            } catch (IOException ioe) {
+                log.warn("Could not read entries in url: " + url, ioe);
+            } catch (URISyntaxException e) {
+                log.warn("Could not read entries in url: " + url, e);
+            }
+        }
+    }
+
+    private class MatchingClassVisitor extends AbstractVirtualFileVisitor {
+        private PackageScanFilter filter;
+        private Set<Class<?>> classes;
+
+        private MatchingClassVisitor(PackageScanFilter filter, Set<Class<?>> classes) {
+            super(VisitorAttributes.RECURSE_LEAVES_ONLY);
+            this.filter = filter;
+            this.classes = classes;
+        }
+
+        public void visit(VirtualFile file) {
+            if (file.getName().endsWith(".class")) {
+                String fqn = file.getPathName();
+                String qn;
+                if (fqn.indexOf("jar/") != -1) {
+                    qn = fqn.substring(fqn.indexOf("jar/") + 4);
+                } else {
+                    qn = fqn.substring(fqn.indexOf("/") + 1);
+                }
+
+                addIfMatching(filter, qn, classes);
+            }
+        }
+    }
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/ivy.xml (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/rosetta/ivy.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/ivy.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/ivy.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -0,0 +1,22 @@
+<ivy-module version="2.0">
+    <info organisation="org.jboss" module="jbossesb"/>    
+    <dependencies>
+
+        <!-- JBoss Microcontainer dependencies -->
+        <dependency org="org.jboss.deployers" name="jboss-deployers-vfs-spi" rev="2.2.0.GA">
+            <exclude org="jboss" module="jboss-vfs"/>
+        </dependency>
+
+        <dependency org="org.jboss.deployers" name="jboss-deployers-vfs" rev="2.2.0.GA"/>
+        <dependency org="org.jboss.deployers" name="jboss-deployers-spi" rev="2.2.0.GA"/>
+        <dependency org="org.jboss.deployers" name="jboss-deployers-core-spi" rev="2.2.0.GA"/>
+        <dependency org="org.jboss.deployers" name="jboss-deployers-core" rev="2.2.0.GA"/>
+        <dependency org="org.jboss.deployers" name="jboss-deployers-impl" rev="2.2.0.GA"/>
+        <dependency org="org.jboss.deployers" name="jboss-deployers-structure-spi" rev="2.2.0.GA"/>
+        <dependency org="org.jboss.deployers" name="jboss-deployers-client" rev="2.2.0.GA"/>
+        <dependency org="org.jboss.deployers" name="jboss-deployers-client-spi" rev="2.2.0.GA"/>
+
+        <dependency org="org.jboss" name="jboss-vfs" rev="3.0.0.GA"/>
+        
+    </dependencies>
+</ivy-module>

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/WebDeploymentArchive.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/WebDeploymentArchive.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/WebDeploymentArchive.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -52,6 +52,11 @@
         webModel = new WebModel(archiveName);
     }
 
+    public WebDeploymentArchive(String esbName, String warName) {
+        super(esbName);
+        webModel = new WebModel(esbName, warName);
+    }
+    
     public WebModel getWebModel() {
         assertNotFinalized();
         return webModel;

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/WebModel.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/WebModel.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/WebModel.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -34,6 +34,7 @@
 public class WebModel {
 
     private String esbName;
+    private String warName;
     private List<Filter> filters = new ArrayList<Filter>();
     private List<Servlet> servlets = new ArrayList<Servlet>();
     private Set<String> securityRoles = new LinkedHashSet<String>();
@@ -42,13 +43,33 @@
 
     public WebModel(String esbName) {
         AssertArgument.isNotNullAndNotEmpty(esbName, "esbName");
+        this.esbName = getESBDeploymentName(esbName);
+        this.warName = esbName;
+    }
+
+    public WebModel(String esbName, String warName) {
+        AssertArgument.isNotNullAndNotEmpty(esbName, "esbName");
+        AssertArgument.isNotNullAndNotEmpty(warName, "warName");
         this.esbName = esbName;
+        this.warName = warName;
     }
+    
+    private String getESBDeploymentName(String deploymentName)
+    {
+        final String esbName = deploymentName;
+        final int lastSeparator = esbName.lastIndexOf('.');
+        return ((lastSeparator >= 0) ? esbName.substring(0, lastSeparator) : esbName);
+    }
 
+    
     public String getEsbName() {
         return esbName;
     }
 
+    public String getWarName() {
+        return warName;
+    }
+    
     public List<Filter> getFilters() {
         return filters;
     }

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/templates/jboss-web.xml.ftl
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/templates/jboss-web.xml.ftl	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/templates/jboss-web.xml.ftl	2011-05-25 00:45:17 UTC (rev 37031)
@@ -4,5 +4,5 @@
     <#if webModel.authDomain??>
     <security-domain>${webModel.authDomain}</security-domain>
     </#if>
-
-</jboss-web>
\ No newline at end of file
+    <context-root>${webModel.esbName}</context-root>
+</jboss-web>

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/JBossDeployerUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/JBossDeployerUtil.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/JBossDeployerUtil.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -105,7 +105,7 @@
             try
             {
                 // Try Native impl first
-                loader.loadClass("org.jboss.ws.extensions.addressing.soap.SOAPAddressingBuilderImpl");
+                loader.loadClass("org.jboss.ws.core.server.ServerHandlerDelegate");
                 WSIMPL = WSIMPL_NATIVE;
             }
             catch (Throwable t1)

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/camel/CamelGateway.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/camel/CamelGateway.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/camel/CamelGateway.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -21,6 +21,8 @@
 
 import java.io.StringReader;
 import java.io.StringWriter;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.util.HashSet;
 import java.util.Properties;
 import java.util.Set;
@@ -98,12 +100,19 @@
 
 	private static final Logger logger = Logger.getLogger(CamelGateway.class);
 
+	private static final String AS6_CLASS_RESOLVER = "org.jboss.soa.esb.listeners.gateway.camel.as6.JBossPackageScanClassResolver";
+	
 	private static final boolean isAS4;
+        private static final boolean isAS5;
+	private static final boolean isAS6;
+
 	static {
 		try {
 			MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
 			String versionNumber = (String)mbeanServer.getAttribute(new ObjectName("jboss.system:type=Server"), "VersionNumber");
 			isAS4 = (Integer.valueOf(versionNumber.substring(0, 1)).intValue() == 4);
+                        isAS5 = (Integer.valueOf(versionNumber.substring(0, 1)).intValue() == 5);
+			isAS6 = (Integer.valueOf(versionNumber.substring(0, 1)).intValue() == 6);
 		} catch (Throwable t) {
 			throw new RuntimeException("problem detecting JBoss AS version", t);
 		}
@@ -145,18 +154,41 @@
 		// we need to disable JMX so we don't depend on Spring classes
 		camelContext.disableJMX();
 		// configure correct classloading
-		PackageScanClassResolver packageScanClassResolver;
-		if (!isAS4) {
+		DefaultPackageScanClassResolver packageScanClassResolver = null;
+		if (isAS4) {
+                    packageScanClassResolver = (DefaultPackageScanClassResolver) camelContext.getPackageScanClassResolver();
+                    if (packageScanClassResolver == null) {
+                            packageScanClassResolver = new DefaultPackageScanClassResolver();
+                            camelContext.setPackageScanClassResolver(packageScanClassResolver);
+                    }
+		} else if (isAS5) {
 			// JBossESB on AS5+ needs this to handle VFS classloading URIs.
 			// JBossESB on AS4 will not work if we use this.
 			packageScanClassResolver = new JBossPackageScanClassResolver();
 			camelContext.setPackageScanClassResolver(packageScanClassResolver);
-		} else {
-			packageScanClassResolver = camelContext.getPackageScanClassResolver();
-			if (packageScanClassResolver == null) {
-				packageScanClassResolver = new DefaultPackageScanClassResolver();
-				camelContext.setPackageScanClassResolver(packageScanClassResolver);
-			}
+		} else if (isAS6) {		   
+		    try {
+		        Class c = Class.forName(AS6_CLASS_RESOLVER);
+		        Constructor con = c.getConstructor();
+		        packageScanClassResolver= (DefaultPackageScanClassResolver) con.newInstance();
+                        camelContext.setPackageScanClassResolver(packageScanClassResolver);		        
+		    } catch (InstantiationException e) {
+		        throw new ManagedLifecycleException(e);
+		    } catch (ClassNotFoundException e) {
+                        throw new ManagedLifecycleException(e);
+                    } catch (SecurityException e) {
+                        throw new ManagedLifecycleException(e);
+                    } catch (NoSuchMethodException e) {
+                        throw new ManagedLifecycleException(e);
+                    } catch (IllegalArgumentException e) {
+                        throw new ManagedLifecycleException(e);
+                    } catch (IllegalAccessException e) {
+                        throw new ManagedLifecycleException(e);
+                    } catch (InvocationTargetException e) {
+                        throw new ManagedLifecycleException(e);
+                    }
+		    		    
+                    camelContext.setPackageScanClassResolver(packageScanClassResolver);		    
 		}
 		Set<ClassLoader> classLoaders = new HashSet<ClassLoader>();
 		classLoaders.add(Thread.currentThread().getContextClassLoader());

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authdomain_jbosswebxml.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authdomain_jbosswebxml.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authdomain_jbosswebxml.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -2,5 +2,5 @@
 <jboss-web>
 
         <security-domain>java:/jaas/JBossWS</security-domain>
-
-</jboss-web>
\ No newline at end of file
+	<context-root>testarch</context-root>
+</jboss-web>

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authdomain_webxml.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authdomain_webxml.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authdomain_webxml.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -10,8 +10,8 @@
 
     <login-config>
         <auth-method>BASIC</auth-method>
-        <realm-name>Authentication Realm for testarch.esb</realm-name>
+        <realm-name>Authentication Realm for testarch</realm-name>
     </login-config>
 
 
-</web-app>
\ No newline at end of file
+</web-app>

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authmethod_jbosswebxml.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authmethod_jbosswebxml.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authmethod_jbosswebxml.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <jboss-web>
+    <context-root>testarch</context-root>
 
-
-</jboss-web>
\ No newline at end of file
+</jboss-web>

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authmethod_webxml.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authmethod_webxml.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_authmethod_webxml.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -10,8 +10,8 @@
 
     <login-config>
         <auth-method>BASIC</auth-method>
-        <realm-name>Authentication Realm for testarch.esb</realm-name>
+        <realm-name>Authentication Realm for testarch</realm-name>
     </login-config>
 
 
-</web-app>
\ No newline at end of file
+</web-app>

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -35,7 +35,7 @@
 
     <login-config>
         <auth-method>BASIC</auth-method>
-        <realm-name>Authentication Realm for testarch.esb</realm-name>
+        <realm-name>Authentication Realm for testarch</realm-name>
     </login-config>
 
     <security-role>
@@ -45,4 +45,4 @@
         <role-name>accountant</role-name>
     </security-role>
 
-</web-app>
\ No newline at end of file
+</web-app>

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -38,7 +38,7 @@
 
     <login-config>
         <auth-method>BASIC</auth-method>
-        <realm-name>Authentication Realm for testarch.esb</realm-name>
+        <realm-name>Authentication Realm for testarch</realm-name>
     </login-config>
 
     <security-role>
@@ -48,4 +48,4 @@
         <role-name>accountant</role-name>
     </security-role>
 
-</web-app>
\ No newline at end of file
+</web-app>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -243,6 +243,8 @@
             <pathelement location="${org.jboss.esb.server.home}/lib/dom4j.jar"/>
             <pathelement location="${org.jboss.esb.server.common.lib}/antlr.jar"/>
             <pathelement location="${org.jboss.esb.server.common.lib}/jbosssx.jar"/>
+            <!-- AS6 has it in lib -->
+            <pathelement location="${org.jboss.esb.server.home}/lib/jbosssx.jar"/>
             
             <!-- smooks.esb jars -->
             <fileset dir="${org.jboss.esb.server.deploy.dir}/smooks.esb" includes="*.jar"/>

Modified: labs/jbossesb/trunk/product/services/base-project-build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/base-project-build.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/base-project-build.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -145,7 +145,9 @@
 	
     <target name="service-esb"/>
 
-	<target name="dist" depends="esb">
+    <target name="service-dist"/>
+
+    <target name="dist" depends="esb,service-dist">
 		<!-- copying to jbossesb/lib -->
     	<mkdir dir="${esb.product.lib.dir}/${ant.project.name}.esb"/>
     	<copy todir="${esb.product.lib.dir}/${ant.project.name}.esb">

Modified: labs/jbossesb/trunk/product/services/jbossesb/build.properties
===================================================================
--- labs/jbossesb/trunk/product/services/jbossesb/build.properties	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/jbossesb/build.properties	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,4 +1,5 @@
+esb.build.dir=../../build
 esb.product.lib.dir=../../build/jbossesb/lib
 esb.main.lib=../../build/lib
 esb.product.lib.ext=../../lib/ext
-services.base.build=../base-project-build.xml
\ No newline at end of file
+services.base.build=../base-project-build.xml

Deleted: labs/jbossesb/trunk/product/services/jbpm/as6/jbpm-identity-3.2.7.jar
===================================================================
(Binary files differ)

Copied: labs/jbossesb/trunk/product/services/jbpm/as6/jbpm-identity-3.2.7.jar (from rev 37030, labs/jbossesb/workspace/tcunning/as6/product/services/jbpm/as6/jbpm-identity-3.2.7.jar)
===================================================================
(Binary files differ)

Modified: labs/jbossesb/trunk/product/services/jbpm/build.properties
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/build.properties	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/jbpm/build.properties	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,4 +1,5 @@
+esb.build.dir=../../build
 esb.product.lib.dir=../../build/jbossesb/lib
 esb.main.lib=../../build/lib
 esb.product.lib.ext=../../lib/ext
-services.base.build=../base-project-build.xml
\ No newline at end of file
+services.base.build=../base-project-build.xml

Modified: labs/jbossesb/trunk/product/services/jbpm/build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/build.xml	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/jbpm/build.xml	2011-05-25 00:45:17 UTC (rev 37031)
@@ -15,4 +15,12 @@
 	
 	<target name="test" depends="base.test"/>
 
+        <target name="service-dist" depends="base-esb">
+       		<mkdir dir="${esb.build.dir}/jbossesb/install/as6-extras/jbpm"/>
+	 	<copy todir="${esb.build.dir}/jbossesb/install/as6-extras/jbpm">
+                        <fileset dir="as6" includes="*.jar"/>
+                </copy>
+        </target>
+
+
 </project>

Modified: labs/jbossesb/trunk/product/services/jbrules/build.properties
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/build.properties	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/jbrules/build.properties	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,4 +1,5 @@
+esb.build.dir=../../build
 esb.product.lib.dir=../../build/jbossesb/lib
 esb.main.lib=../../build/lib
 esb.product.lib.ext=../../lib/ext
-services.base.build=../base-project-build.xml
\ No newline at end of file
+services.base.build=../base-project-build.xml

Modified: labs/jbossesb/trunk/product/services/slsb/build.properties
===================================================================
--- labs/jbossesb/trunk/product/services/slsb/build.properties	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/slsb/build.properties	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,4 +1,5 @@
+esb.build.dir=../../build
 esb.product.lib.dir=../../build/jbossesb/lib
 esb.main.lib=../../build/lib
 esb.product.lib.ext=../../lib/ext
-services.base.build=../base-project-build.xml
\ No newline at end of file
+services.base.build=../base-project-build.xml

Modified: labs/jbossesb/trunk/product/services/smooks/build.properties
===================================================================
--- labs/jbossesb/trunk/product/services/smooks/build.properties	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/smooks/build.properties	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,4 +1,5 @@
+esb.build.dir=../../build
 esb.product.lib.dir=../../build/jbossesb/lib
 esb.main.lib=../../build/lib
 esb.product.lib.ext=../../lib/ext
-services.base.build=../base-project-build.xml
\ No newline at end of file
+services.base.build=../base-project-build.xml

Modified: labs/jbossesb/trunk/product/services/soap/build.properties
===================================================================
--- labs/jbossesb/trunk/product/services/soap/build.properties	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/soap/build.properties	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,4 +1,5 @@
+esb.build.dir=../../build
 esb.product.lib.dir=../../build/jbossesb/lib
 esb.main.lib=../../build/lib
 esb.product.lib.ext=../../lib/ext
-services.base.build=../base-project-build.xml
\ No newline at end of file
+services.base.build=../base-project-build.xml

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -131,29 +131,21 @@
         // TODO link this is with security
         return false ;
     }
-
-    /*
-     * The following methods are not supported by this adapter.
-     */
-
-    public StringBuffer getRequestURL()
-    {
-        throw new UnsupportedOperationException("Not yet supported") ;
-    }
     
     public String getAuthType()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public Cookie[] getCookies()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
-    public long getDateHeader(String arg0)
+    public long getDateHeader(String name)
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        String s = this.getHeader(name);
+        return s != null ? Long.valueOf(s) : 0;
     }
 
     public Enumeration getHeaders(final String name)
@@ -169,54 +161,64 @@
         }
     }
 
-    public int getIntHeader(String arg0)
+    public int getIntHeader(String name)
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        String s = this.getHeader(name);
+        return s != null ? Integer.valueOf(s) : 0;
     }
 
+    /*
+     * The following methods are not supported by this adapter.
+     */
+
+    public StringBuffer getRequestURL()
+    {
+        return null;
+    }
+
     public String getPathTranslated()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public String getRemoteUser()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public String getRequestedSessionId()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public String getServletPath()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public HttpSession getSession()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public boolean isRequestedSessionIdFromCookie()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return false;
     }
 
     public boolean isRequestedSessionIdFromURL()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return false;
     }
 
     public boolean isRequestedSessionIdFromUrl()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return false;
     }
 
     public boolean isRequestedSessionIdValid()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return false;
     }
 
     public Enumeration getAttributeNames()
@@ -231,12 +233,12 @@
 
     public int getContentLength()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return 0;
     }
 
     public Locale getLocale()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public Enumeration getLocales()
@@ -261,7 +263,7 @@
 
     public String getProtocol()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public BufferedReader getReader() throws IOException
@@ -276,12 +278,12 @@
 
     public String getRemoteAddr()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public String getRemoteHost()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public RequestDispatcher getRequestDispatcher(String arg0)
@@ -291,17 +293,17 @@
 
     public String getScheme()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public String getServerName()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public int getServerPort()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return 0;
     }
 
     public boolean isSecure()
@@ -333,21 +335,21 @@
 
     public String getLocalAddr()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public String getLocalName()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return null;
     }
 
     public int getLocalPort()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return 0;
     }
 
     public int getRemotePort()
     {
-        throw new UnsupportedOperationException("Not yet supported") ;
+        return 0;
     }
 }

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/cxf/CXFFactory.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/cxf/CXFFactory.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/cxf/CXFFactory.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -265,7 +265,7 @@
     {
         public Bus getBus(final Endpoint endpoint)
         {
-            final BusHolder busHolder = endpoint.getAttachment(BusHolder.class) ;
+            final BusHolder busHolder = endpoint.getService().getDeployment().getAttachment(BusHolder.class) ;
             return busHolder.getBus() ;
         }
     }

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/cxf/ServletControllerExtProviderFactory.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/cxf/ServletControllerExtProviderFactory.java	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/cxf/ServletControllerExtProviderFactory.java	2011-05-25 00:45:17 UTC (rev 37031)
@@ -83,7 +83,7 @@
         
         BusHolderImpl(final Endpoint endpoint, final ServletContext context)
         {
-            final BusHolder busHolder = endpoint.getAttachment(BusHolder.class) ;
+            final BusHolder busHolder = endpoint.getService().getDeployment().getAttachment(BusHolder.class) ;
             final Bus bus = busHolder.getBus() ;
 
             final ServletTransportFactory servletTransportFactory = new SOAPProcessorServletTransportFactory(bus, getTransport(bus)) ;

Modified: labs/jbossesb/trunk/product/services/spring/build.properties
===================================================================
--- labs/jbossesb/trunk/product/services/spring/build.properties	2011-05-24 17:12:40 UTC (rev 37030)
+++ labs/jbossesb/trunk/product/services/spring/build.properties	2011-05-25 00:45:17 UTC (rev 37031)
@@ -1,4 +1,5 @@
+esb.build.dir=../../build
 esb.product.lib.dir=../../build/jbossesb/lib
 esb.main.lib=../../build/lib
 esb.product.lib.ext=../../lib/ext
-services.base.build=../base-project-build.xml
\ No newline at end of file
+services.base.build=../base-project-build.xml



More information about the jboss-svn-commits mailing list