[jboss-cvs] JBossAS SVN: r61233 - in trunk: ejb3/src/main/org/jboss/ejb3/metamodel and 12 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 8 18:43:59 EST 2007


Author: thomas.diesler at jboss.com
Date: 2007-03-08 18:43:59 -0500 (Thu, 08 Mar 2007)
New Revision: 61233

Added:
   trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java
   trunk/server/src/main/org/jboss/metadata/serviceref/VirtualFileAdaptor.java
Removed:
   trunk/server/src/main/org/jboss/metadata/serviceref/CallPropertyMetaData.java
   trunk/server/src/main/org/jboss/metadata/serviceref/HandlerChainMetaData.java
   trunk/server/src/main/org/jboss/metadata/serviceref/HandlerChainsMetaData.java
   trunk/server/src/main/org/jboss/metadata/serviceref/HandlerMetaData.java
   trunk/server/src/main/org/jboss/metadata/serviceref/InitParamMetaData.java
   trunk/server/src/main/org/jboss/metadata/serviceref/PortComponentRefMetaData.java
   trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefHandlerDelegate.java
   trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefMetaData.java
   trunk/server/src/main/org/jboss/metadata/serviceref/StubPropertyMetaData.java
Modified:
   trunk/build/build-thirdparty.xml
   trunk/ejb3/src/main/org/jboss/ejb3/metamodel/EjbJarDDObjectFactory.java
   trunk/ejb3/src/main/org/jboss/ejb3/metamodel/EnterpriseBeans.java
   trunk/ejb3/src/main/org/jboss/ejb3/metamodel/Injectable.java
   trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossClientDDObjectFactory.java
   trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossDDObjectFactory.java
   trunk/ejb3/src/main/org/jboss/injection/ServiceRefInjector.java
   trunk/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java
   trunk/server/.classpath
   trunk/server/build.xml
   trunk/server/src/main/org/jboss/deployment/ClientDeployer.java
   trunk/server/src/main/org/jboss/deployment/EjbJarObjectFactory.java
   trunk/server/src/main/org/jboss/deployment/JBossEjbObjectFactory.java
   trunk/server/src/main/org/jboss/ejb/Container.java
   trunk/server/src/main/org/jboss/metadata/BeanMetaData.java
   trunk/server/src/main/org/jboss/metadata/ClientMetaData.java
   trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java
   trunk/server/src/main/org/jboss/metadata/WebMetaData.java
   trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefObjectFactory.java
   trunk/server/src/main/org/jboss/metadata/web/JBossWebMetaDataObjectFactory.java
   trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java
   trunk/server/src/main/org/jboss/metamodel/descriptor/DDObjectFactory.java
   trunk/server/src/main/org/jboss/metamodel/descriptor/EnvironmentRefGroup.java
   trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java
   trunk/tomcat/.classpath
   trunk/tomcat/build.xml
   trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/JBossWebDDObjectFactory.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment2.java
Log:
Provide general purpose ws integration

Modified: trunk/build/build-thirdparty.xml
===================================================================
--- trunk/build/build-thirdparty.xml	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/build/build-thirdparty.xml	2007-03-08 23:43:59 UTC (rev 61233)
@@ -92,7 +92,7 @@
       <componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
       <componentref name="jboss/jaxr" version="1.2.0.GA"/>
       <componentref name="jboss/jbossxb" version="2.0.0.CR1"/>
-      <componentref name="jboss/jbossws" version="snapshot"/>
+      <componentref name="jboss/jbossws" version="2.0.0.CR5"/>
       <componentref name="jboss/jbossws-wsconsume-impl" version="2.0.0"/>
       <componentref name="jboss/messaging" version="1.2.0.CR1"/>
       <componentref name="jboss/microcontainer" version="2.0.0.Beta3"/>

Modified: trunk/ejb3/src/main/org/jboss/ejb3/metamodel/EjbJarDDObjectFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/metamodel/EjbJarDDObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/ejb3/src/main/org/jboss/ejb3/metamodel/EjbJarDDObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -30,7 +30,6 @@
 import org.jboss.ejb3.KernelAbstractionFactory;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.SecurityRoleRefMetaData;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.metamodel.descriptor.DDObjectFactory;
 import org.jboss.metamodel.descriptor.EjbLocalRef;
 import org.jboss.metamodel.descriptor.EjbRef;
@@ -44,6 +43,7 @@
 import org.jboss.metamodel.descriptor.RunAs;
 import org.jboss.metamodel.descriptor.SecurityRole;
 import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.jboss.xb.binding.JBossXBException;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.Unmarshaller;

Modified: trunk/ejb3/src/main/org/jboss/ejb3/metamodel/EnterpriseBeans.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/metamodel/EnterpriseBeans.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/ejb3/src/main/org/jboss/ejb3/metamodel/EnterpriseBeans.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -28,7 +28,6 @@
 import java.util.List;
 
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.metamodel.descriptor.EjbLocalRef;
 import org.jboss.metamodel.descriptor.EjbRef;
 import org.jboss.metamodel.descriptor.InjectionTarget;
@@ -36,6 +35,7 @@
 import org.jboss.metamodel.descriptor.MessageDestinationRef;
 import org.jboss.metamodel.descriptor.ResourceEnvRef;
 import org.jboss.metamodel.descriptor.ResourceRef;
+import org.jboss.ws.integration.ServiceRefMetaData;
 
 /**
  * Represents EJB elements of the ejb-jar.xml deployment descriptor for the 1.4

Modified: trunk/ejb3/src/main/org/jboss/ejb3/metamodel/Injectable.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/metamodel/Injectable.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/ejb3/src/main/org/jboss/ejb3/metamodel/Injectable.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -24,7 +24,6 @@
 import java.util.Collection;
 import java.util.List;
 
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.metamodel.descriptor.EjbLocalRef;
 import org.jboss.metamodel.descriptor.EjbRef;
 import org.jboss.metamodel.descriptor.JndiRef;
@@ -33,6 +32,7 @@
 import org.jboss.metamodel.descriptor.PersistenceUnitRef;
 import org.jboss.metamodel.descriptor.ResourceEnvRef;
 import org.jboss.metamodel.descriptor.ResourceRef;
+import org.jboss.ws.integration.ServiceRefMetaData;
 
 /**
  * 

Modified: trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossClientDDObjectFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossClientDDObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossClientDDObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -25,13 +25,13 @@
 import java.net.URL;
 
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.metamodel.descriptor.DDObjectFactory;
 import org.jboss.metamodel.descriptor.EjbRef;
 import org.jboss.metamodel.descriptor.MessageDestinationRef;
 import org.jboss.metamodel.descriptor.ResourceEnvRef;
 import org.jboss.metamodel.descriptor.ResourceRef;
 import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.jboss.xb.binding.JBossXBException;
 import org.jboss.xb.binding.Unmarshaller;
 import org.jboss.xb.binding.UnmarshallerFactory;
@@ -109,7 +109,7 @@
       }
       else
       {
-         targetRef.mergeJBossProperties(sref);
+         targetRef.merge(sref);
       }
    }
 

Modified: trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossDDObjectFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossDDObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossDDObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -30,7 +30,6 @@
 import org.jboss.ejb3.KernelAbstractionFactory;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.SecurityRoleMetaData;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.metamodel.descriptor.DDObjectFactory;
 import org.jboss.metamodel.descriptor.EjbLocalRef;
 import org.jboss.metamodel.descriptor.EjbRef;
@@ -41,6 +40,7 @@
 import org.jboss.metamodel.descriptor.ResourceEnvRef;
 import org.jboss.metamodel.descriptor.ResourceRef;
 import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.jboss.xb.binding.JBossXBException;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.Unmarshaller;
@@ -676,7 +676,7 @@
       }
       else
       {
-         targetRef.mergeJBossProperties(sref);
+         targetRef.merge(sref);
       }
    }
 

Modified: trunk/ejb3/src/main/org/jboss/injection/ServiceRefInjector.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/ServiceRefInjector.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/ejb3/src/main/org/jboss/injection/ServiceRefInjector.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -29,9 +29,10 @@
 import javax.xml.ws.WebServiceException;
 
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefHandlerDelegate;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
+import org.jboss.metadata.serviceref.VirtualFileAdaptor;
+import org.jboss.ws.integration.ServiceRefMetaData;
+import org.jboss.ws.integration.UnifiedVirtualFile;
 
 /**
  * Inject a web service ref.
@@ -58,8 +59,8 @@
       try
       {
          Context envCtx = container.getEnc();
-         VirtualFile vfsRoot = container.getRootFile();
-         ServiceRefHandlerDelegate.bindServiceRef(envCtx, name, vfsRoot, sref);
+         UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(container.getRootFile());
+         new ServiceRefDelegate().setupServiceRef(envCtx, name, vfsRoot, sref);
       }
       catch (Exception e)
       {

Modified: trunk/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -21,7 +21,7 @@
  */
 package org.jboss.injection;
 
-// $Id$
+// $Id: WebServiceRefHandler.java 61084 2007-03-05 14:50:45Z thomas.diesler at jboss.com $
 
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Field;
@@ -34,8 +34,9 @@
 import javax.xml.ws.WebServiceRefs;
 
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
 import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
+import org.jboss.ws.integration.ServiceRefMetaData;
 
 /**
  * Handle @WebServiceRef annotations
@@ -142,8 +143,9 @@
       if (sref == null)
       {
          log.debug("No override for @WebServiceRef.name: " + name);
-         sref = new ServiceRefMetaData();
-         sref.setServiceRefName(name);
+         sref = new ServiceRefDelegate().newMetaData();
+         if (sref != null)
+            sref.setServiceRefName(name);
       }
       return sref;
    }

Modified: trunk/server/.classpath
===================================================================
--- trunk/server/.classpath	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/.classpath	2007-03-08 23:43:59 UTC (rev 61233)
@@ -36,5 +36,7 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/jbossws/lib/jboss-saaj.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs.jar" sourcepath="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/dom4j/lib/dom4j.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/jbossws/lib/jbossws-integration.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer-src.zip"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: trunk/server/build.xml
===================================================================
--- trunk/server/build.xml	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/build.xml	2007-03-08 23:43:59 UTC (rev 61233)
@@ -82,14 +82,14 @@
       <path refid="gjt.jpl-util.classpath"/>
       <path refid="gnu.getopt.classpath"/>
       <path refid="ibm.wsdl4j.classpath"/>
-      <path refid="junit.junit.classpath"/>
-      <path refid="oswego.concurrent.classpath"/>
-      <path refid="sun.servlet.classpath"/>
       <path refid="jboss.remoting.classpath"/>
       <path refid="jboss.jbossxb.classpath"/>
       <path refid="jboss.jbossws.classpath"/>
       <path refid="jboss.microcontainer.classpath"/>
       <path refid="jboss.jboss.vfs.classpath"/>
+      <path refid="junit.junit.classpath"/>
+      <path refid="oswego.concurrent.classpath"/>
+      <path refid="sun.servlet.classpath"/>
     </path>
 
     <!-- ======= -->

Modified: trunk/server/src/main/org/jboss/deployment/ClientDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/ClientDeployer.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/deployment/ClientDeployer.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -48,10 +48,12 @@
 import org.jboss.metadata.ResourceEnvRefMetaData;
 import org.jboss.metadata.ResourceRefMetaData;
 import org.jboss.metadata.XmlFileLoader;
-import org.jboss.metadata.serviceref.ServiceRefHandlerDelegate;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
+import org.jboss.metadata.serviceref.VirtualFileAdaptor;
 import org.jboss.naming.Util;
 import org.jboss.util.xml.DOMUtils;
 import org.jboss.virtual.VirtualFile;
+import org.jboss.ws.integration.UnifiedVirtualFile;
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.Element;
 
@@ -268,8 +270,8 @@
       }
 
       // Bind <service-ref> elements
-      VirtualFile vfsRoot = unit.getDeploymentContext().getRoot();
-      ServiceRefHandlerDelegate.bindServiceRefs(envCtx, vfsRoot, metaData.getServiceRefs().values());
+      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
+      new ServiceRefDelegate().setupServiceRefs(envCtx, vfsRoot, metaData.getServiceRefs().values());
 
       // Bind resource references
       HashMap resRefs = metaData.getResourceReferences();

Modified: trunk/server/src/main/org/jboss/deployment/EjbJarObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/EjbJarObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/deployment/EjbJarObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -48,7 +48,7 @@
 import org.jboss.metadata.SecurityRoleMetaData;
 import org.jboss.metadata.SecurityRoleRefMetaData;
 import org.jboss.metadata.SessionMetaData;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.UnmarshallingContext;
 import org.xml.sax.Attributes;

Modified: trunk/server/src/main/org/jboss/deployment/JBossEjbObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JBossEjbObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/deployment/JBossEjbObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -53,8 +53,8 @@
 import org.jboss.metadata.SecurityIdentityMetaData;
 import org.jboss.metadata.SecurityRoleMetaData;
 import org.jboss.metadata.SessionMetaData;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.mx.util.ObjectNameFactory;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.jboss.xb.binding.UnmarshallingContext;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -590,7 +590,7 @@
       }
       else
       {
-         targetRef.mergeJBossProperties(sref);
+         targetRef.merge(sref);
       }
    }
 

Modified: trunk/server/src/main/org/jboss/ejb/Container.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/Container.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/ejb/Container.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -75,7 +75,8 @@
 import org.jboss.metadata.MessageDestinationRefMetaData;
 import org.jboss.metadata.ResourceEnvRefMetaData;
 import org.jboss.metadata.ResourceRefMetaData;
-import org.jboss.metadata.serviceref.ServiceRefHandlerDelegate;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
+import org.jboss.metadata.serviceref.VirtualFileAdaptor;
 import org.jboss.mx.util.ObjectNameConverter;
 import org.jboss.mx.util.ObjectNameFactory;
 import org.jboss.naming.ENCFactory;
@@ -90,6 +91,7 @@
 import org.jboss.util.NestedError;
 import org.jboss.util.NestedRuntimeException;
 import org.jboss.virtual.VirtualFile;
+import org.jboss.ws.integration.UnifiedVirtualFile;
 import org.omg.CORBA.ORB;
 
 /**
@@ -1224,8 +1226,8 @@
       }
 
       // Bind service references
-      VirtualFile vfsRoot = unit.getDeploymentContext().getRoot();
-      ServiceRefHandlerDelegate.bindServiceRefs(envCtx, vfsRoot, metaData.getServiceRefs().values());
+      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
+      new ServiceRefDelegate().setupServiceRefs(envCtx, vfsRoot, metaData.getServiceRefs().values());
 
       // Bind resource references
       {

Modified: trunk/server/src/main/org/jboss/metadata/BeanMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/BeanMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/BeanMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,24 +1,24 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.metadata;
 
 import java.io.Serializable;
@@ -35,16 +35,17 @@
 
 import org.jboss.deployment.DeploymentException;
 import org.jboss.invocation.InvocationType;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
+import org.jboss.metadata.serviceref.ServiceRefObjectFactory;
 import org.jboss.mx.util.ObjectNameFactory;
 import org.jboss.security.AnybodyPrincipal;
 import org.jboss.security.NobodyPrincipal;
 import org.jboss.security.SimplePrincipal;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.w3c.dom.Element;
 
 import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
 
-
 /**
  * A common meta data class for the entity, message-driven and session beans.
  *
@@ -60,9 +61,7 @@
  *
  * @version $Revision$
  */
-public abstract class BeanMetaData
-   extends MetaData
-   implements Serializable
+public abstract class BeanMetaData extends MetaData implements Serializable
 {
    private static final long serialVersionUID = 1;
 
@@ -173,7 +172,7 @@
    /** Whether to throw an exception on a rollback if there is no exception */
    private boolean exceptionRollback = false;
    /** Whether timer persistence is enabled */
-   private boolean timerPersistence = true;      
+   private boolean timerPersistence = true;
 
    // Static --------------------------------------------------------
 
@@ -183,7 +182,7 @@
       this.application = app;
       this.beanType = beanType;
    }
-   
+
    public void setBeanType(char beanType)
    {
       this.beanType = beanType;
@@ -268,7 +267,7 @@
    {
       return ejbName;
    }
-   
+
    public void setEjbName(String ejbName)
    {
       this.ejbName = ejbName;
@@ -342,7 +341,7 @@
 
    public void addInvokerBinding(String bindingName, String jndiName)
    {
-      if(invokerBindings == null)
+      if (invokerBindings == null)
       {
          invokerBindings = new HashMap();
       }
@@ -603,7 +602,8 @@
          return MetaData.TX_SUPPORTS;
 
       Byte b = (Byte)methodTx.get(m);
-      if (b != null) return b.byteValue();
+      if (b != null)
+         return b.byteValue();
 
       byte result = getMethodTransactionType(m.getName(), m.getParameterTypes(), iface);
 
@@ -633,8 +633,7 @@
       if (methodName == null)
          methodName = "*null*";
 
-      MethodAttributes ma =
-         (MethodAttributes)cachedMethodAttributes.get(methodName);
+      MethodAttributes ma = (MethodAttributes)cachedMethodAttributes.get(methodName);
 
       if (ma == null)
       {
@@ -700,8 +699,7 @@
     *  @return The Set<Principal> for the application domain roles that
     *     caller principal's are to be validated against.
     */
-   public Set getMethodPermissions(String methodName, Class[] params,
-                                   InvocationType iface)
+   public Set getMethodPermissions(String methodName, Class[] params, InvocationType iface)
    {
       Set result = new HashSet();
       // First check the excluded method list as this takes priority over
@@ -713,10 +711,10 @@
          if (m.patternMatches(methodName, params, iface))
          {
             /* No one is allowed to execute this method so add a role that
-               fails to equate to any Principal or Principal name and return.
-               We don't return null to differentiate between an explicit
-               assignment of no access and no assignment information.
-            */
+             fails to equate to any Principal or Principal name and return.
+             We don't return null to differentiate between an explicit
+             assignment of no access and no assignment information.
+             */
             result.add(NobodyPrincipal.NOBODY_PRINCIPAL);
             return result;
          }
@@ -730,9 +728,9 @@
          if (m.patternMatches(methodName, params, iface))
          {
             /* If this is an unchecked method anyone can access it so
-               set the result set to a role that equates to any Principal or
-               Principal name and return.
-            */
+             set the result set to a role that equates to any Principal or
+             Principal name and return.
+             */
             if (m.isUnchecked())
             {
                result.clear();
@@ -772,8 +770,7 @@
     * @param iface - the method interface type
     * @return true if a matching method permission exists, false if no match
     */
-   public boolean hasMethodPermission(String methodName, Class[] params,
-                                      InvocationType iface)
+   public boolean hasMethodPermission(String methodName, Class[] params, InvocationType iface)
    {
       // First check the excluded method list as this takes priority
       Iterator iterator = getExcludedMethods();
@@ -826,7 +823,7 @@
             clusterConfig = new ClusterConfigMetaData();
          }
          /* All beans associated with a container are the same type
-            so this can be done more than once without harm */
+          so this can be done more than once without harm */
          clusterConfig.init(this);
       }
       return this.clusterConfig;
@@ -846,7 +843,7 @@
    {
       return timerPersistence;
    }
-   
+
    public ApplicationMetaData getApplication()
    {
       return application;
@@ -1031,7 +1028,7 @@
    {
       this.securityRoleReferences.add(srrf);
    }
-   
+
    public void setSecurityRoleReferences(ArrayList securityRoleReferences)
    {
       this.securityRoleReferences = securityRoleReferences;
@@ -1056,8 +1053,7 @@
     * @param element one of session/entity/message-driven
     * @throws DeploymentException
     */
-   public void importEjbJarXml(Element element)
-      throws DeploymentException
+   public void importEjbJarXml(Element element) throws DeploymentException
    {
       // set the ejb-name
       ejbName = getElementContent(getUniqueChild(element, "ejb-name"));
@@ -1067,8 +1063,7 @@
       {
          homeClass = getElementContent(getOptionalChild(element, "home"));
          remoteClass = getElementContent(getOptionalChild(element, "remote"));
-         localHomeClass = getElementContent(getOptionalChild(element,
-            "local-home"));
+         localHomeClass = getElementContent(getOptionalChild(element, "local-home"));
          localClass = getElementContent(getOptionalChild(element, "local"));
       }
       ejbClass = getElementContent(getUniqueChild(element, "ejb-class"));
@@ -1109,8 +1104,7 @@
          EjbLocalRefMetaData ejbLocalRefMetaData = new EjbLocalRefMetaData();
          ejbLocalRefMetaData.importEjbJarXml(ejbLocalRef);
 
-         ejbLocalReferences.put(ejbLocalRefMetaData.getName(),
-            ejbLocalRefMetaData);
+         ejbLocalReferences.put(ejbLocalRefMetaData.getName(), ejbLocalRefMetaData);
       }
 
       // Parse the service-ref elements
@@ -1118,11 +1112,14 @@
       while (iterator.hasNext())
       {
          Element serviceRef = (Element)iterator.next();
-         if (ServiceRefMetaData.isJ2EE14Descriptor(serviceRef))
+         if (ServiceRefObjectFactory.isJ2EE14Descriptor(serviceRef))
          {
-            ServiceRefMetaData refMetaData = new ServiceRefMetaData();
-            refMetaData.importStandardXml(serviceRef);
-            serviceRefs.put(refMetaData.getServiceRefName(), refMetaData);
+            ServiceRefMetaData sref = new ServiceRefDelegate().newMetaData();
+            if (sref != null)
+            {
+               sref.importStandardXml(serviceRef);
+               serviceRefs.put(sref.getServiceRefName(), sref);
+            }
          }
       }
 
@@ -1138,8 +1135,7 @@
       }
 
       // The security-identity element
-      Element securityIdentityElement = getOptionalChild(element,
-         "security-identity");
+      Element securityIdentityElement = getOptionalChild(element, "security-identity");
       if (securityIdentityElement != null)
       {
          securityIdentity = new SecurityIdentityMetaData();
@@ -1156,8 +1152,7 @@
          ResourceRefMetaData resourceRefMetaData = new ResourceRefMetaData();
          resourceRefMetaData.importEjbJarXml(resourceRef);
 
-         resourceReferences.put(resourceRefMetaData.getRefName(),
-            resourceRefMetaData);
+         resourceReferences.put(resourceRefMetaData.getRefName(), resourceRefMetaData);
       }
 
       // Parse the resource-env-ref elements
@@ -1217,7 +1212,7 @@
 
       // Whether to persist ejb timers across redeployments
       timerPersistence = MetaData.getOptionalChildBooleanContent(element, "timer-persistence", true);
-      
+
       // update the resource references (optional)
       Iterator iterator = getChildrenByTagName(element, "resource-ref");
       while (iterator.hasNext())
@@ -1273,7 +1268,6 @@
          ejbRefMetaData.importJbossXml(ejbRef);
       }
 
-
       //handle the ejb-local-ref elements
       iterator = getChildrenByTagName(element, "ejb-local-ref");
       while (iterator.hasNext())
@@ -1296,7 +1290,7 @@
          Element serviceRef = (Element)iterator.next();
          String serviceRefName = MetaData.getUniqueChildContent(serviceRef, "service-ref-name");
          ServiceRefMetaData refMetaData = (ServiceRefMetaData)serviceRefs.get(serviceRefName);
-         if (refMetaData == null && ServiceRefMetaData.isJ2EE14Descriptor(serviceRef))
+         if (refMetaData == null && ServiceRefObjectFactory.isJ2EE14Descriptor(serviceRef))
          {
             throw new DeploymentException("service-ref " + serviceRefName + " found in jboss.xml but not in ejb-jar.xml");
          }
@@ -1310,8 +1304,7 @@
       {
          if (securityIdentity == null)
             throw new DeploymentException(ejbName + ", security-identity in jboss.xml has no match in ejb-jar.xml");
-         String runAsPrincipal = getElementContent(getUniqueChild(securityIdentityElement,
-            "run-as-principal"), securityIdentity.getRunAsPrincipalName());
+         String runAsPrincipal = getElementContent(getUniqueChild(securityIdentityElement, "run-as-principal"), securityIdentity.getRunAsPrincipalName());
          securityIdentity.setRunAsPrincipalName(runAsPrincipal);
       }
 
@@ -1320,13 +1313,11 @@
       if (ejbTimeoutIdentityElement != null)
       {
          ejbTimeoutIdentity = new SecurityIdentityMetaData();
-         String runAsPrincipal = getElementContent(getUniqueChild(ejbTimeoutIdentityElement,
-                 "run-as-principal"), null);
+         String runAsPrincipal = getElementContent(getUniqueChild(ejbTimeoutIdentityElement, "run-as-principal"), null);
          ejbTimeoutIdentity.setRunAsRoleName("ejbTimeout");
-         if( runAsPrincipal != null && runAsPrincipal.length() > 0 )
+         if (runAsPrincipal != null && runAsPrincipal.length() > 0)
             ejbTimeoutIdentity.setRunAsPrincipalName(runAsPrincipal);
-         else
-            ejbTimeoutIdentity.setUseCallerIdentity(true);
+         else ejbTimeoutIdentity.setUseCallerIdentity(true);
       }
 
       // Method attributes of the bean

Modified: trunk/server/src/main/org/jboss/metadata/ClientMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/ClientMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/ClientMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -32,7 +32,9 @@
 
 import org.jboss.deployment.DeploymentException;
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
+import org.jboss.metadata.serviceref.ServiceRefObjectFactory;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.w3c.dom.Element;
 
 /** The metdata data from a j2ee application-client.xml descriptor
@@ -174,11 +176,14 @@
       while (iterator.hasNext())
       {
          Element serviceRef = (Element)iterator.next();
-         if (ServiceRefMetaData.isJ2EE14Descriptor(serviceRef))
+         if (ServiceRefObjectFactory.isJ2EE14Descriptor(serviceRef))
          {
-            ServiceRefMetaData refMetaData = new ServiceRefMetaData();
-            refMetaData.importStandardXml(serviceRef);
-            serviceRefs.put(refMetaData.getServiceRefName(), refMetaData);
+            ServiceRefMetaData sref = new ServiceRefDelegate().newMetaData();
+            if (sref != null)
+            {
+               sref.importStandardXml(serviceRef);
+               serviceRefs.put(sref.getServiceRefName(), sref);
+            }
          }
       }
 
@@ -265,15 +270,18 @@
       {
          Element serviceRef = (Element)iterator.next();
          String serviceRefName = MetaData.getUniqueChildContent(serviceRef, "service-ref-name");
-         ServiceRefMetaData refMetaData = (ServiceRefMetaData)serviceRefs.get(serviceRefName);
-         if (refMetaData == null)
+         ServiceRefMetaData sref = (ServiceRefMetaData)serviceRefs.get(serviceRefName);
+         if (sref == null)
          {
             log.warn("service-ref " + serviceRefName + " found in jboss-web.xml but not in web.xml");
-            refMetaData = new ServiceRefMetaData();
-            refMetaData.setServiceRefName(serviceRefName);
-            serviceRefs.put(serviceRefName, refMetaData);
+            sref = new ServiceRefDelegate().newMetaData();
+            if (sref != null)
+            {
+               sref.setServiceRefName(serviceRefName);
+               serviceRefs.put(serviceRefName, sref);
+            }
          }
-         refMetaData.importJBossXml(serviceRef);
+         sref.importJBossXml(serviceRef);
       }
 
       // Get the JNDI name binding for resource-refs

Modified: trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -24,7 +24,7 @@
 import javax.persistence.PersistenceContextType;
 
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
 import org.jboss.metadata.serviceref.ServiceRefObjectFactory;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.UnmarshallingContext;
@@ -435,7 +435,7 @@
       }
       else if (localName.equals("service-ref"))
       {
-         child = new ServiceRefMetaData();
+         child = new ServiceRefDelegate().newMetaData();
       }
       else if (localName.equals("jndi-ref"))
       {

Modified: trunk/server/src/main/org/jboss/metadata/WebMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/WebMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/WebMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,24 +1,24 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.metadata;
 
 import java.io.Serializable;
@@ -37,7 +37,7 @@
 
 import org.jboss.deployment.DeploymentException;
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
 import org.jboss.metadata.web.ErrorPage;
 import org.jboss.metadata.web.Filter;
 import org.jboss.metadata.web.FilterMapping;
@@ -55,6 +55,7 @@
 import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
 import org.jboss.mx.util.ObjectNameFactory;
 import org.jboss.security.RunAsIdentity;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.w3c.dom.Element;
 
 /** A representation of the web.xml and jboss-web.xml deployment
@@ -67,8 +68,7 @@
  * @author Scott.Stark at jboss.org
  * @version $Revision$
  */
-public class WebMetaData extends MetaData
-   implements Serializable
+public class WebMetaData extends MetaData implements Serializable
 {
    private static final long serialVersionUID = 1;
    private static Logger log = Logger.getLogger(WebMetaData.class);
@@ -83,32 +83,26 @@
    private List<ParamValue> contextParams = new ArrayList<ParamValue>();
    /** web-app/init-param */
    private List<ParamValue> initParams = new ArrayList<ParamValue>();
-   
+
    private HashMap<String, Servlet> servlets = new HashMap<String, Servlet>();
    /** The web.xml servlet-mapping <String, String> */
    private List<ServletMapping> servletMappings = new ArrayList<ServletMapping>();
    /** The web.xml resource-refs */
-   private HashMap<String, ResourceRefMetaData> resourceReferences =
-      new HashMap<String, ResourceRefMetaData>();
+   private HashMap<String, ResourceRefMetaData> resourceReferences = new HashMap<String, ResourceRefMetaData>();
    /** The web.xml resource-env-refs */
-   private HashMap<String, ResourceEnvRefMetaData> resourceEnvReferences =
-      new HashMap<String, ResourceEnvRefMetaData>();
+   private HashMap<String, ResourceEnvRefMetaData> resourceEnvReferences = new HashMap<String, ResourceEnvRefMetaData>();
    /** The web.xml message-destination-refs */
-   private HashMap<String, MessageDestinationRefMetaData> messageDestinationReferences
-      = new HashMap<String, MessageDestinationRefMetaData>();
+   private HashMap<String, MessageDestinationRefMetaData> messageDestinationReferences = new HashMap<String, MessageDestinationRefMetaData>();
    /** The web.xml message-destination */
-   private HashMap<String, MessageDestinationMetaData> messageDestinations =
-         new HashMap<String, MessageDestinationMetaData>();
+   private HashMap<String, MessageDestinationMetaData> messageDestinations = new HashMap<String, MessageDestinationMetaData>();
    /** web-app/filter */
    protected HashMap<String, Filter> filters = new HashMap<String, Filter>();
    /** web-app/filter-mapping */
-   protected List<FilterMapping> filterMappings =
-      new ArrayList<FilterMapping>();
+   protected List<FilterMapping> filterMappings = new ArrayList<FilterMapping>();
    protected HashMap listeners = new HashMap();
    protected List<SessionConfig> sessionConfigs = new ArrayList<SessionConfig>();
    /** web.xml security-constraint */
-   protected List<WebSecurityMetaData> securityConstraints =
-      new ArrayList<WebSecurityMetaData>();
+   protected List<WebSecurityMetaData> securityConstraints = new ArrayList<WebSecurityMetaData>();
    protected LoginConfig loginConfig;
    protected List<ErrorPage> errorPages = new ArrayList<ErrorPage>();
    protected List<String> dependencies = new ArrayList<String>();
@@ -181,10 +175,10 @@
     */
    private HashMap arbitraryMetadata = new HashMap();
 
-   public static final int SESSION_INVALIDATE_ACCESS =0;
-   public static final int SESSION_INVALIDATE_SET_AND_GET =1;
-   public static final int SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET =2;
-   public static final int SESSION_INVALIDATE_SET =3;
+   public static final int SESSION_INVALIDATE_ACCESS = 0;
+   public static final int SESSION_INVALIDATE_SET_AND_GET = 1;
+   public static final int SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET = 2;
+   public static final int SESSION_INVALIDATE_SET = 3;
 
    private int invalidateSessionPolicy = SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET;
 
@@ -210,19 +204,18 @@
     * for pojo replication or not.
     */
    private boolean replicationFieldBatchMode = true;
-   
+
    /**
     * The maximum number of active sessions allowed, or -1 for no limit
     */
    private int maxActiveSessions = -1;
-   
 
    /** Should the context use session cookies or use default */
    private int sessionCookies = SESSION_COOKIES_DEFAULT;
 
-   public static final int SESSION_COOKIES_DEFAULT=0;
-   public static final int SESSION_COOKIES_ENABLED=1;
-   public static final int SESSION_COOKIES_DISABLED=2;
+   public static final int SESSION_COOKIES_DEFAULT = 0;
+   public static final int SESSION_COOKIES_ENABLED = 1;
+   public static final int SESSION_COOKIES_DISABLED = 2;
 
    /** The ClassLoader to load additional resources */
    private URLClassLoader resourceCl;
@@ -251,6 +244,7 @@
    {
       return altDDPath;
    }
+
    public void setAltDDPath(String altDDPath)
    {
       this.altDDPath = altDDPath;
@@ -260,14 +254,17 @@
    {
       return contextParams;
    }
+
    public void addContextParam(ParamValue pv)
    {
       contextParams.add(pv);
    }
+
    public List<ParamValue> getInitParams()
    {
       return initParams;
    }
+
    public void addInitParam(ParamValue pv)
    {
       initParams.add(pv);
@@ -293,7 +290,7 @@
    {
       filters.put(filter.getName(), filter);
    }
-   
+
    public Collection<FilterMapping> getFilterMappings()
    {
       return filterMappings;
@@ -303,7 +300,7 @@
    {
       filterMappings.add(mapping);
    }
-   
+
    public Collection getListeners()
    {
       return listeners.values();
@@ -313,7 +310,7 @@
    {
       listeners.put(listener.getListenerClass(), listener);
    }
-   
+
    public Collection<Servlet> getServlets()
    {
       return servlets.values();
@@ -324,7 +321,7 @@
       String servletName = servlet.getName();
       servlets.put(servletName, servlet);
    }
-   
+
    public void updateServlet(Servlet updatedServlet)
    {
       Servlet servlet = (Servlet)servlets.get(updatedServlet.getName());
@@ -337,7 +334,7 @@
          servlets.put(updatedServlet.getName(), updatedServlet);
       }
    }
-   
+
    public Collection getServletMappings()
    {
       return servletMappings;
@@ -347,7 +344,7 @@
    {
       servletMappings.add(mapping);
    }
-   
+
    public Collection getSessionConfigs()
    {
       return sessionConfigs;
@@ -357,12 +354,12 @@
    {
       sessionConfigs.add(config);
    }
-   
+
    public void addSecurityRole(SecurityRoleMetaData securityRole)
    {
       securityRoles.put(securityRole.getRoleName(), securityRole);
    }
-   
+
    public void updateSecurityRole(SecurityRoleMetaData updatedRole)
    {
       SecurityRoleMetaData role = securityRoles.get(updatedRole.getRoleName());
@@ -375,7 +372,7 @@
          securityRoles.put(updatedRole.getRoleName(), updatedRole);
       }
    }
-   
+
    public Collection getSecurityConstraints()
    {
       return securityConstraints;
@@ -385,7 +382,7 @@
    {
       securityConstraints.add(constraint);
    }
-   
+
    public Collection<MimeMapping> getMimeMappings()
    {
       return mimeMappings;
@@ -440,12 +437,12 @@
    {
       return loginConfig;
    }
-   
+
    public void setLoginConfig(LoginConfig loginConfig)
    {
       this.loginConfig = loginConfig;
    }
-   
+
    public Collection getErrorPages()
    {
       return errorPages;
@@ -455,7 +452,7 @@
    {
       errorPages.add(errorPage);
    }
-   
+
    public Collection getMessageDestinations()
    {
       return messageDestinations.values();
@@ -465,27 +462,31 @@
    {
       this.ejbLocalReferences.put(ref.getName(), ref);
    }
+
    public void addEjbRef(EjbRefMetaData ref)
    {
       this.ejbReferences.put(ref.getName(), ref);
    }
+
    public void addEnvEntry(EnvEntryMetaData ref)
    {
       this.environmentEntries.add(ref);
    }
+
    public void addMessageDestinationRef(MessageDestinationRefMetaData ref)
    {
       this.messageDestinationReferences.put(ref.getRefName(), ref);
    }
+
    public void addMessageDestination(MessageDestinationMetaData destination)
    {
-      log.debug("addMessageDestination, "+destination);
+      log.debug("addMessageDestination, " + destination);
       messageDestinations.put(destination.getName(), destination);
    }
+
    public void updateMessageDestination(MessageDestinationMetaData updatedDestination)
    {
-      MessageDestinationMetaData destination = (MessageDestinationMetaData)
-         messageDestinations.get(updatedDestination.getName());
+      MessageDestinationMetaData destination = (MessageDestinationMetaData)messageDestinations.get(updatedDestination.getName());
       if (destination != null)
       {
          destination.setJNDIName(updatedDestination.getMappedName());
@@ -495,10 +496,12 @@
          messageDestinations.put(updatedDestination.getName(), updatedDestination);
       }
    }
+
    public void addResourceEnvRef(ResourceEnvRefMetaData ref)
    {
       this.resourceEnvReferences.put(ref.getRefName(), ref);
    }
+
    public void updateResourceEnvRef(ResourceEnvRefMetaData updatedRef)
    {
       ResourceEnvRefMetaData ref = (ResourceEnvRefMetaData)resourceEnvReferences.get(updatedRef.getRefName());
@@ -516,6 +519,7 @@
    {
       this.resourceReferences.put(ref.getRefName(), ref);
    }
+
    public void updateResourceRef(ResourceRefMetaData updatedRef)
    {
       ResourceRefMetaData ref = (ResourceRefMetaData)resourceReferences.get(updatedRef.getRefName());
@@ -540,12 +544,12 @@
    {
       return dependencies;
    }
-   
+
    public ReplicationConfig getReplicationConfig()
    {
       return replicationConfig;
    }
-   
+
    public void setReplicationConfig(ReplicationConfig replicationConfig)
    {
       this.replicationConfig = replicationConfig;
@@ -568,6 +572,7 @@
    {
       return environmentEntries.iterator();
    }
+
    /**
     *
     * @param environmentEntries - Collection<EnvEntryMetaData>
@@ -585,6 +590,7 @@
    {
       return ejbReferences.values().iterator();
    }
+
    /**
     *
     * @param ejbReferences - Map<String, EjbRefMetaData>
@@ -602,10 +608,12 @@
    {
       return ejbLocalReferences.values().iterator();
    }
+
    public Map<String, EjbLocalRefMetaData> getEjbLocalReferenceMap()
    {
       return ejbLocalReferences;
    }
+
    /**
     *
     * @param ejbReferences - Map<String, EjbRefMetaData>
@@ -623,6 +631,7 @@
    {
       return resourceReferences.values().iterator();
    }
+
    /**
     *
     * @param resourceReferences - Map<String, ResourceRefMetaData>
@@ -640,6 +649,7 @@
    {
       return resourceEnvReferences.values().iterator();
    }
+
    /**
     *
     * @param resourceReferences - Map<String, ResourceEnvRefMetaData>
@@ -659,6 +669,7 @@
    {
       return messageDestinationReferences.values().iterator();
    }
+
    /**
     *
     * @param messageDestinationReferences - Map<String, MessageDestinationRefMetaData>
@@ -677,8 +688,9 @@
     */
    public MessageDestinationMetaData getMessageDestination(String name)
    {
-      return (MessageDestinationMetaData) messageDestinations.get(name);
+      return (MessageDestinationMetaData)messageDestinations.get(name);
    }
+
    /**
     *
     * @param messageDestinations - Map<String, MessageDestinationMetaData>
@@ -696,13 +708,13 @@
    {
       return serviceRefs;
    }
-   
+
    public ServiceRefMetaData getServiceRef(String name)
    {
       ServiceRefMetaData ref = serviceRefs.get(name);
       return ref;
    }
-   
+
    public void addServiceRef(ServiceRefMetaData serviceRef)
    {
       this.serviceRefs.put(serviceRef.getServiceRefName(), serviceRef);
@@ -715,6 +727,7 @@
    {
       return contextRoot;
    }
+
    public void setContextRoot(String contextRoot)
    {
       this.contextRoot = contextRoot;
@@ -750,6 +763,7 @@
    {
       return (String)wsdlPublishLocationMap.get(name);
    }
+
    /**
     *
     * @param wsdlPublishLocationMap - Map<String, String>
@@ -774,6 +788,7 @@
    {
       return jaccContextID;
    }
+
    public void setJaccContextID(String jaccContextID)
    {
       this.jaccContextID = jaccContextID;
@@ -805,6 +820,7 @@
    {
       return flushOnSessionInvalidation;
    }
+
    /** The flag indicating whether the associated security domain cache
     * should be flushed when the session is invalidated.
     * @param flag - true if the flush should occur, false otherwise.
@@ -838,6 +854,7 @@
    {
       return this.securityRoleReferences;
    }
+
    /**
     *
     * @param servletName
@@ -845,10 +862,10 @@
     */
    public List getSecurityRoleRefs(String servletName)
    {
-      List roles = (List) this.securityRoleReferences.get(servletName);
+      List roles = (List)this.securityRoleReferences.get(servletName);
       return roles;
    }
-   
+
    /**
     * Add a security role-ref meta data to a servlet
     * @param servletName
@@ -856,9 +873,9 @@
     */
    public void addSecurityRoleReference(String servletName, List<SecurityRoleRefMetaData> srr)
    {
-      this.securityRoleReferences.put(servletName, srr);   
+      this.securityRoleReferences.put(servletName, srr);
    }
-   
+
    /**
     *
     * @param securityRoleReferences - <String servlet-name, ArrayList<SecurityRoleRefMetaData>>
@@ -885,6 +902,7 @@
    {
       return new HashMap(securityRoles);
    }
+
    /**
     *
     * @param securityRoles - Map<String, SecurityRoleMetaData>
@@ -906,13 +924,13 @@
       Iterator it = securityRoles.values().iterator();
       while (it.hasNext())
       {
-         SecurityRoleMetaData srMetaData = (SecurityRoleMetaData) it.next();
+         SecurityRoleMetaData srMetaData = (SecurityRoleMetaData)it.next();
          if (srMetaData.getPrincipals().contains(userName))
             roleNames.add(srMetaData.getRoleName());
       }
       return roleNames;
    }
-   
+
    /**
     * Get a map of principals versus set of roles
     * that may be configured by the user at the deployment level
@@ -921,26 +939,26 @@
    public Map getPrincipalVersusRolesMap()
    {
       Map principalRolesMap = null;
-      
+
       Iterator iter = securityRoles.keySet().iterator();
-      while(iter.hasNext())
+      while (iter.hasNext())
       {
-         if(principalRolesMap == null)
-            principalRolesMap = new HashMap(); 
+         if (principalRolesMap == null)
+            principalRolesMap = new HashMap();
          String rolename = (String)iter.next();
-         SecurityRoleMetaData srm = (SecurityRoleMetaData) securityRoles.get(rolename);
+         SecurityRoleMetaData srm = (SecurityRoleMetaData)securityRoles.get(rolename);
          Iterator principalIter = srm.getPrincipals().iterator();
-         while(principalIter.hasNext())
+         while (principalIter.hasNext())
          {
-            String pr = (String)principalIter.next(); 
+            String pr = (String)principalIter.next();
             Set roleset = (Set)principalRolesMap.get(pr);
-            if(roleset == null)
+            if (roleset == null)
                roleset = new HashSet();
-            if(!roleset.contains(rolename))
+            if (!roleset.contains(rolename))
                roleset.add(rolename);
             principalRolesMap.put(pr, roleset);
-         } 
-      } 
+         }
+      }
       return principalRolesMap;
    }
 
@@ -951,14 +969,14 @@
     */
    public RunAsIdentity getRunAsIdentity(String servletName)
    {
-      RunAsIdentity runAs = (RunAsIdentity) runAsIdentity.get(servletName);
-      if( runAs == null )
+      RunAsIdentity runAs = (RunAsIdentity)runAsIdentity.get(servletName);
+      if (runAs == null)
       {
          // Check for a web.xml run-as only specification
-         synchronized( runAsIdentity )
+         synchronized (runAsIdentity)
          {
-            String roleName = (String) runAsNames.get(servletName);
-            if( roleName != null )
+            String roleName = (String)runAsNames.get(servletName);
+            if (roleName != null)
             {
                runAs = new RunAsIdentity(roleName, null);
                runAsIdentity.put(servletName, runAs);
@@ -967,6 +985,7 @@
       }
       return runAs;
    }
+
    /**
     *
     * @return servlet/run-as <String servlet-name, RunAsIdentity>
@@ -975,6 +994,7 @@
    {
       return runAsIdentity;
    }
+
    /** The jboss-web.xml servlet/run-as <String servlet-name, RunAsIdentity>
     */
    public void setRunAsIdentity(Map runAsIdentity)
@@ -1024,6 +1044,7 @@
    {
       return virtualHosts.iterator();
    }
+
    /**
     *
     * @param virtualHosts - Collection<String>
@@ -1035,13 +1056,14 @@
    }
 
    /**
-     The distributable flag.
-     @return true if the web-app is marked distributable
+    The distributable flag.
+    @return true if the web-app is marked distributable
     */
    public boolean getDistributable()
    {
       return distributable;
    }
+
    /**
     * Mark the web-app as distributable
     * @param distributable - true for distributable
@@ -1058,6 +1080,7 @@
    {
       return depends;
    }
+
    /**
     @param depends - Collection<ObjectName> of the web app dependencies
     */
@@ -1075,6 +1098,7 @@
    {
       return java2ClassLoadingCompliance;
    }
+
    public void setJava2ClassLoadingCompliance(boolean flag)
    {
       java2ClassLoadingCompliance = flag;
@@ -1084,6 +1108,7 @@
    {
       return loaderConfig;
    }
+
    public void setLoaderConfig(LoaderRepositoryConfig loaderConfig)
    {
       this.loaderConfig = loaderConfig;
@@ -1093,6 +1118,7 @@
    {
       return encLoader;
    }
+
    public void setENCLoader(ClassLoader encLoader)
    {
       this.encLoader = encLoader;
@@ -1113,6 +1139,7 @@
    {
       return this.sessionCookies;
    }
+
    public void setSessionCookies(int sessionCookies)
    {
       this.sessionCookies = sessionCookies;
@@ -1122,6 +1149,7 @@
    {
       return this.invalidateSessionPolicy;
    }
+
    public void setInvalidateSessionPolicy(int invalidateSessionPolicy)
    {
       this.invalidateSessionPolicy = invalidateSessionPolicy;
@@ -1136,6 +1164,7 @@
    {
       return replicationGranularity;
    }
+
    public void setReplicationGranularity(int replicationGranularity)
    {
       this.replicationGranularity = replicationGranularity;
@@ -1145,12 +1174,12 @@
    {
       return replicationFieldBatchMode;
    }
-   
+
    public int getMaxActiveSessionsAllowed()
    {
       return maxActiveSessions;
    }
-   
+
    public void setMaxActiveSessionsAllowed(int maxActive)
    {
       this.maxActiveSessions = maxActive;
@@ -1172,12 +1201,12 @@
    {
       // Parse the jboss-web/root-context element
       Element contextRootElement = getOptionalChild(jbossWeb, "context-root");
-      if( contextRootElement != null )
+      if (contextRootElement != null)
          contextRoot = getElementContent(contextRootElement);
 
       // Parse the jboss-web/security-domain element
       Element securityDomainElement = getOptionalChild(jbossWeb, "security-domain");
-      if( securityDomainElement != null )
+      if (securityDomainElement != null)
       {
          securityDomain = getElementContent(securityDomainElement);
          // Check the flushOnSessionInvalidation attribute
@@ -1186,8 +1215,7 @@
       }
 
       // Parse the jboss-web/virtual-host elements
-      for( Iterator virtualHostElements = getChildrenByTagName(jbossWeb, "virtual-host");
-         virtualHostElements.hasNext();)
+      for (Iterator virtualHostElements = getChildrenByTagName(jbossWeb, "virtual-host"); virtualHostElements.hasNext();)
       {
          Element virtualHostElement = (Element)virtualHostElements.next();
          String virtualHostName = getElementContent(virtualHostElement);
@@ -1196,30 +1224,28 @@
 
       // Parse the jboss-web/resource-ref elements
       Iterator iterator = getChildrenByTagName(jbossWeb, "resource-ref");
-      while( iterator.hasNext() )
+      while (iterator.hasNext())
       {
-         Element resourceRef = (Element) iterator.next();
+         Element resourceRef = (Element)iterator.next();
          String resRefName = getElementContent(getUniqueChild(resourceRef, "res-ref-name"));
-         ResourceRefMetaData refMetaData = (ResourceRefMetaData) resourceReferences.get(resRefName);
-         if( refMetaData == null )
+         ResourceRefMetaData refMetaData = (ResourceRefMetaData)resourceReferences.get(resRefName);
+         if (refMetaData == null)
          {
-            throw new DeploymentException("resource-ref " + resRefName
-               + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("resource-ref " + resRefName + " found in jboss-web.xml but not in web.xml");
          }
          refMetaData.importJbossXml(resourceRef);
       }
 
       // Parse the jboss-web/resource-env-ref elements
       iterator = getChildrenByTagName(jbossWeb, "resource-env-ref");
-      while( iterator.hasNext() )
+      while (iterator.hasNext())
       {
-         Element resourceRef = (Element) iterator.next();
+         Element resourceRef = (Element)iterator.next();
          String resRefName = getElementContent(getUniqueChild(resourceRef, "resource-env-ref-name"));
-         ResourceEnvRefMetaData refMetaData = (ResourceEnvRefMetaData) resourceEnvReferences.get(resRefName);
-         if( refMetaData == null )
+         ResourceEnvRefMetaData refMetaData = (ResourceEnvRefMetaData)resourceEnvReferences.get(resRefName);
+         if (refMetaData == null)
          {
-            throw new DeploymentException("resource-env-ref " + resRefName
-               + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("resource-env-ref " + resRefName + " found in jboss-web.xml but not in web.xml");
          }
          refMetaData.importJbossXml(resourceRef);
       }
@@ -1228,9 +1254,9 @@
       iterator = getChildrenByTagName(jbossWeb, "message-destination-ref");
       while (iterator.hasNext())
       {
-         Element messageDestinationRef = (Element) iterator.next();
+         Element messageDestinationRef = (Element)iterator.next();
          String messageDestinationRefName = getElementContent(getUniqueChild(messageDestinationRef, "message-destination-ref-name"));
-         MessageDestinationRefMetaData messageDestinationRefMetaData = (MessageDestinationRefMetaData) messageDestinationReferences.get(messageDestinationRefName);
+         MessageDestinationRefMetaData messageDestinationRefMetaData = (MessageDestinationRefMetaData)messageDestinationReferences.get(messageDestinationRefName);
          if (messageDestinationRefMetaData == null)
             throw new DeploymentException("message-destination-ref " + messageDestinationRefName + " found in jboss-web.xml but not in web.xml");
          messageDestinationRefMetaData.importJbossXml(messageDestinationRef);
@@ -1240,19 +1266,18 @@
       iterator = getChildrenByTagName(jbossWeb, "message-destination");
       while (iterator.hasNext())
       {
-         Element messageDestination = (Element) iterator.next();
+         Element messageDestination = (Element)iterator.next();
          try
          {
             String messageDestinationName = getUniqueChildContent(messageDestination, "message-destination-name");
-            MessageDestinationMetaData messageDestinationMetaData = (MessageDestinationMetaData) messageDestinations.get(messageDestinationName);
+            MessageDestinationMetaData messageDestinationMetaData = (MessageDestinationMetaData)messageDestinations.get(messageDestinationName);
             if (messageDestinationMetaData == null)
                throw new DeploymentException("message-destination " + messageDestinationName + " found in jboss-web.xml but not in web.xml");
             messageDestinationMetaData.importJbossXml(messageDestination);
          }
          catch (Throwable t)
          {
-            throw new DeploymentException("Error in web.xml " +
-               "for message destination: " + t.getMessage());
+            throw new DeploymentException("Error in web.xml " + "for message destination: " + t.getMessage());
          }
       }
 
@@ -1260,47 +1285,44 @@
       iterator = getChildrenByTagName(jbossWeb, "security-role");
       while (iterator.hasNext())
       {
-         Element securityRole = (Element) iterator.next();
+         Element securityRole = (Element)iterator.next();
          String roleName = getElementContent(getUniqueChild(securityRole, "role-name"));
          SecurityRoleMetaData securityRoleMetaData = (SecurityRoleMetaData)securityRoles.get(roleName);
          if (securityRoleMetaData == null)
-            throw new DeploymentException("Security role '" + roleName + "' defined in jboss-web.xml" +
-                    " is not defined in web.xml");
+            throw new DeploymentException("Security role '" + roleName + "' defined in jboss-web.xml" + " is not defined in web.xml");
 
          Iterator itPrincipalNames = getChildrenByTagName(securityRole, "principal-name");
          while (itPrincipalNames.hasNext())
          {
-            String principalName = getElementContent((Element) itPrincipalNames.next());
+            String principalName = getElementContent((Element)itPrincipalNames.next());
             securityRoleMetaData.addPrincipalName(principalName);
          }
       }
 
       // Parse the jboss-web/ejb-ref elements
       iterator = getChildrenByTagName(jbossWeb, "ejb-ref");
-      while( iterator.hasNext() )
+      while (iterator.hasNext())
       {
-         Element ejbRef = (Element) iterator.next();
+         Element ejbRef = (Element)iterator.next();
          String ejbRefName = getElementContent(getUniqueChild(ejbRef, "ejb-ref-name"));
-         EjbRefMetaData ejbRefMetaData = (EjbRefMetaData) ejbReferences.get(ejbRefName);
-         if( ejbRefMetaData == null )
+         EjbRefMetaData ejbRefMetaData = (EjbRefMetaData)ejbReferences.get(ejbRefName);
+         if (ejbRefMetaData == null)
          {
-            throw new DeploymentException("ejb-ref " + ejbRefName
-               + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("ejb-ref " + ejbRefName + " found in jboss-web.xml but not in web.xml");
          }
          ejbRefMetaData.importJbossXml(ejbRef);
       }
 
       // Parse the jboss-web/ejb-local-ref elements
       iterator = getChildrenByTagName(jbossWeb, "ejb-local-ref");
-      while( iterator.hasNext() )
+      while (iterator.hasNext())
       {
-         Element ejbLocalRef = (Element) iterator.next();
+         Element ejbLocalRef = (Element)iterator.next();
          String ejbLocalRefName = getElementContent(getUniqueChild(ejbLocalRef, "ejb-ref-name"));
-         EjbLocalRefMetaData ejbLocalRefMetaData = (EjbLocalRefMetaData) ejbLocalReferences.get(ejbLocalRefName);
-         if( ejbLocalRefMetaData == null )
+         EjbLocalRefMetaData ejbLocalRefMetaData = (EjbLocalRefMetaData)ejbLocalReferences.get(ejbLocalRefName);
+         if (ejbLocalRefMetaData == null)
          {
-            throw new DeploymentException("ejb-local-ref " + ejbLocalRefName
-               + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("ejb-local-ref " + ejbLocalRefName + " found in jboss-web.xml but not in web.xml");
          }
          ejbLocalRefMetaData.importJbossXml(ejbLocalRef);
       }
@@ -1309,17 +1331,20 @@
       iterator = MetaData.getChildrenByTagName(jbossWeb, "service-ref");
       while (iterator.hasNext())
       {
-         Element serviceRef = (Element) iterator.next();
-         String serviceRefName = MetaData.getUniqueChildContent(serviceRef, "service-ref-name");
-         ServiceRefMetaData refMetaData = (ServiceRefMetaData)serviceRefs.get(serviceRefName);
-         if (refMetaData == null)
+         Element refElement = (Element)iterator.next();
+         String serviceRefName = MetaData.getUniqueChildContent(refElement, "service-ref-name");
+         ServiceRefMetaData sref = (ServiceRefMetaData)serviceRefs.get(serviceRefName);
+         if (sref == null)
          {
             log.warn("service-ref " + serviceRefName + " found in jboss-web.xml but not in web.xml");
-            refMetaData = new ServiceRefMetaData();
-            refMetaData.setServiceRefName(serviceRefName);
-            serviceRefs.put(serviceRefName, refMetaData);
+            sref = new ServiceRefDelegate().newMetaData();
+            if (sref != null)
+            {
+               sref.setServiceRefName(serviceRefName);
+               serviceRefs.put(serviceRefName, sref);
+            }
          }
-         refMetaData.importJBossXml(serviceRef);
+         sref.importJBossXml(refElement);
       }
 
       // WebserviceDescriptions
@@ -1335,8 +1360,7 @@
       }
 
       // Parse the jboss-web/depends elements
-      for( Iterator dependsElements = getChildrenByTagName(jbossWeb, "depends");
-         dependsElements.hasNext();)
+      for (Iterator dependsElements = getChildrenByTagName(jbossWeb, "depends"); dependsElements.hasNext();)
       {
          Element dependsElement = (Element)dependsElements.next();
          String dependsName = getElementContent(dependsElement);
@@ -1345,25 +1369,25 @@
 
       // Parse the jboss-web/use-session-cookies element
       iterator = getChildrenByTagName(jbossWeb, "use-session-cookies");
-      if ( iterator.hasNext() )
+      if (iterator.hasNext())
       {
-         Element useCookiesElement = (Element) iterator.next();
+         Element useCookiesElement = (Element)iterator.next();
          String useCookiesElementContent = getElementContent(useCookiesElement);
-         Boolean useCookies=Boolean.valueOf(useCookiesElementContent);
+         Boolean useCookies = Boolean.valueOf(useCookiesElementContent);
 
          if (useCookies.booleanValue())
          {
-            sessionCookies=SESSION_COOKIES_ENABLED;
+            sessionCookies = SESSION_COOKIES_ENABLED;
          }
          else
          {
-            sessionCookies=SESSION_COOKIES_DISABLED;
+            sessionCookies = SESSION_COOKIES_DISABLED;
          }
       }
-      
+
       // parse the jboss-web/max-active-sessions
       Element maxActiveSessionsElement = getOptionalChild(jbossWeb, "max-active-sessions");
-      if(maxActiveSessionsElement != null)
+      if (maxActiveSessionsElement != null)
       {
          maxActiveSessions = Integer.valueOf(getElementContent(maxActiveSessionsElement)).intValue();
       }
@@ -1371,7 +1395,7 @@
       log.info("WebMetaData:importJBossWebXml: maxActiveSessions = " + maxActiveSessions);
       // parse the jboss-web/passivation-config element
       Element sessionPassivationRootElement = getOptionalChild(jbossWeb, "passivation-config");
-      if( sessionPassivationRootElement != null)
+      if (sessionPassivationRootElement != null)
       {
          // manage "use-session-passivation" first ...
          Element usePassivationElement = MetaData.getOptionalChild(sessionPassivationRootElement, "use-session-passivation");
@@ -1397,7 +1421,7 @@
             {
                passivationConfig.setPassivationMinIdleTime(String.valueOf(0));
             }
-            
+
             Element maxIdleTimeElement = MetaData.getOptionalChild(sessionPassivationRootElement, "passivation-max-idle-time");
             if (maxIdleTimeElement != null)
             {
@@ -1418,7 +1442,7 @@
       // Parse the jboss-web/session-replication element
 
       Element sessionReplicationRootElement = getOptionalChild(jbossWeb, "replication-config");
-      if( sessionReplicationRootElement != null )
+      if (sessionReplicationRootElement != null)
       {
          // manage "replication-trigger" first ...
          //
@@ -1432,8 +1456,7 @@
                this.invalidateSessionPolicy = SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET;
             else if ("SET".equalsIgnoreCase(repMethod))
                this.invalidateSessionPolicy = SESSION_INVALIDATE_SET;
-            else
-               throw new DeploymentException("replication-trigger value set to a non-valid value: '" + repMethod
+            else throw new DeploymentException("replication-trigger value set to a non-valid value: '" + repMethod
                   + "' (should be ['SET_AND_GET', 'SET_AND_NON_PRIMITIVE_GET', 'SET']) in jboss-web.xml");
          }
 
@@ -1447,9 +1470,7 @@
                this.replicationType = REPLICATION_TYPE_SYNC;
             else if ("ASYNC".equalsIgnoreCase(repType))
                this.replicationType = REPLICATION_TYPE_ASYNC;
-            else
-               throw new DeploymentException("replication-type value set to a non-valid value: '" + repType
-                  + "' (should be ['SYNC', 'ASYNC']) in jboss-web.xml");
+            else throw new DeploymentException("replication-type value set to a non-valid value: '" + repType + "' (should be ['SYNC', 'ASYNC']) in jboss-web.xml");
          }
 
          // ... then manage "replication-type".
@@ -1464,8 +1485,7 @@
                this.replicationGranularity = REPLICATION_GRANULARITY_ATTRIBUTE;
             else if ("FIELD".equalsIgnoreCase(repType))
                this.replicationGranularity = REPLICATION_GRANULARITY_FIELD;
-            else
-               throw new DeploymentException("replication-granularity value set to a non-valid value: '" + repType
+            else throw new DeploymentException("replication-granularity value set to a non-valid value: '" + repType
                   + "' (should be ['SESSION', 'ATTRIBUTE', or 'FIELD'']) in jboss-web.xml");
          }
 
@@ -1479,16 +1499,16 @@
 
       // Check for a war level class loading config
       Element classLoading = MetaData.getOptionalChild(jbossWeb, "class-loading");
-      if( classLoading != null )
+      if (classLoading != null)
       {
          String flagString = classLoading.getAttribute("java2ClassLoadingCompliance");
-         if( flagString.length() == 0 )
+         if (flagString.length() == 0)
             flagString = "true";
          boolean flag = Boolean.valueOf(flagString).booleanValue();
          setJava2ClassLoadingCompliance(flag);
          // Check for a loader-repository for scoping
          Element loader = MetaData.getOptionalChild(classLoading, "loader-repository");
-         if( loader != null )
+         if (loader != null)
          {
             try
             {
@@ -1509,20 +1529,19 @@
          String servletName = getElementContent(getUniqueChild(servlet, "servlet-name"));
          String principalName = getOptionalChildContent(servlet, "run-as-principal");
          // Get the web.xml run-as primary role
-         String webXmlRunAs = (String) runAsNames.get(servletName);
-         if( principalName != null )
+         String webXmlRunAs = (String)runAsNames.get(servletName);
+         if (principalName != null)
          {
-            if( webXmlRunAs == null )
+            if (webXmlRunAs == null)
             {
-               throw new DeploymentException("run-as-principal: " + principalName
-               + " found in jboss-web.xml but there was no run-as in web.xml");
+               throw new DeploymentException("run-as-principal: " + principalName + " found in jboss-web.xml but there was no run-as in web.xml");
             }
             // See if there are any additional roles for this principal
             Set extraRoles = getSecurityRoleNamesByPrincipal(principalName);
             RunAsIdentity runAs = new RunAsIdentity(webXmlRunAs, principalName, extraRoles);
             runAsIdentity.put(servletName, runAs);
          }
-         else if( webXmlRunAs != null )
+         else if (webXmlRunAs != null)
          {
             RunAsIdentity runAs = new RunAsIdentity(webXmlRunAs, null);
             runAsIdentity.put(servletName, runAs);

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/CallPropertyMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/CallPropertyMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/CallPropertyMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,73 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.io.Serializable;
-
-/**
- * @author Thomas.Diesler at jboss.org
- * @since 06-May-2004
- */
-public class CallPropertyMetaData implements Serializable
-{
-   // The required <prop-name> element
-   private String propName;
-   // The required <prop-value> element
-   private String propValue;
-
-   public CallPropertyMetaData()
-   {
-   }
-
-   public CallPropertyMetaData(String propName, String propValue)
-   {
-      this.propName = propName;
-      this.propValue = propValue;
-   }
-
-   public String getPropName()
-   {
-      return propName;
-   }
-
-   public void setPropName(String paramName)
-   {
-      this.propName = paramName;
-   }
-
-   public String getPropValue()
-   {
-      return propValue;
-   }
-
-   public void setPropValue(String paramValue)
-   {
-      this.propValue = paramValue;
-   }
-
-   public String toString()
-   {
-      return "[name=" + propName + ",value=" + propValue + "]";
-   }
-}

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/HandlerChainMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/HandlerChainMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/HandlerChainMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-
-/** The unified metdata data for a handler chain element
- * 
- * @author Thomas.Diesler at jboss.org
- */
-public class HandlerChainMetaData implements Serializable
-{
-   private QName serviceNamePattern;
-   private QName portNamePattern;
-   private String protocolBindings;
-   private List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-   
-   public QName getPortNamePattern()
-   {
-      return portNamePattern;
-   }
-
-   public void setPortNamePattern(QName portNamePattern)
-   {
-      this.portNamePattern = portNamePattern;
-   }
-
-   public QName getServiceNamePattern()
-   {
-      return serviceNamePattern;
-   }
-
-   public void setServiceNamePattern(QName serviceNamePattern)
-   {
-      this.serviceNamePattern = serviceNamePattern;
-   }
-
-   public String getProtocolBindings()
-   {
-      return protocolBindings;
-   }
-   
-   public void setProtocolBindings(String protocolBindings)
-   {
-      this.protocolBindings = protocolBindings;
-   }
-   
-   public List<HandlerMetaData> getHandlers()
-   {
-      return handlers;
-   }
-   
-   public void addHandler(HandlerMetaData handler)
-   {
-      handlers.add(handler);
-   }
-   
-   Element toXMLFragment()
-   {
-      Element root = DocumentHelper.createElement("handler-chain");
-      if (serviceNamePattern != null)
-         root.addElement("service-name-pattern").addText(serviceNamePattern.toString());
-      if (portNamePattern != null)
-         root.addElement("port-name-pattern").addText(portNamePattern.toString());
-      if (protocolBindings != null)
-         root.addElement("protocol-bindings").addText(protocolBindings);
-      for (HandlerMetaData handler : getHandlers())
-         root.add(handler.toXMLFragment());
-      return root;
-   }
-}

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/HandlerChainsMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/HandlerChainsMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/HandlerChainsMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-
-/** The unified metdata data for a handler chains element
- * 
- * @author Thomas.Diesler at jboss.org
- */
-public class HandlerChainsMetaData implements Serializable
-{
-   private List<HandlerChainMetaData> handlerChains = new ArrayList<HandlerChainMetaData>();
-
-   public List<HandlerChainMetaData> getHandlerChains()
-   {
-      return handlerChains;
-   }
-
-   public void addHandlerChain(HandlerChainMetaData handlerChain)
-   {
-      handlerChains.add(handlerChain);
-   }
-
-   Element toXMLFragment()
-   {
-      Element root = DocumentHelper.createElement("handler-chains");
-      for (HandlerChainMetaData handlerChain : getHandlerChains())
-         root.add(handlerChain.toXMLFragment());
-      return root;
-   }
-}

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/HandlerMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/HandlerMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/HandlerMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,184 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-import org.jboss.metadata.MetaData;
-import org.jboss.xb.QNameBuilder;
-
-/** The unified metdata data for a handler element
- * 
- * @author Thomas.Diesler at jboss.org
- * @version $Revision$
- */
-public class HandlerMetaData implements Serializable
-{
-   // The required <handler-name> element
-   private String handlerName;
-   // The required <handler-class> element
-   private String handlerClass;
-   // The optional <init-param> elements
-   private List<InitParamMetaData> initParams = new ArrayList<InitParamMetaData>();
-   // The optional <soap-header> elements
-   private List<QName> soapHeaders = new ArrayList<QName>();
-   // The optional <soap-role> elements
-   private List<String> soapRoles = new ArrayList<String>();
-   // The optional <port-name> elements, these only apply to webserve clients
-   private List<String> portNames = new ArrayList<String>();
-
-   public void setHandlerName(String value)
-   {
-      this.handlerName = value;
-   }
-
-   public String getHandlerName()
-   {
-      return handlerName;
-   }
-
-   public void setHandlerClass(String handlerClass)
-   {
-      this.handlerClass = handlerClass;
-   }
-
-   public String getHandlerClass()
-   {
-      return handlerClass;
-   }
-
-   public void addInitParam(InitParamMetaData param)
-   {
-      initParams.add(param);
-   }
-
-   public List<InitParamMetaData> getInitParams()
-   {
-      return initParams;
-   }
-
-   public void addSoapHeader(QName qName)
-   {
-      soapHeaders.add(qName);
-   }
-
-   public List<QName> getSoapHeaders()
-   {
-      return soapHeaders;
-   }
-
-   public void addSoapRole(String value)
-   {
-      soapRoles.add(value);
-   }
-
-   public List<String> getSoapRoles()
-   {
-      return soapRoles;
-   }
-
-   public List<String> getPortNames()
-   {
-      return portNames;
-   }
-
-   public void addPortName(String value)
-   {
-      portNames.add(value);
-   }
-
-   /** @deprecated */
-   public void importStandardXml(org.w3c.dom.Element element)
-   {
-      handlerName = MetaData.getUniqueChildContent(element, "handler-name");
-
-      handlerClass = MetaData.getUniqueChildContent(element, "handler-class");
-
-      // Parse the init-param elements
-      Iterator iterator = MetaData.getChildrenByTagName(element, "init-param");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element paramElement = (org.w3c.dom.Element)iterator.next();
-         InitParamMetaData param = new InitParamMetaData();
-         param.setParamName(MetaData.getUniqueChildContent(paramElement, "param-name"));
-         param.setParamValue(MetaData.getUniqueChildContent(paramElement, "param-value"));
-         initParams.add(param);
-      }
-
-      // Parse the soap-header elements
-      iterator = MetaData.getChildrenByTagName(element, "soap-header");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element headerElement = (org.w3c.dom.Element)iterator.next();
-         String content = MetaData.getElementContent(headerElement);
-         QName qname = QNameBuilder.buildQName(headerElement, content);
-         soapHeaders.add(qname);
-      }
-
-      // Parse the soap-role elements
-      iterator = MetaData.getChildrenByTagName(element, "soap-role");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element roleElement = (org.w3c.dom.Element)iterator.next();
-         String content = MetaData.getElementContent(roleElement);
-         soapRoles.add(content);
-      }
-
-      // Parse the port-name elements
-      iterator = MetaData.getChildrenByTagName(element, "port-name");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element portElement = (org.w3c.dom.Element)iterator.next();
-         String content = MetaData.getElementContent(portElement);
-         portNames.add(content);
-      }
-   }
-   
-   Element toXMLFragment()
-   {
-      Element root = DocumentHelper.createElement("handler");
-      root.addElement("handler-name").addText(handlerName);
-      root.addElement("handler-class").addText(handlerClass);
-      for (InitParamMetaData param : getInitParams())
-      {
-         Element paramEl = root.addElement("init-param");
-         paramEl.addElement("param-name").addText(param.getParamName());
-         paramEl.addElement("param-value").addText(param.getParamValue());
-      }
-      for (QName soapHeader : getSoapHeaders())
-         root.addElement("soap-header").addText(soapHeader.toString());
-      for (String soapRole : getSoapRoles())
-         root.addElement("soap-role").addText(soapRole);
-      for (String portName : getPortNames())
-         root.addElement("port-name").addText(portName);
-      return root;
-   }
-}

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/InitParamMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/InitParamMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/InitParamMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,63 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.io.Serializable;
-
-/**
- * @author Thomas.Diesler at jboss.org
- * @since 06-May-2004
- */
-public class InitParamMetaData implements Serializable
-{
-   // The required <param-name> element
-   private String paramName;
-   // The required <param-value> element
-   private String paramValue;
-
-   public String getParamName()
-   {
-      return paramName;
-   }
-
-   public void setParamName(String paramName)
-   {
-      this.paramName = paramName;
-   }
-
-   public String getParamValue()
-   {
-      return paramValue;
-   }
-
-   public void setParamValue(String paramValue)
-   {
-      this.paramValue = paramValue;
-   }
-
-   public String toString()
-   {
-      return "[name=" + paramName + ",value=" + paramValue + "]";
-   }
-}

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/PortComponentRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/PortComponentRefMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/PortComponentRefMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,240 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-import org.jboss.metadata.MetaData;
-
-/** The metdata data from service-ref/port-component-ref element in web.xml, ejb-jar.xml, and application-client.xml.
- *
- * @author Thomas.Diesler at jboss.org
- */
-public class PortComponentRefMetaData implements Serializable
-{
-   // The parent service-ref
-   private ServiceRefMetaData serviceRefMetaData;
-
-   // Standard properties
-   
-   // The required <service-endpoint-interface> element
-   private String serviceEndpointInterface;
-   // The optional <enable-mtom> element
-   private Boolean enableMTOM;
-   // The optional <port-component-link> element
-   private String portComponentLink;
-   
-   // JBoss properties 
-   
-   // The optional <port-qname> element
-   private QName portQName;
-   // The optional JBossWS config-name
-   private String configName;
-   // The optional JBossWS config-file
-   private String configFile;
-   // Arbitrary proxy properties given by <call-property> 
-   private List<CallPropertyMetaData> callProperties = new ArrayList<CallPropertyMetaData>();
-   // Arbitrary proxy properties given by <stub-property> 
-   private List<StubPropertyMetaData> stubProperties = new ArrayList<StubPropertyMetaData>();
-
-   public PortComponentRefMetaData(ServiceRefMetaData serviceRefMetaData)
-   {
-      this.serviceRefMetaData = serviceRefMetaData;
-   }
-
-   public ServiceRefMetaData getServiceRefMetaData()
-   {
-      return serviceRefMetaData;
-   }
-
-   public void merge(PortComponentRefMetaData pcref)
-   {
-      portQName = pcref.portQName;
-      configName = pcref.configName;
-      configFile = pcref.configFile;
-      callProperties = pcref.callProperties;
-      stubProperties = pcref.stubProperties;
-   }
-   
-   public Boolean getEnableMTOM()
-   {
-      return enableMTOM;
-   }
-
-   public void setEnableMTOM(Boolean enableMTOM)
-   {
-      this.enableMTOM = enableMTOM;
-   }
-
-   /** 
-    * The port-component-link element links a port-component-ref
-    * to a specific port-component required to be made available
-    * by a service reference.
-    * 
-    * The value of a port-component-link must be the
-    * port-component-name of a port-component in the same module
-    * or another module in the same application unit. The syntax
-    * for specification follows the syntax defined for ejb-link
-    * in the EJB 2.0 specification.
-    */
-   public String getPortComponentLink()
-   {
-      return portComponentLink;
-   }
-
-   public void setPortComponentLink(String portComponentLink)
-   {
-      this.portComponentLink = portComponentLink;
-   }
-
-   public String getServiceEndpointInterface()
-   {
-      return serviceEndpointInterface;
-   }
-
-   public void setServiceEndpointInterface(String serviceEndpointInterface)
-   {
-      this.serviceEndpointInterface = serviceEndpointInterface;
-   }
-
-   public QName getPortQName()
-   {
-      return portQName;
-   }
-
-   public void setPortQName(QName portQName)
-   {
-      this.portQName = portQName;
-   }
-
-   public List<CallPropertyMetaData> getCallProperties()
-   {
-      return callProperties;
-   }
-
-   public void setCallProperties(List<CallPropertyMetaData> callProps)
-   {
-      callProperties = callProps;
-   }
-
-   public void addCallProperty(CallPropertyMetaData callProp)
-   {
-      callProperties.add(callProp);
-   }
-   
-   public List<StubPropertyMetaData> getStubProperties()
-   {
-      return stubProperties;
-   }
-
-   public void setStubProperties(List<StubPropertyMetaData> stubProps)
-   {
-      stubProperties = stubProps;
-   }
-
-   public void addStubProperty(StubPropertyMetaData stubProp)
-   {
-      stubProperties.add(stubProp);
-   }
-   
-   public String getConfigFile()
-   {
-      return configFile;
-   }
-
-   public void setConfigFile(String configFile)
-   {
-      this.configFile = configFile;
-   }
-
-   public String getConfigName()
-   {
-      return configName;
-   }
-
-   public void setConfigName(String configName)
-   {
-      this.configName = configName;
-   }
-
-   /** @deprecated */
-   public void importStandardXml(org.w3c.dom.Element element)
-   {
-      serviceEndpointInterface = MetaData.getUniqueChildContent(element, "service-endpoint-interface");
-      portComponentLink = MetaData.getOptionalChildContent(element, "port-component-link");
-   }
-
-   /** @deprecated */
-   public void importJBossXml(org.w3c.dom.Element element)
-   {
-      // Look for call-property elements
-      Iterator iterator = MetaData.getChildrenByTagName(element, "call-property");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element propElement = (org.w3c.dom.Element)iterator.next();
-         String name = MetaData.getUniqueChildContent(propElement, "prop-name");
-         String value = MetaData.getUniqueChildContent(propElement, "prop-value");
-         callProperties.add(new CallPropertyMetaData(name, value));
-      }
-   }
-   
-   Element toXMLFragment()
-   {
-      Element root = DocumentHelper.createElement("port-component-ref");
-      if (serviceEndpointInterface != null)
-         root.addElement("service-endpoint-interface").addText(serviceEndpointInterface);
-      if (enableMTOM != null)
-         root.addElement("enable-mtom").addText(enableMTOM.toString());
-      if (portComponentLink != null)
-         root.addElement("port-component-link").addText(portComponentLink);
-      if (portQName != null)
-         root.addElement("port-qname").addText(portQName.toString());
-      if (configName != null)
-         root.addElement("config-name").addText(configName);
-      if (configFile != null)
-         root.addElement("config-file").addText(configFile);
-      
-      for (CallPropertyMetaData prop : getCallProperties())
-      {
-         Element propEl = root.addElement("call-property");
-         propEl.addElement("prop-name").addText(prop.getPropName());
-         propEl.addElement("prop-value").addText(prop.getPropValue());
-      }
-      for (StubPropertyMetaData prop : getStubProperties())
-      {
-         Element propEl = root.addElement("stub-property");
-         propEl.addElement("prop-name").addText(prop.getPropName());
-         propEl.addElement("prop-value").addText(prop.getPropValue());
-      }
-      
-      return root;
-   }
-}

Copied: trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java (from rev 61232, branches/tdiesler/trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java)
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java	                        (rev 0)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.metadata.serviceref;
+
+// $Id$
+
+import java.util.Collection;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.xml.soap.FactoryLoader;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.KernelLocator;
+import org.jboss.ws.integration.ServiceRefElement;
+import org.jboss.ws.integration.ServiceRefHandler;
+import org.jboss.ws.integration.ServiceRefMetaData;
+import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * Factory for ServiceRefHandler
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 05-May-2004
+ */
+public class ServiceRefDelegate implements ServiceRefHandler
+{
+   // provide logging
+   private static final Logger log = Logger.getLogger(ServiceRefDelegate.class);
+
+   private static ServiceRefHandler delegate;
+
+   public ServiceRefDelegate()
+   {
+      if (delegate == null)
+      {
+         Kernel kernel = KernelLocator.getKernel();
+         if (kernel != null)
+         {
+            KernelRegistry registry = kernel.getRegistry();
+            KernelRegistryEntry entry = registry.getEntry(ServiceRefHandler.BEAN_NAME);
+            delegate = (ServiceRefHandler)entry.getTarget();
+         }
+         else
+         {
+            String propName = ServiceRefHandler.class.getName();
+            String defaultImpl = "org.jboss.ws.core.client.ServiceRefHandlerImpl";
+            delegate = (ServiceRefHandler)FactoryLoader.loadFactory(propName, defaultImpl);
+         }
+      }
+
+      if (delegate == null)
+         log.warn("Not registered: " + ServiceRefHandler.BEAN_NAME);
+   }
+
+   public ServiceRefMetaData newMetaData()
+   {
+      ServiceRefMetaData sref = null;
+      if (delegate != null)
+         sref = delegate.newMetaData();
+      return sref;
+   }
+
+   public Object newChild(ServiceRefElement ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+   {
+      Object child = null;
+      if (delegate != null)
+         child = delegate.newChild(ref, navigator, namespaceURI, localName, attrs);
+      return child;
+   }
+
+   public void setValue(ServiceRefElement ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+   {
+      if (delegate != null)
+         delegate.setValue(ref, navigator, namespaceURI, localName, value);
+   }
+
+   public void setupServiceRefs(Context envCtx, UnifiedVirtualFile vfsRoot, Collection<ServiceRefMetaData> serviceRefs) throws NamingException
+   {
+      if (delegate != null)
+         delegate.setupServiceRefs(envCtx, vfsRoot, serviceRefs);
+   }
+
+   public void setupServiceRef(Context encCtx, String encName, UnifiedVirtualFile vfsRoot, ServiceRefMetaData sref) throws NamingException
+   {
+      if (delegate != null)
+         delegate.setupServiceRef(encCtx, encName, vfsRoot, sref);
+   }
+}

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefHandlerDelegate.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefHandlerDelegate.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefHandlerDelegate.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.lang.reflect.AnnotatedElement;
-import java.util.Collection;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.mx.util.ObjectNameFactory;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * Factory for ServiceRefHandler
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 05-May-2004
- */
-public class ServiceRefHandlerDelegate
-{
-   // provide logging
-   private static final Logger log = Logger.getLogger(ServiceRefHandlerDelegate.class);
-
-   private static ServiceRefHandler refHandler;
-
-   // This interface is exposed from JBossWS
-   public interface ServiceRefHandler
-   {
-      void setupServiceRef(Context encCtx, String encName, AnnotatedElement anElement, VirtualFile vfsRoot, String xmlFragment) throws NamingException;
-   }
-
-   /**
-    * Bind multiple service refs to the client environment
-    */
-   public static void bindServiceRefs(Context envCtx, VirtualFile vfsRoot, Collection<ServiceRefMetaData> serviceRefs) throws NamingException
-   {
-      for (ServiceRefMetaData sref : serviceRefs)
-      {
-         String encName = sref.getServiceRefName();
-         bindServiceRef(envCtx, encName, vfsRoot, sref);
-      }
-   }
-
-   /**
-    * Bind a single service ref to the client environment
-    */
-   public static void bindServiceRef(Context envCtx, String encName, VirtualFile vfsRoot, ServiceRefMetaData sref) throws NamingException
-   {
-      ServiceRefHandler handler = getServiceRefHandler();
-      if (handler != null)
-      {
-         AnnotatedElement anElement = sref.getAnnotatedElement();
-         handler.setupServiceRef(envCtx, encName, anElement, vfsRoot, sref.toXMLFragmet());
-         log.debug(encName + ": " + sref.getServiceRefName());
-         sref.setProcessed(true);
-      }
-   }
-
-   private static ServiceRefHandler getServiceRefHandler()
-   {
-      if (refHandler == null)
-      {
-         MBeanServer server = MBeanServerLocator.locateJBoss();
-         ObjectName objectName = ObjectNameFactory.create("jboss.ws:service=ServiceRefHandler");
-
-         if (server.isRegistered(objectName))
-         {
-            refHandler = (ServiceRefHandler)MBeanProxyExt.create(ServiceRefHandler.class, objectName, server);
-         }
-         else
-         {
-            log.warn("Not registered: " + objectName);
-         }
-      }
-      return refHandler;
-   }
-}

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,463 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.io.Serializable;
-import java.lang.reflect.AnnotatedElement;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.MetaData;
-import org.jboss.metadata.Ref;
-import org.jboss.xb.QNameBuilder;
-
-/**
- * The metdata data from service-ref element in web.xml, ejb-jar.xml, and
- * application-client.xml.
- * 
- * @author Thomas.Diesler at jboss.org
- * @version $Revision$
- */
-public class ServiceRefMetaData extends Ref implements Serializable
-{
-   // provide logging
-   private static Logger log = Logger.getLogger(ServiceRefMetaData.class);
-   
-   private AnnotatedElement anElement;
-   private boolean processed;
-   
-   // Standard properties 
-
-   // The required <service-ref-name> element
-   private String serviceRefName;
-   // The JAXRPC required <service-interface> element
-   private String serviceInterface;
-   // service-res-type
-   private String serviceRefType;
-   // The optional <wsdl-file> element
-   private String wsdlFile;
-   // The optional <jaxrpc-mapping-file> element
-   private String mappingFile;
-   // The optional <service-qname> element
-   private QName serviceQName;
-   // The LinkedHashMap<String, PortComponentRefMetaData> for <port-component-ref> elements
-   private Map<String, PortComponentRefMetaData> portComponentRefs = new LinkedHashMap<String, PortComponentRefMetaData>();
-   // The optional <handler> elements. JAX-RPC handlers declared in the standard J2EE1.4 descriptor
-   private List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-   // The optional <handler-chains> elements. JAX-WS handlers declared in the standard JavaEE5 descriptor
-   private HandlerChainsMetaData handlerChains;
-
-   // JBoss properties 
-
-   // The optional <service-impl-class> element
-   private String serviceImplClass;
-   // The optional JBossWS config-name
-   private String configName;
-   // The optional JBossWS config-file
-   private String configFile;
-   // The optional URL of the actual WSDL to use, <wsdl-override> 
-   private String wsdlOverride;
-   // The optional <handler-chain> element. JAX-WS handler chain declared in the JBoss JavaEE5 descriptor
-   private String handlerChain;
-   // Arbitrary proxy properties given by <call-property> 
-   private List<CallPropertyMetaData> callProperties = new ArrayList<CallPropertyMetaData>();
-
-   public void mergeJBossProperties(ServiceRefMetaData sref)
-   {
-      serviceImplClass = sref.serviceImplClass;
-      configName = sref.configName;
-      configFile = sref.configFile;
-      wsdlOverride = sref.wsdlOverride;
-      handlerChain = sref.handlerChain;
-      callProperties = sref.callProperties;
-
-      if (serviceQName == null && sref.serviceQName != null)
-         serviceQName = sref.serviceQName;
-
-      for (PortComponentRefMetaData pcref : sref.getPortComponentRefs())
-      {
-         String seiName = pcref.getServiceEndpointInterface();
-         if (seiName == null)
-         {
-            log.warn("Null service endpoint interface in: " + toXMLFragmet());
-            continue;
-         }
-
-         PortComponentRefMetaData pcTargetRef = portComponentRefs.get(seiName);
-         if (pcTargetRef == null)
-         {
-            log.warn("Cannot find port component ref with SEI name: " + seiName);
-            addPortComponentRef(pcref);
-            pcTargetRef = pcref;
-         }
-
-         pcTargetRef.merge(pcref);
-      }
-   }
-
-   public String getServiceRefName()
-   {
-      return serviceRefName;
-   }
-
-   public void setServiceRefName(String serviceRefName)
-   {
-      this.serviceRefName = serviceRefName;
-   }
-
-   public String getMappingFile()
-   {
-      return mappingFile;
-   }
-
-   public void setMappingFile(String mappingFile)
-   {
-      this.mappingFile = mappingFile;
-   }
-
-   public PortComponentRefMetaData[] getPortComponentRefs()
-   {
-      PortComponentRefMetaData[] array = new PortComponentRefMetaData[portComponentRefs.size()];
-      portComponentRefs.values().toArray(array);
-      return array;
-   }
-
-   public PortComponentRefMetaData getPortComponentRef(String seiName)
-   {
-      PortComponentRefMetaData ref = portComponentRefs.get(seiName);
-      return ref;
-   }
-
-   public void addPortComponentRef(PortComponentRefMetaData pcRef)
-   {
-      portComponentRefs.put(pcRef.getServiceEndpointInterface(), pcRef);
-   }
-
-   public List<HandlerMetaData> getHandlers()
-   {
-      return handlers;
-   }
-
-   public void addHandler(HandlerMetaData handler)
-   {
-      handlers.add(handler);
-   }
-
-   public String getServiceInterface()
-   {
-      return serviceInterface;
-   }
-
-   public void setServiceInterface(String serviceInterface)
-   {
-      this.serviceInterface = serviceInterface;
-   }
-
-   public String getServiceImplClass()
-   {
-      return serviceImplClass;
-   }
-
-   public void setServiceImplClass(String serviceImplClass)
-   {
-      this.serviceImplClass = serviceImplClass;
-   }
-
-   public QName getServiceQName()
-   {
-      return serviceQName;
-   }
-
-   public void setServiceQName(QName serviceQName)
-   {
-      this.serviceQName = serviceQName;
-   }
-
-   public String getServiceRefType()
-   {
-      return serviceRefType;
-   }
-
-   public void setServiceRefType(String serviceResType)
-   {
-      this.serviceRefType = serviceResType;
-   }
-
-   public String getWsdlFile()
-   {
-      return wsdlFile;
-   }
-
-   public void setWsdlFile(String wsdlFile)
-   {
-      this.wsdlFile = wsdlFile;
-   }
-
-   public String getConfigFile()
-   {
-      return configFile;
-   }
-
-   public void setConfigFile(String configFile)
-   {
-      this.configFile = configFile;
-   }
-
-   public String getConfigName()
-   {
-      return configName;
-   }
-
-   public void setConfigName(String configName)
-   {
-      this.configName = configName;
-   }
-
-   public String getWsdlOverride()
-   {
-      return wsdlOverride;
-   }
-
-   public void setWsdlOverride(String wsdlOverride)
-   {
-      this.wsdlOverride = wsdlOverride;
-   }
-
-   public List<CallPropertyMetaData> getCallProperties()
-   {
-      return callProperties;
-   }
-
-   public void setCallProperties(List<CallPropertyMetaData> callProps)
-   {
-      callProperties = callProps;
-   }
-
-   public void addCallProperty(CallPropertyMetaData callProp)
-   {
-      callProperties.add(callProp);
-   }
-
-   public HandlerChainsMetaData getHandlerChains()
-   {
-      return handlerChains;
-   }
-
-   public void setHandlerChains(HandlerChainsMetaData handlerChains)
-   {
-      this.handlerChains = handlerChains;
-   }
-
-   public String getHandlerChain()
-   {
-      return handlerChain;
-   }
-
-   public void setHandlerChain(String handlerChain)
-   {
-      this.handlerChain = handlerChain;
-   }
-
-   /** @deprecated */
-   public void importStandardXml(org.w3c.dom.Element element)
-   {
-      serviceRefName = MetaData.getUniqueChildContent(element, "service-ref-name");
-
-      serviceInterface = MetaData.getUniqueChildContent(element, "service-interface");
-
-      wsdlFile = MetaData.getOptionalChildContent(element, "wsdl-file");
-
-      mappingFile = MetaData.getOptionalChildContent(element, "jaxrpc-mapping-file");
-
-      org.w3c.dom.Element qnameElement = MetaData.getOptionalChild(element, "service-qname");
-      if (qnameElement != null)
-         serviceQName = QNameBuilder.buildQName(qnameElement, MetaData.getElementContent(qnameElement));
-
-      // Parse the port-component-ref elements
-      Iterator iterator = MetaData.getChildrenByTagName(element, "port-component-ref");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element pcrefElement = (org.w3c.dom.Element)iterator.next();
-         PortComponentRefMetaData pcrefMetaData = new PortComponentRefMetaData(this);
-         pcrefMetaData.importStandardXml(pcrefElement);
-         portComponentRefs.put(pcrefMetaData.getServiceEndpointInterface(), pcrefMetaData);
-      }
-
-      // Parse the handler elements
-      iterator = MetaData.getChildrenByTagName(element, "handler");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element handlerElement = (org.w3c.dom.Element)iterator.next();
-         HandlerMetaData handlerMetaData = new HandlerMetaData();
-         handlerMetaData.importStandardXml(handlerElement);
-         handlers.add(handlerMetaData);
-      }
-   }
-
-   /** @deprecated */
-   public void importJBossXml(org.w3c.dom.Element element)
-   {
-      configName = MetaData.getOptionalChildContent(element, "config-name");
-
-      configFile = MetaData.getOptionalChildContent(element, "config-file");
-      wsdlOverride = MetaData.getOptionalChildContent(element, "wsdl-override");
-
-      // Parse the port-component-ref elements
-      Iterator iterator = MetaData.getChildrenByTagName(element, "port-component-ref");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element pcrefElement = (org.w3c.dom.Element)iterator.next();
-         String name = MetaData.getOptionalChildContent(pcrefElement, "service-endpoint-interface");
-         if (name != null)
-         {
-            PortComponentRefMetaData pcrefMetaData = (PortComponentRefMetaData)portComponentRefs.get(name);
-            if (pcrefMetaData == null)
-            {
-               // Its ok to only have the <port-component-ref> in jboss.xml and not in ejb-jar.xml
-               pcrefMetaData = new PortComponentRefMetaData(this);
-               pcrefMetaData.importStandardXml(pcrefElement);
-               portComponentRefs.put(pcrefMetaData.getServiceEndpointInterface(), pcrefMetaData);
-            }
-
-            pcrefMetaData.importJBossXml(pcrefElement);
-         }
-      }
-
-      // Parse the call-property elements
-      iterator = MetaData.getChildrenByTagName(element, "call-property");
-      while (iterator.hasNext())
-      {
-         org.w3c.dom.Element propElement = (org.w3c.dom.Element)iterator.next();
-         String name = MetaData.getUniqueChildContent(propElement, "prop-name");
-         String value = MetaData.getUniqueChildContent(propElement, "prop-value");
-         callProperties.add(new CallPropertyMetaData(name, value));
-      }
-   }
-
-   public static boolean isJ2EE14Descriptor(org.w3c.dom.Element element)
-   {
-      // Verify J2EE-1.4
-      String nsURI = element.getOwnerDocument().getDocumentElement().getNamespaceURI();
-      boolean isValid = "http://java.sun.com/xml/ns/j2ee".equals(nsURI);
-
-      // Verify JBoss-4.0
-      org.w3c.dom.DocumentType doctype = element.getOwnerDocument().getDoctype();
-      if (isValid == false && doctype != null)
-      {
-         String publicId = doctype.getPublicId();
-         isValid |= "-//JBoss//DTD JBOSS 4.0//EN".equals(publicId);
-         isValid |= "-//JBoss//DTD JBOSS 4.2//EN".equals(publicId);
-         isValid |= "-//JBoss//DTD Web Application 2.4//EN".equals(publicId);
-         isValid |= "-//JBoss//DTD Application Client 4.0//EN".equals(publicId);
-         isValid |= "-//JBoss//DTD Application Client 4.2//EN".equals(publicId);
-      }
-
-      if (isValid == false)
-      {
-         String dtstr = (doctype != null ? "[public=" + doctype.getPublicId() + ",system=" + doctype.getSystemId() + "]" : null);
-         log.debug("Skip <service-ref> for: nsURI=" + nsURI + ",doctype=" + dtstr);
-      }
-      return isValid;
-   }
-
-   public AnnotatedElement getAnnotatedElement()
-   {
-      return anElement;
-   }
-
-   public void setAnnotatedElement(AnnotatedElement anElement)
-   {
-      this.anElement = anElement;
-   }
-
-   public boolean isProcessed()
-   {
-      return processed;
-   }
-
-   public void setProcessed(boolean bindingProcessed)
-   {
-      this.processed = bindingProcessed;
-   }
-
-   public String toXMLFragmet()
-   {
-      Document document = DocumentHelper.createDocument();
-      Element root = document.addElement("service-ref");
-      root.addElement("service-ref-name").addText(serviceRefName);
-      if (serviceInterface != null)
-         root.addElement("service-interface").addText(serviceInterface);
-      if (serviceRefType != null)
-         root.addElement("service-ref-type").addText(serviceRefType);
-      if (wsdlFile != null)
-         root.addElement("wsdl-file").addText(wsdlFile);
-      if (mappingFile != null)
-         root.addElement("jaxrpc-mapping-file").addText(mappingFile);
-      if (serviceQName != null)
-         root.addElement("service-qname").addText(serviceQName.toString());
-      for (PortComponentRefMetaData pcref : getPortComponentRefs())
-         root.add(pcref.toXMLFragment());
-      for (HandlerMetaData handler : getHandlers())
-         root.add(handler.toXMLFragment());
-      if (handlerChains != null)
-         root.add(handlerChains.toXMLFragment());
-
-      if (serviceImplClass != null)
-         root.addElement("service-impl-class").addText(serviceImplClass);
-      if (configName != null)
-         root.addElement("config-name").addText(configName);
-      if (configFile != null)
-         root.addElement("config-file").addText(configFile);
-      if (handlerChain != null)
-         root.addElement("handler-chain").addText(handlerChain);
-      if (wsdlOverride != null)
-         root.addElement("wsdl-override").addText(wsdlOverride);
-
-      for (CallPropertyMetaData prop : getCallProperties())
-      {
-         Element propEl = root.addElement("call-property");
-         propEl.addElement("prop-name").addText(prop.getPropName());
-         propEl.addElement("prop-value").addText(prop.getPropValue());
-      }
-
-      return root.asXML();
-   }
-   
-   public String toString()
-   {
-      StringBuilder sb = new StringBuilder("[");
-      sb.append("name=" + serviceRefName + ",si=" + serviceInterface);
-      sb.append("]");
-      return sb.toString();
-   }
-}

Modified: trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/ServiceRefObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -23,10 +23,12 @@
 
 // $Id$
 
-import javax.xml.namespace.QName;
-
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.ServiceRefElement;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.UnmarshallingContext;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
 import org.xml.sax.Attributes;
 
 /**
@@ -36,242 +38,43 @@
  */
 public abstract class ServiceRefObjectFactory implements ObjectModelFactory
 {
-   public void setValue(ServiceRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      /* Standard properties */
-      if (localName.equals("service-ref-name"))
-      {
-         ref.setServiceRefName(value);
-      }
-      else if (localName.equals("service-interface"))
-      {
-         ref.setServiceInterface(value);
-      }
-      else if (localName.equals("service-ref-type"))
-      {
-         ref.setServiceRefType(value);
-      }
-      else if (localName.equals("wsdl-file"))
-      {
-         ref.setWsdlFile(value);
-      }
-      else if (localName.equals("jaxrpc-mapping-file"))
-      {
-         ref.setMappingFile(value);
-      }
-      else if (localName.equals("service-qname"))
-      {
-         ref.setServiceQName(QName.valueOf(value));
-      }
+   // provide logging
+   private static Logger log = Logger.getLogger(ServiceRefObjectFactory.class);
+   
 
-      /* JBoss properties */
-      else if (localName.equals("service-impl-class"))
-      {
-         ref.setServiceImplClass(value);
-      }
-      else if (localName.equals("config-name"))
-      {
-         ref.setConfigName(value);
-      }
-      else if (localName.equals("config-file"))
-      {
-         ref.setConfigFile(value);
-      }
-      else if (localName.equals("wsdl-override"))
-      {
-         ref.setWsdlOverride(value);
-      }
-      else if (localName.equals("handler-chain"))
-      {
-         ref.setHandlerChain(value);
-      }
-   }
-
-   public Object newChild(ServiceRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+   public Object newChild(ServiceRefElement ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
-      Object child = null;
-      if (localName.equals("port-component-ref"))
-         child = new PortComponentRefMetaData(ref);
-      else if (localName.equals("handler"))
-         child = new HandlerMetaData();
-      else if (localName.equals("handler-chains"))
-         child = new HandlerChainsMetaData();
-      
-      else if (localName.equals("call-property"))
-         child = new CallPropertyMetaData();
-
-      return child;
+      return new ServiceRefDelegate().newChild(ref, navigator, namespaceURI, localName, attrs);
    }
 
-   public Object newChild(HandlerChainsMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+   public void setValue(ServiceRefElement ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
-      Object child = null;
-      if (localName.equals("handler-chain"))
-         child = new HandlerChainMetaData();
-
-      return child;
+      new ServiceRefDelegate().setValue(ref, navigator, namespaceURI, localName, value);
    }
-
-   public void addChild(ServiceRefMetaData parent, PortComponentRefMetaData pcRef, UnmarshallingContext navigator, String namespaceURI, String localName)
+   
+   public static boolean isJ2EE14Descriptor(Element element)
    {
-      parent.addPortComponentRef(pcRef);
-   }
+      // Verify J2EE-1.4
+      String nsURI = element.getOwnerDocument().getDocumentElement().getNamespaceURI();
+      boolean isValid = "http://java.sun.com/xml/ns/j2ee".equals(nsURI);
 
-   public void addChild(ServiceRefMetaData parent, HandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      parent.addHandler(handler);
-   }
-
-   public void addChild(ServiceRefMetaData parent, HandlerChainsMetaData handlerChains, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      parent.setHandlerChains(handlerChains);
-   }
-
-   public void addChild(ServiceRefMetaData parent, CallPropertyMetaData callProp, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      parent.addCallProperty(callProp);
-   }
-
-   public void addChild(HandlerChainsMetaData parent, HandlerChainMetaData handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      parent.addHandlerChain(handlerChain);
-   }
-
-   public void setValue(PortComponentRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("service-endpoint-interface"))
+      // Verify JBoss-4.0
+      DocumentType doctype = element.getOwnerDocument().getDoctype();
+      if (isValid == false && doctype != null)
       {
-         ref.setServiceEndpointInterface(value);
+         String publicId = doctype.getPublicId();
+         isValid |= "-//JBoss//DTD JBOSS 4.0//EN".equals(publicId);
+         isValid |= "-//JBoss//DTD JBOSS 4.2//EN".equals(publicId);
+         isValid |= "-//JBoss//DTD Web Application 2.4//EN".equals(publicId);
+         isValid |= "-//JBoss//DTD Application Client 4.0//EN".equals(publicId);
+         isValid |= "-//JBoss//DTD Application Client 4.2//EN".equals(publicId);
       }
-      else if (localName.equals("enable-mtom"))
-      {
-         ref.setEnableMTOM(Boolean.valueOf(value));
-      }
-      else if (localName.equals("port-component-link"))
-      {
-         ref.setPortComponentLink(value);
-      }
-      else if (localName.equals("port-qname"))
-      {
-         ref.setPortQName(QName.valueOf(value));
-      }
-      else if (localName.equals("config-name"))
-      {
-         ref.setConfigName(value);
-      }
-      else if (localName.equals("config-file"))
-      {
-         ref.setConfigFile(value);
-      }
-   }
 
-   public Object newChild(PortComponentRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
-   {
-      Object child = null;
-      if (localName.equals("call-property"))
-         child = new CallPropertyMetaData();
-      if (localName.equals("stub-property"))
-         child = new StubPropertyMetaData();
-      return child;
-   }
-
-   public void setValue(HandlerChainMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("service-name-pattern"))
+      if (isValid == false)
       {
-         ref.setServiceNamePattern(QName.valueOf(value));
+         String dtstr = (doctype != null ? "[public=" + doctype.getPublicId() + ",system=" + doctype.getSystemId() + "]" : null);
+         log.debug("Skip <service-ref> for: nsURI=" + nsURI + ",doctype=" + dtstr);
       }
-      else if (localName.equals("port-name-pattern"))
-      {
-         ref.setPortNamePattern(QName.valueOf(value));
-      }
-      else if (localName.equals("protocol-binding"))
-      {
-         ref.setProtocolBindings(value);
-      }
+      return isValid;
    }
-
-   public void setValue(HandlerMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("handler-name"))
-      {
-         ref.setHandlerName(value);
-      }
-      else if (localName.equals("handler-class"))
-      {
-         ref.setHandlerClass(value);
-      }
-      else if (localName.equals("soap-header"))
-      {
-         ref.addSoapHeader(navigator.resolveQName(value));
-      }
-      else if (localName.equals("soap-role"))
-      {
-         ref.addSoapRole(value);
-      }
-      else if (localName.equals("port-name"))
-      {
-         ref.addPortName(value);
-      }
-   }
-
-   public Object newChild(HandlerMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
-   {
-      Object child = null;
-      if (localName.equals("init-param"))
-         child = new InitParamMetaData();
-
-      return child;
-   }
-
-   public void addChild(HandlerMetaData parent, InitParamMetaData param, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      parent.addInitParam(param);
-   }
-
-   public void setValue(InitParamMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("param-name"))
-      {
-         ref.setParamName(value);
-      }
-      else if (localName.equals("param-value"))
-      {
-         ref.setParamValue(value);
-      }
-   }
-
-   public void setValue(CallPropertyMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("prop-name"))
-      {
-         ref.setPropName(value);
-      }
-      else if (localName.equals("prop-value"))
-      {
-         ref.setPropValue(value);
-      }
-   }
-
-   public void setValue(StubPropertyMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("prop-name"))
-      {
-         ref.setPropName(value);
-      }
-      else if (localName.equals("prop-value"))
-      {
-         ref.setPropValue(value);
-      }
-   }
-   
-   public void addChild(PortComponentRefMetaData ref, CallPropertyMetaData callProp, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      ref.addCallProperty(callProp);
-   }
-
-   public void addChild(PortComponentRefMetaData ref, StubPropertyMetaData stubProp, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      ref.addStubProperty(stubProp);
-   }
 }

Deleted: trunk/server/src/main/org/jboss/metadata/serviceref/StubPropertyMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/StubPropertyMetaData.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/StubPropertyMetaData.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -1,63 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.metadata.serviceref;
-
-// $Id$
-
-import java.io.Serializable;
-
-/**
- * @author Thomas.Diesler at jboss.org
- * @since 06-May-2004
- */
-public class StubPropertyMetaData implements Serializable
-{
-   // The required <prop-name> element
-   private String propName;
-   // The required <prop-value> element
-   private String propValue;
-
-   public String getPropName()
-   {
-      return propName;
-   }
-
-   public void setPropName(String paramName)
-   {
-      this.propName = paramName;
-   }
-
-   public String getPropValue()
-   {
-      return propValue;
-   }
-
-   public void setPropValue(String paramValue)
-   {
-      this.propValue = paramValue;
-   }
-
-   public String toString()
-   {
-      return "[name=" + propName + ",value=" + propValue + "]";
-   }
-}

Copied: trunk/server/src/main/org/jboss/metadata/serviceref/VirtualFileAdaptor.java (from rev 61232, branches/tdiesler/trunk/server/src/main/org/jboss/metadata/serviceref/VirtualFileAdaptor.java)
===================================================================
--- trunk/server/src/main/org/jboss/metadata/serviceref/VirtualFileAdaptor.java	                        (rev 0)
+++ trunk/server/src/main/org/jboss/metadata/serviceref/VirtualFileAdaptor.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.metadata.serviceref;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.virtual.VirtualFile;
+import org.jboss.ws.integration.UnifiedVirtualFile;
+
+// $Id$
+
+/**
+ * A JBoss50 VirtualFile adaptor
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 05-May-2006
+ */
+public class VirtualFileAdaptor implements UnifiedVirtualFile
+{
+   private static final long serialVersionUID = 6547394037548338042L;
+
+   private VirtualFile root;
+
+   public VirtualFileAdaptor(VirtualFile root)
+   {
+      this.root = root;
+   }
+
+   public UnifiedVirtualFile findChild(String child) throws IOException
+   {
+      VirtualFile vf = root.findChild(child);
+      return new VirtualFileAdaptor(vf);
+   }
+
+   public URL toURL()
+   {
+      try
+      {
+         return root.toURL();
+      }
+      catch (Exception e)
+      {
+         return null;
+      }
+   }
+}

Modified: trunk/server/src/main/org/jboss/metadata/web/JBossWebMetaDataObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/JBossWebMetaDataObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/web/JBossWebMetaDataObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -36,8 +36,8 @@
 import org.jboss.metadata.ResourceRefMetaData;
 import org.jboss.metadata.SecurityRoleMetaData;
 import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.jboss.xb.binding.JBossXBException;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.Unmarshaller;
@@ -224,7 +224,7 @@
       }
       else
       {
-         targetRef.mergeJBossProperties(sref);
+         targetRef.merge(sref);
       }
    }
 

Modified: trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -41,7 +41,7 @@
 import org.jboss.metadata.WebMetaData;
 import org.jboss.metadata.WebSecurityMetaData;
 import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.jboss.xb.binding.UnmarshallingContext;
 import org.xml.sax.Attributes;
 

Modified: trunk/server/src/main/org/jboss/metamodel/descriptor/DDObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metamodel/descriptor/DDObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metamodel/descriptor/DDObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -23,7 +23,7 @@
 
 import javax.persistence.PersistenceContextType;
 
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
 import org.jboss.metadata.serviceref.ServiceRefObjectFactory;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.UnmarshallingContext;
@@ -432,7 +432,7 @@
       }
       else if (localName.equals("service-ref"))
       {
-         child = new ServiceRefMetaData();
+         child = new ServiceRefDelegate().newMetaData();
       }
       else if (localName.equals("jndi-ref"))
       {

Modified: trunk/server/src/main/org/jboss/metamodel/descriptor/EnvironmentRefGroup.java
===================================================================
--- trunk/server/src/main/org/jboss/metamodel/descriptor/EnvironmentRefGroup.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/metamodel/descriptor/EnvironmentRefGroup.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -28,7 +28,7 @@
 import java.util.List;
 
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.ws.integration.ServiceRefMetaData;
 
 /**
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>

Modified: trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java
===================================================================
--- trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -51,15 +51,16 @@
 import org.jboss.metadata.ResourceEnvRefMetaData;
 import org.jboss.metadata.ResourceRefMetaData;
 import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.serviceref.ServiceRefHandlerDelegate;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
+import org.jboss.metadata.serviceref.VirtualFileAdaptor;
 import org.jboss.mx.loading.LoaderRepositoryFactory;
 import org.jboss.naming.NonSerializableFactory;
 import org.jboss.naming.Util;
 import org.jboss.security.AuthorizationManager;
 import org.jboss.security.authorization.PolicyRegistration;
-import org.jboss.virtual.VirtualFile;
 import org.jboss.web.WebApplication;
 import org.jboss.web.AbstractWebContainer.WebDescriptorParser;
+import org.jboss.ws.integration.UnifiedVirtualFile;
 import org.omg.CORBA.ORB;
 
 /**
@@ -511,8 +512,8 @@
       log.debug("linkEjbLocalRefs");
       linkEjbLocalRefs(unit, ejbLocalRefs, envCtx);
       log.debug("linkServiceRefs");
-      VirtualFile vfsRoot = unit.getDeploymentContext().getRoot();
-      ServiceRefHandlerDelegate.bindServiceRefs(envCtx, vfsRoot, metaData.getServiceRefs().values());
+      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
+      new ServiceRefDelegate().setupServiceRefs(envCtx, vfsRoot, metaData.getServiceRefs().values());
    }
 
    protected void addEnvEntries(Iterator envEntries, Context envCtx)

Modified: trunk/tomcat/.classpath
===================================================================
--- trunk/tomcat/.classpath	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/tomcat/.classpath	2007-03-08 23:43:59 UTC (rev 61233)
@@ -45,5 +45,6 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-jdk50.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs.jar" sourcepath="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/jbossws/lib/jbossws-integration.jar"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: trunk/tomcat/build.xml
===================================================================
--- trunk/tomcat/build.xml	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/tomcat/build.xml	2007-03-08 23:43:59 UTC (rev 61233)
@@ -60,6 +60,7 @@
       <path refid="jgroups.jgroups.classpath"/>
       <path refid="jboss.common.core.classpath"/>
       <path refid="jboss.common.logging.spi.classpath"/>
+      <path refid="jboss.jbossws.classpath"/>
       <path refid="jboss.jbossxb.classpath"/>
       <path refid="jboss.serialization.classpath"/>
       <path refid="jboss.microcontainer.classpath"/>

Modified: trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/JBossWebDDObjectFactory.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/JBossWebDDObjectFactory.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/JBossWebDDObjectFactory.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -26,7 +26,6 @@
 import java.net.URL;
 
 import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.metamodel.descriptor.DDObjectFactory;
 import org.jboss.metamodel.descriptor.EjbLocalRef;
 import org.jboss.metamodel.descriptor.EjbRef;
@@ -36,6 +35,7 @@
 import org.jboss.metamodel.descriptor.ResourceEnvRef;
 import org.jboss.metamodel.descriptor.ResourceRef;
 import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.ws.integration.ServiceRefMetaData;
 import org.jboss.xb.binding.JBossXBException;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.Unmarshaller;
@@ -188,7 +188,7 @@
       }
       else
       {
-         targetRef.mergeJBossProperties(sref);
+         targetRef.merge(sref);
       }
    }
 

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -31,7 +31,6 @@
 import java.security.CodeSource;
 import java.security.cert.Certificate;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -51,8 +50,8 @@
 import org.jboss.deployers.spi.deployer.DeploymentUnit;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.serviceref.ServiceRefHandlerDelegate;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
+import org.jboss.metadata.serviceref.VirtualFileAdaptor;
 import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
 import org.jboss.mx.util.MBeanServerLocator;
 import org.jboss.naming.NonSerializableFactory;
@@ -70,6 +69,8 @@
 import org.jboss.web.tomcat.tc6.session.AbstractJBossManager;
 import org.jboss.web.tomcat.tc6.session.ClusteringNotSupportedException;
 import org.jboss.web.tomcat.tc6.session.JBossCacheManager;
+import org.jboss.ws.integration.ServiceRefMetaData;
+import org.jboss.ws.integration.UnifiedVirtualFile;
 import org.omg.CORBA.ORB;
 
 /**
@@ -363,7 +364,7 @@
             linkSecurityDomain(securityDomain, envCtx);
             
             // Bind <service-ref> elements
-            VirtualFile vfsRoot = unit.getDeploymentContext().getRoot();
+            UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
             EnvironmentRefGroup envRefGroup = injectionContainer.getEnvironmentRefGroup();
             for (ServiceRefMetaData sref : metaData.getServiceRefs().values())
             {
@@ -371,7 +372,7 @@
                ServiceRefMetaData injectedRef = envRefGroup.getServiceRef(refName);
                if (injectedRef == null || injectedRef.isProcessed() == false)
                {
-                  ServiceRefHandlerDelegate.bindServiceRef(envCtx, refName, vfsRoot, sref);
+                  new ServiceRefDelegate().setupServiceRef(envCtx, refName, vfsRoot, sref);
                }
             }
          }

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment2.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment2.java	2007-03-08 22:32:15 UTC (rev 61232)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment2.java	2007-03-08 23:43:59 UTC (rev 61233)
@@ -53,8 +53,8 @@
 import org.jboss.deployers.spi.deployer.DeploymentUnit;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.serviceref.ServiceRefHandlerDelegate;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.metadata.serviceref.ServiceRefDelegate;
+import org.jboss.metadata.serviceref.VirtualFileAdaptor;
 import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
 import org.jboss.mx.util.MBeanServerLocator;
 import org.jboss.naming.NonSerializableFactory;
@@ -72,6 +72,8 @@
 import org.jboss.web.tomcat.tc6.session.AbstractJBossManager;
 import org.jboss.web.tomcat.tc6.session.ClusteringNotSupportedException;
 import org.jboss.web.tomcat.tc6.session.JBossCacheManager;
+import org.jboss.ws.integration.ServiceRefMetaData;
+import org.jboss.ws.integration.UnifiedVirtualFile;
 import org.omg.CORBA.ORB;
 
 /**
@@ -475,7 +477,7 @@
                linkSecurityDomain(securityDomain, envCtx);
 
                // Bind <service-ref> elements
-               VirtualFile vfsRoot = unit.getDeploymentContext().getRoot();
+               UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
                EnvironmentRefGroup envRefGroup = injectionContainer.getEnvironmentRefGroup();
                for (ServiceRefMetaData sref : metaData.getServiceRefs().values())
                {
@@ -483,7 +485,7 @@
                   ServiceRefMetaData injectedRef = envRefGroup.getServiceRef(refName);
                   if (injectedRef == null || injectedRef.isProcessed() == false)
                   {
-                     ServiceRefHandlerDelegate.bindServiceRef(envCtx, refName, vfsRoot, sref);
+                     new ServiceRefDelegate().setupServiceRef(envCtx, refName, vfsRoot, sref);
                   }
                }
             }




More information about the jboss-cvs-commits mailing list