[jbossws-commits] JBossWS SVN: r3999 - in trunk: integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42 and 8 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Jul 26 07:33:20 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-07-26 07:33:20 -0400 (Thu, 26 Jul 2007)
New Revision: 3999

Modified:
   trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/InvocationHandlerEJB3.java
   trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/ServiceRefMetaDataAdapter.java
   trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/WebServiceClientDeployer.java
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebMetaDataAdapter.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdapter.java
   trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/PublishContractDeploymentAspect.java
   trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicArchiveDeployment.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicDeployment.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DeploymentModelFactoryImpl.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/WebAppGeneratorDeploymentAspect.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/UnifiedDeploymentInfo.java
   trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
   trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
   trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
   trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
   trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
   trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
   trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
   trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
Log:
Add notion of parent deployment

Modified: trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/InvocationHandlerEJB3.java
===================================================================
--- trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/InvocationHandlerEJB3.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/InvocationHandlerEJB3.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -30,6 +30,8 @@
 
 import org.jboss.aop.Dispatcher;
 import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.invocation.Invocation;
@@ -54,11 +56,11 @@
    public void init(Endpoint ep)
    {    
       String ejbName = ep.getShortName();
-      UnifiedDeploymentInfo udi = ep.getService().getDeployment().getContext().getAttachment(UnifiedDeploymentInfo.class);
-      String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + udi.getSimpleName();
-      if (udi.getParent() != null)
+      ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment();
+      String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName();
+      if (dep.getParent() != null)
       {
-         nameStr += ",ear=" + udi.getParent().getSimpleName();
+         nameStr += ",ear=" + dep.getParent().getSimpleName();
       }
 
       objectName = ObjectNameFactory.create(nameStr.toString());

Modified: trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/ServiceRefMetaDataAdapter.java
===================================================================
--- trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/ServiceRefMetaDataAdapter.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/ServiceRefMetaDataAdapter.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -35,7 +35,7 @@
 import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
 import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
 import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.UnifiedVirtualFile;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedCallPropertyMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
@@ -50,9 +50,9 @@
  */
 public class ServiceRefMetaDataAdapter
 {
-   public UnifiedServiceRefMetaData buildServiceRefMetaData(UnifiedDeploymentInfo udi, ServiceRefMetaData srmd) throws IOException
+   public UnifiedServiceRefMetaData buildServiceRefMetaData(UnifiedVirtualFile vfRoot, ServiceRefMetaData srmd) throws IOException
    {
-      UnifiedServiceRefMetaData usrmd = new UnifiedServiceRefMetaData(udi.getVfRoot());
+      UnifiedServiceRefMetaData usrmd = new UnifiedServiceRefMetaData(vfRoot);
       usrmd.setServiceRefName(srmd.getServiceRefName());
       usrmd.setServiceInterface(srmd.getServiceInterface());
       usrmd.setWsdlFile(srmd.getWsdlFile());

Modified: trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/WebServiceClientDeployer.java
===================================================================
--- trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/WebServiceClientDeployer.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/WebServiceClientDeployer.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -23,6 +23,9 @@
 
 // $Id$
 
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Iterator;
 
 import javax.naming.Context;
@@ -33,16 +36,10 @@
 import org.jboss.util.naming.Util;
 import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.ws.core.jaxrpc.client.ServiceReferenceable;
+import org.jboss.ws.integration.ResourceLoaderAdapter;
 import org.jboss.ws.integration.URLLoaderAdapter;
-import org.jboss.wsf.container.jboss42.DeploymentInfoAdapter;
-import org.jboss.wsf.container.jboss42.DeploymentInfoAdapterFactory;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.JAXRPCClientDeployment;
-import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
-import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.ws.integration.UnifiedVirtualFile;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
 
 /**
  * Binds a JAXRPC Service object in the client's ENC for every service-ref element in the
@@ -70,16 +67,10 @@
             ServiceRefMetaData serviceRef = (ServiceRefMetaData)serviceRefs.next();
             String serviceRefName = serviceRef.getServiceRefName();
 
-            // Build the container independent deployment info
-            SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-            Deployment dep = spiProvider.getSPI(DeploymentModelFactory.class).createDeployment(di.ucl);
-            UnifiedDeploymentInfo udi = new JAXRPCClientDeployment(Deployment.DeploymentType.JAXRPC_CLIENT);
-            DeploymentInfoAdapter adapter = DeploymentInfoAdapterFactory.getDeploymentInfoAdapter();
-            adapter.buildDeploymentInfo(dep, udi, di);
+            UnifiedVirtualFile vfRoot = new ResourceLoaderAdapter(di.localCl);
+            UnifiedServiceRefMetaData usr = ServiceRefMetaDataAdapterFactory.newInstance().buildServiceRefMetaData(vfRoot, serviceRef);
+            usr.setVfsRoot(new URLLoaderAdapter(getDeploymentURL(di)));
 
-            UnifiedServiceRefMetaData usr = ServiceRefMetaDataAdapterFactory.newInstance().buildServiceRefMetaData(udi, serviceRef);
-            usr.setVfsRoot(new URLLoaderAdapter(udi.getUrl()));
-
             ServiceReferenceable ref = new ServiceReferenceable(usr);
             Util.bind(envCtx, serviceRefName, ref);
 
@@ -91,4 +82,25 @@
          throw new DeploymentException("Cannot bind webservice to client environment", e);
       }
    }
+   
+   private URL getDeploymentURL(DeploymentInfo di)
+   {
+      URL deploymentURL = (di.localUrl != null ? di.localUrl : di.url);
+      if ("file".equals(deploymentURL.getProtocol()))
+      {
+         String path = deploymentURL.getPath();
+         if (new File(path).isFile())
+         {
+            try
+            {
+               deploymentURL = new URL("jar:file:" + path + "!/");
+            }
+            catch (MalformedURLException e)
+            {
+               // ignore
+            }
+         }
+      }
+      return deploymentURL;
+   }
 }

Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/AbstractDeployerHook.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -75,12 +75,19 @@
       return deploymentModelFactory;
    }
 
-   public ArchiveDeployment createDeployment(ClassLoader initialLoader)
+   public ArchiveDeployment newDeployment(DeploymentInfo di)
    {
       try
       {
          DeploymentModelFactory factory = getDeploymentModelFactory();
-         return (ArchiveDeployment)factory.createDeployment(initialLoader);
+         ArchiveDeployment dep = (ArchiveDeployment)factory.createDeployment(di.shortName, di.annotationsCl);
+         if (di.parent != null)
+         {
+            DeploymentInfo parentInfo = di.parent;
+            ArchiveDeployment parentDep = (ArchiveDeployment)factory.createDeployment(parentInfo.shortName, parentInfo.annotationsCl);
+            dep.setParent(parentDep);
+         }
+         return dep;
       }
       catch (Exception ex)
       {
@@ -88,7 +95,7 @@
       }
    }
 
-   public Endpoint createEndpoint()
+   public Endpoint newEndpoint()
    {
       try
       {

Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/DeploymentInfoAdapter.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -31,8 +31,7 @@
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ApplicationMetaData;
 import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.integration.ResourceLoaderAdapter;
-import org.jboss.wsf.framework.deployment.WebXMLRewriter;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
@@ -79,8 +78,8 @@
          buildDeploymentInfo(dep, udi.getParent(), di.parent);
       }
 
-      udi.setVfRoot(new ResourceLoaderAdapter(di.localCl));
-      udi.setSimpleName(di.shortName);
+      //udi.setVfRoot(new ResourceLoaderAdapter(di.localCl));
+      //udi.setSimpleName(di.shortName);
       udi.setUrl(getDeploymentURL(di));
 
       if (di.deployedObject != null)

Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -40,6 +40,7 @@
 import org.jboss.wsf.common.ObjectNameFactory;
 import org.jboss.wsf.spi.SPIProvider;
 import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.invocation.ExtendableWebServiceContext;
@@ -70,11 +71,11 @@
    public void init(Endpoint ep)
    {
       String ejbName = ep.getShortName();
-      UnifiedDeploymentInfo udi = ep.getService().getDeployment().getContext().getAttachment(UnifiedDeploymentInfo.class);
-      String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + udi.getSimpleName();
-      if (udi.getParent() != null)
+      ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment();
+      String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName();
+      if (dep.getParent() != null)
       {
-         nameStr += ",ear=" + udi.getParent().getSimpleName();
+         nameStr += ",ear=" + dep.getParent().getSimpleName();
       }
 
       objectName = ObjectNameFactory.create(nameStr.toString());

Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookEJB21.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -54,7 +54,7 @@
    @Override
    public Deployment createDeployment(DeploymentInfo di)
    {
-      ArchiveDeployment dep = createDeployment(di.annotationsCl);
+      ArchiveDeployment dep = newDeployment(di);
       dep.setRootFile(new URLLoaderAdapter(di.localUrl));
       dep.setRuntimeClassLoader(di.ucl);
       dep.setType(getDeploymentType());
@@ -88,7 +88,7 @@
             String ejbClass = beanMetaData.getEjbClass();
             
             // Create the endpoint
-            Endpoint ep = createEndpoint();
+            Endpoint ep = newEndpoint();
             ep.setShortName(ejbLink);
             ep.setService(service);
             ep.setTargetBeanName(ejbClass);

Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookJSE.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -60,7 +60,7 @@
    @Override
    public Deployment createDeployment(DeploymentInfo di)
    {
-      ArchiveDeployment dep = createDeployment(di.annotationsCl);
+      ArchiveDeployment dep = newDeployment(di);
       dep.setRootFile(new URLLoaderAdapter(di.localUrl));
       dep.setRuntimeClassLoader(null);
       dep.setType(getDeploymentType());
@@ -105,7 +105,7 @@
             }
 
             // Create the endpoint
-            Endpoint ep = createEndpoint();
+            Endpoint ep = newEndpoint();
             ep.setShortName(servletLink);
             ep.setService(service);
             ep.setTargetBeanName(servletClass);

Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookEJB3.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -55,7 +55,7 @@
    @Override
    public Deployment createDeployment(DeploymentInfo di)
    {
-      ArchiveDeployment dep = createDeployment(di.annotationsCl);
+      ArchiveDeployment dep = newDeployment(di);
       dep.setRootFile(new URLLoaderAdapter(di.localUrl));
       dep.setRuntimeClassLoader(di.ucl);
       dep.setType(getDeploymentType());
@@ -74,7 +74,7 @@
                String epBean = container.getBeanClassName();
 
                // Create the endpoint
-               Endpoint ep = createEndpoint();
+               Endpoint ep = newEndpoint();
                ep.setShortName(ejbName);
                ep.setService(service);
                ep.setTargetBeanName(epBean);

Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookJSE.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -57,30 +57,30 @@
    }
 
    @Override
-   public Deployment createDeployment(DeploymentInfo unit)
+   public Deployment createDeployment(DeploymentInfo di)
    {
-      ArchiveDeployment dep = createDeployment(unit.annotationsCl);
-      dep.setRootFile(new URLLoaderAdapter(unit.localUrl));
+      ArchiveDeployment dep = newDeployment(di);
+      dep.setRootFile(new URLLoaderAdapter(di.localUrl));
       dep.setRuntimeClassLoader(null);
       dep.setType(getDeploymentType());
 
       Service service = dep.getService();
 
-      WebMetaData webMetaData = (WebMetaData)unit.metaData;
+      WebMetaData webMetaData = (WebMetaData)di.metaData;
       if (webMetaData == null)
          throw new IllegalStateException("Deployment unit does not contain web meta data");
 
       // Copy the attachments
       dep.getContext().addAttachment(WebMetaData.class, webMetaData);
 
-      List<Servlet> servlets = getRelevantServlets(webMetaData, unit.annotationsCl);
+      List<Servlet> servlets = getRelevantServlets(webMetaData, di.annotationsCl);
       for (Servlet servlet : servlets)
       {
          String servletName = servlet.getServletName();
          String servletClass = servlet.getServletClass();
 
          // Create the endpoint
-         Endpoint ep = createEndpoint();
+         Endpoint ep = newEndpoint();
          ep.setShortName(servletName);
          ep.setService(service);
          ep.setTargetBeanName(servletClass);

Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebMetaDataAdapter.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebMetaDataAdapter.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebMetaDataAdapter.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -66,7 +66,7 @@
          while (it.hasNext())
          {
             J2eeModuleMetaData module = (J2eeModuleMetaData)it.next();
-            if (module.getFileName().equals(udi.getSimpleName()))
+            if (module.getFileName().equals(dep.getSimpleName()))
                contextRoot = module.getWebContext();
          }
       }

Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/AbstractDeployerHook.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -68,12 +68,19 @@
       return deploymentModelFactory;
    }
 
-   public ArchiveDeployment createDeployment(ClassLoader initialLoader)
+   public ArchiveDeployment newDeployment(DeploymentUnit unit)
    {
       try
       {
          DeploymentModelFactory factory = getDeploymentModelFactory();
-         return (ArchiveDeployment)factory.createDeployment(initialLoader);
+         ArchiveDeployment dep = (ArchiveDeployment)factory.createDeployment(unit.getSimpleName(), unit.getClassLoader());
+         if (unit.getParent() != null)
+         {
+            DeploymentUnit parentUnit = unit.getParent();
+            ArchiveDeployment parentDep = (ArchiveDeployment)factory.createDeployment(parentUnit.getSimpleName(), parentUnit.getClassLoader());
+            dep.setParent(parentDep);
+         }
+         return dep;
       }
       catch (Exception ex)
       {
@@ -81,20 +88,8 @@
       }
    }
 
-   public Service createService()
+   public Endpoint newEndpoint()
    {
-       try
-      {
-         return getDeploymentModelFactory().createService();
-      }
-      catch (Exception ex)
-      {
-         throw new WSFDeploymentException("Cannot load spi.deployment.Service class", ex);
-      }
-   }
-
-   public Endpoint createEndpoint()
-   {
       try
       {
          return getDeploymentModelFactory().createEndpoint();

Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -77,9 +77,9 @@
          }
 
          VirtualFile vfsRoot = ((VFSDeploymentUnit)unit).getRoot();
-         udi.setVfRoot(new VirtualFileAdaptor(vfsRoot));
+         //udi.setVfRoot(new VirtualFileAdaptor(vfsRoot));
 
-         udi.setSimpleName(unit.getSimpleName());
+         //udi.setSimpleName(unit.getSimpleName());
          udi.setUrl(vfsRoot.toURL());
 
          buildMetaData(dep, udi, unit);

Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -32,6 +32,7 @@
 import org.jboss.ejb3.stateless.StatelessContainer;
 import org.jboss.injection.lang.reflect.BeanProperty;
 import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.invocation.*;
@@ -65,11 +66,11 @@
    public void init(Endpoint ep)
    {
       String ejbName = ep.getShortName();
-      UnifiedDeploymentInfo udi = ep.getService().getDeployment().getContext().getAttachment(UnifiedDeploymentInfo.class);
-      String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + udi.getSimpleName();
-      if (udi.getParent() != null)
+      ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment();
+      String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName();
+      if (dep.getParent() != null)
       {
-         nameStr += ",ear=" + udi.getParent().getSimpleName();
+         nameStr += ",ear=" + dep.getParent().getSimpleName();
       }
 
       objectName = ObjectNameFactory.create(nameStr.toString());

Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -54,7 +54,7 @@
    @Override
    public Deployment createDeployment(DeploymentUnit unit)
    {
-      ArchiveDeployment dep = createDeployment(unit.getClassLoader());
+      ArchiveDeployment dep = newDeployment(unit);
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
       dep.setRuntimeClassLoader(unit.getClassLoader());
       dep.setType(getDeploymentType());
@@ -88,7 +88,7 @@
             String ejbClass = beanMetaData.getEjbClass();
 
             // Create the endpoint
-            Endpoint ep = createEndpoint();
+            Endpoint ep = newEndpoint();
             ep.setShortName(ejbLink);
             ep.setService(service);
             ep.setTargetBeanName(ejbClass);

Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -57,7 +57,7 @@
    @Override
    public Deployment createDeployment(DeploymentUnit unit)
    {
-      ArchiveDeployment dep = createDeployment(unit.getClassLoader());
+      ArchiveDeployment dep = newDeployment(unit);
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
       dep.setRuntimeClassLoader(null);
       dep.setType(getDeploymentType());
@@ -88,7 +88,7 @@
             String servletClass = servlet.getServletClass();
 
             // Create the endpoint
-            Endpoint ep = createEndpoint();
+            Endpoint ep = newEndpoint();
             ep.setShortName(servletLink);
             ep.setService(service);
             ep.setTargetBeanName(servletClass);

Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -56,7 +56,7 @@
    @Override
    public Deployment createDeployment(DeploymentUnit unit)
    {
-      ArchiveDeployment dep = createDeployment(unit.getClassLoader());
+      ArchiveDeployment dep = newDeployment(unit);
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
       dep.setRuntimeClassLoader(unit.getClassLoader());
       dep.setType(getDeploymentType());
@@ -80,7 +80,7 @@
             String epBean = container.getBeanClassName();
 
             // Create the endpoint
-            Endpoint ep = createEndpoint();
+            Endpoint ep = newEndpoint();
             ep.setShortName(ejbName);
             ep.setService(service);
             ep.setTargetBeanName(epBean);

Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -56,7 +56,7 @@
    @Override
    public Deployment createDeployment(DeploymentUnit unit)
    {
-      ArchiveDeployment dep = createDeployment(unit.getClassLoader());
+      ArchiveDeployment dep = newDeployment(unit);
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
       dep.setRuntimeClassLoader(null);
       dep.setType(getDeploymentType());
@@ -77,7 +77,7 @@
          String servletClass = servlet.getServletClass();
 
          // Create the endpoint
-         Endpoint ep = createEndpoint();
+         Endpoint ep = newEndpoint();
          ep.setShortName(servletName);
          ep.setService(service);
          ep.setTargetBeanName(servletClass);

Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdapter.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdapter.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebMetaDataAdapter.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -60,7 +60,7 @@
          J2eeApplicationMetaData appmd = unit.getParent().getAttachment(J2eeApplicationMetaData.class);
          if (appmd != null)
          {
-            J2eeModuleMetaData module = appmd.getModule(udi.getSimpleName());
+            J2eeModuleMetaData module = appmd.getModule(dep.getSimpleName());
             if (module != null)
                contextRoot = module.getWebContext();
          }

Modified: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/PublishContractDeploymentAspect.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/PublishContractDeploymentAspect.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/PublishContractDeploymentAspect.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -26,6 +26,7 @@
 import java.io.IOException;
 
 import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.DeploymentAspect;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
@@ -52,7 +53,7 @@
 
       try
       {
-         WSDLFilePublisher publisher = new WSDLFilePublisher(dep, udi);
+         WSDLFilePublisher publisher = new WSDLFilePublisher((ArchiveDeployment)dep, udi);
          publisher.publishWsdlFiles(umd);
       }
       catch (IOException ex)

Modified: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -47,14 +47,14 @@
 import org.jboss.ws.metadata.umdm.UnifiedMetaData;
 import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
 import org.jboss.ws.tools.wsdl.WSDLWriter;
-import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.IOUtils;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.management.ServerConfig;
 import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.common.IOUtils;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -69,12 +69,12 @@
    private static final Logger log = Logger.getLogger(WSDLFilePublisher.class);
 
    // The deployment info for the web service archive
-   private Deployment dep;
+   private ArchiveDeployment dep;
    private UnifiedDeploymentInfo udi;
    // The expected wsdl location in the deployment
    private String expLocation;
 
-   public WSDLFilePublisher(Deployment dep, UnifiedDeploymentInfo udi)
+   public WSDLFilePublisher(ArchiveDeployment dep, UnifiedDeploymentInfo udi)
    {
       this.dep = dep;
       this.udi = udi;
@@ -93,7 +93,7 @@
     */
    public void publishWsdlFiles(UnifiedMetaData wsMetaData) throws IOException
    {
-      String deploymentName = udi.getCanonicalName();
+      String deploymentName = dep.getCanonicalName();
 
       // For each service
       for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
@@ -202,7 +202,7 @@
                   File targetFile = new File(xsdURL.getPath());
                   targetFile.getParentFile().mkdirs();
 
-                  String deploymentName = udi.getCanonicalName();
+                  String deploymentName = dep.getCanonicalName();
 
                   // get the resource path
                   int index = baseURI.indexOf(deploymentName);
@@ -212,7 +212,7 @@
                      resourcePath = resourcePath + "/";
 
                   resourcePath = expLocation + resourcePath + schemaLocation;
-                  URL resourceURL = udi.getMetaDataFileURL(resourcePath);
+                  URL resourceURL = dep.getMetaDataFileURL(resourcePath);
                   InputStream is = new ResourceURL(resourceURL).openStream();
                   if (is == null)
                      throw new IllegalArgumentException("Cannot find schema import in deployment: " + resourcePath);
@@ -243,7 +243,7 @@
     */
    public void unpublishWsdlFiles() throws IOException
    {
-      String deploymentDir = (udi.getParent() != null ? udi.getParent().getSimpleName() : udi.getSimpleName());
+      String deploymentDir = (dep.getParent() != null ? dep.getParent().getSimpleName() : dep.getSimpleName());
       SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
       ServerConfig config = spiProvider.getSPI(ServerConfigFactory.class).createServerConfig();
       File serviceDir = new File(config.getServerDataDir().getCanonicalPath() + "/wsdl/" + deploymentDir);

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -32,9 +32,9 @@
  */
 public class ArchiveDeploymentModelFactory extends DeploymentModelFactory
 {
-   public Deployment createDeployment(ClassLoader initialLoader)
+   public Deployment createDeployment(String simpleName, ClassLoader initialLoader)
    {
-      return new BasicArchiveDeployment(initialLoader);
+      return new BasicArchiveDeployment(simpleName, initialLoader);
    }
 
    public Service createService()

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicArchiveDeployment.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicArchiveDeployment.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicArchiveDeployment.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -23,6 +23,10 @@
 
 //$Id: BasicDeployment.java 3995 2007-07-26 08:52:45Z thomas.diesler at jboss.com $
 
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
 import org.jboss.ws.integration.UnifiedVirtualFile;
 import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 
@@ -35,14 +39,26 @@
  */
 public class BasicArchiveDeployment extends BasicDeployment implements ArchiveDeployment
 {
+   // The optional parent
+   private ArchiveDeployment parent;
    // The root file for this deployment
    private UnifiedVirtualFile rootFile;
 
-   BasicArchiveDeployment(ClassLoader classLoader)
+   BasicArchiveDeployment(String simpleName, ClassLoader classLoader)
    {
-      super(classLoader);
+      super(simpleName, classLoader);
    }
 
+   public ArchiveDeployment getParent()
+   {
+      return parent;
+   }
+
+   public void setParent(ArchiveDeployment parent)
+   {
+      this.parent = parent;
+   }
+
    public UnifiedVirtualFile getRootFile()
    {
       return rootFile;
@@ -52,4 +68,58 @@
    {
       this.rootFile = rootFile;
    }
+
+   public String getCanonicalName()
+   {
+      String name = getSimpleName();
+      if (getParent() != null)
+         name = getParent().getCanonicalName() + "/" + name;
+      return name;
+   }
+
+   public URL getMetaDataFileURL(String resourcePath) throws IOException
+   {
+      URL resourceURL = null;
+      if (resourcePath != null && resourcePath.length() > 0)
+      {
+         if (resourcePath.startsWith("/"))
+            resourcePath = resourcePath.substring(1);
+
+         try
+         {
+            // assign an absolute URL 
+            resourceURL = new URL(resourcePath);
+         }
+         catch (MalformedURLException ex)
+         {
+            // ignore
+         }
+
+         if (resourceURL == null && getRootFile() != null)
+         {
+            UnifiedVirtualFile vfResource = getRootFile().findChild(resourcePath);
+            resourceURL = vfResource.toURL();
+         }
+
+         /*
+         if (resourceURL == null)
+         {
+            String deploymentPath = getUrl().toExternalForm();
+
+            if (deploymentPath.startsWith("jar:") && deploymentPath.endsWith("!/") == false)
+               deploymentPath += "!/";
+
+            if (deploymentPath.startsWith("war:") && deploymentPath.endsWith("!/") == false)
+               deploymentPath += "!/";
+
+            if (deploymentPath.endsWith("/") == false)
+               deploymentPath += "/";
+
+            // assign a relative URL
+            resourceURL = new URL(deploymentPath + resourcePath);
+         }
+         */
+      }
+      return resourceURL;
+   }
 }

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicDeployment.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicDeployment.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicDeployment.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -40,7 +40,7 @@
    // The context for this deployment dep
    private DeploymentContext context;
    // The name for this deployment
-   private String name;
+   private String simpleName;
    // A deployment has one service
    private Service service;
    // The type of this deployment
@@ -52,8 +52,9 @@
    // The runtime class loader
    private ClassLoader runtimeLoader;
 
-   BasicDeployment(ClassLoader classLoader)
+   BasicDeployment(String name, ClassLoader classLoader)
    {
+      simpleName = name;
       context = new BasicDeploymentContext();
       state = DeploymentState.UNDEFINED;
       initialLoader = classLoader;
@@ -70,14 +71,14 @@
       this.context = context;
    }
 
-   public String getName()
+   public String getSimpleName()
    {
-      return name;
+      return simpleName;
    }
 
-   public void setName(String name)
+   public void setSimpleName(String name)
    {
-      this.name = name;
+      this.simpleName = name;
    }
 
    public void setInitialClassLoader(ClassLoader classLoader)

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -26,6 +26,7 @@
 import org.jboss.wsf.spi.annotation.WebContext;
 import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.DeploymentAspect;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
@@ -47,7 +48,7 @@
       {
          contextRoot = getExplicitContextRoot(dep);
          if (contextRoot == null)
-            contextRoot = getImplicitContextRoot(dep);
+            contextRoot = getImplicitContextRoot((ArchiveDeployment)dep);
 
          // Always prefix with '/'
          if (contextRoot.startsWith("/") == false)
@@ -95,14 +96,13 @@
 
    /** Use the implicit context root derived from the deployment name
     */
-   protected String getImplicitContextRoot(Deployment dep)
+   protected String getImplicitContextRoot(ArchiveDeployment dep)
    {
-      UnifiedDeploymentInfo udi = dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
-      String simpleName = udi.getSimpleName();
+      String simpleName = dep.getSimpleName();
       String contextRoot = simpleName.substring(0, simpleName.length() - 4);
-      if (udi.getParent() != null)
+      if (dep.getParent() != null)
       {
-         simpleName = udi.getParent().getSimpleName();
+         simpleName = dep.getParent().getSimpleName();
          contextRoot = simpleName.substring(0, simpleName.length() - 4) + "-" + contextRoot;
       }
       return contextRoot;

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DeploymentModelFactoryImpl.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DeploymentModelFactoryImpl.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/DeploymentModelFactoryImpl.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -32,9 +32,9 @@
  */
 public class DeploymentModelFactoryImpl extends DeploymentModelFactory
 {
-   public Deployment createDeployment(ClassLoader initialLoader)
+   public Deployment createDeployment(String simpleName, ClassLoader initialLoader)
    {
-      return new BasicDeployment(initialLoader);
+      return new BasicDeployment(simpleName, initialLoader);
    }
 
    public Service createService()

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/WebAppGeneratorDeploymentAspect.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/WebAppGeneratorDeploymentAspect.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/WebAppGeneratorDeploymentAspect.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -74,17 +74,17 @@
 
       if (dep.getType().toString().endsWith("EJB21"))
       {
-         URL webAppURL = generatWebDeployment(dep, securityHandlerEJB21);
+         URL webAppURL = generatWebDeployment((ArchiveDeployment)dep, securityHandlerEJB21);
          dep.getContext().setProperty(WebXMLRewriter.WEBAPP_URL, webAppURL);
       }
       else if (dep.getType().toString().endsWith("EJB3"))
       {
-         URL webAppURL = generatWebDeployment(dep, securityHandlerEJB3);
+         URL webAppURL = generatWebDeployment((ArchiveDeployment)dep, securityHandlerEJB3);
          dep.getContext().setProperty(WebXMLRewriter.WEBAPP_URL, webAppURL);
       }
    }
 
-   private URL generatWebDeployment(Deployment dep, SecurityHandler securityHandler)
+   private URL generatWebDeployment(ArchiveDeployment dep, SecurityHandler securityHandler)
    {
       Document webDoc = createWebAppDescriptor(dep, securityHandler);
       Document jbossDoc = createJBossWebAppDescriptor(dep, securityHandler);
@@ -98,7 +98,7 @@
          File tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/deploy");
 
          UnifiedDeploymentInfo udi = dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
-         String deploymentName = udi.getCanonicalName().replace('/', '-');
+         String deploymentName = dep.getCanonicalName().replace('/', '-');
          tmpWar = File.createTempFile(deploymentName, ".war", tmpdir);
          tmpWar.delete();
 

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -21,6 +21,9 @@
  */
 package org.jboss.wsf.spi.deployment;
 
+import java.io.IOException;
+import java.net.URL;
+
 import org.jboss.ws.integration.UnifiedVirtualFile;
 
 
@@ -37,10 +40,21 @@
  */
 public interface ArchiveDeployment extends Deployment
 {
+   /** Get the optional parent of this deployment */
+   ArchiveDeployment getParent();
+
+   /** Set the optional parent for this deployment */
+   void setParent (ArchiveDeployment parent);
+   
    /** Get the root file for this deployment */
    UnifiedVirtualFile getRootFile();
    
    /** Set the root file for this deployment */
    void setRootFile(UnifiedVirtualFile root);
    
+   /** The concatenated names including all parents. */
+   String getCanonicalName();
+   
+   /** Get the URL for a given resource path */
+   URL getMetaDataFileURL(String resourcePath) throws IOException;
 }
\ No newline at end of file

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -43,11 +43,11 @@
       UNDEFINED, CREATED, STARTED, STOPPED, DESTROYED
    };
    
-   /** Get the unique identifier for this deployment */
-   String getName();
+   /** Get the identifier for this deployment */
+   String getSimpleName();
 
-   /** Set the unique identifier for this deployment */
-   void setName(String name);
+   /** Set the identifier for this deployment */
+   void setSimpleName(String name);
 
    /** Get the class loader for this deployment */
    ClassLoader getInitialClassLoader();

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -29,7 +29,7 @@
  */
 public abstract class DeploymentModelFactory implements SPIView
 {
-   public abstract Deployment createDeployment(ClassLoader initialLoader);
+   public abstract Deployment createDeployment(String simpleName, ClassLoader initialLoader);
    public abstract Service createService();
    public abstract Endpoint createEndpoint();
 

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/UnifiedDeploymentInfo.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/UnifiedDeploymentInfo.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/UnifiedDeploymentInfo.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -23,12 +23,8 @@
 
 // $Id$
 
-import java.io.IOException;
-import java.net.MalformedURLException;
 import java.net.URL;
 
-import org.jboss.ws.integration.UnifiedVirtualFile;
-
 /**
  * The container independent deployment info.
  *
@@ -39,23 +35,9 @@
 {
    /** Sub deployments have a parent */
    private UnifiedDeploymentInfo parent;
-   /** The suffix of the deployment url */
-   private String simpleName;
    /** The URL for this deployment */
    private URL url;
-   /** The virtual file for the deployment root */
-   private UnifiedVirtualFile vfRoot;
-   
-   public void setVfRoot(UnifiedVirtualFile vfRoot)
-   {
-      this.vfRoot = vfRoot;
-   }
 
-   public UnifiedVirtualFile getVfRoot()
-   {
-      return vfRoot;
-   }
-
    public void setUrl(URL url)
    {
       this.url = url;
@@ -66,16 +48,6 @@
       return url;
    }
 
-   public void setSimpleName(String simpleName)
-   {
-      this.simpleName = simpleName;
-   }
-
-   public String getSimpleName()
-   {
-      return simpleName;
-   }
-
    public void setParent(UnifiedDeploymentInfo parent)
    {
       this.parent = parent;
@@ -85,57 +57,4 @@
    {
       return parent;
    }
-
-   /** The sortName concatenated with the canonical names of all parents. */
-   public String getCanonicalName()
-   {
-      String name = getSimpleName();
-      if (getParent() != null)
-         name = getParent().getCanonicalName() + "/" + name;
-      return name;
-   }
-
-   public URL getMetaDataFileURL(String resourcePath) throws IOException
-   {
-      URL resourceURL = null;
-      if (resourcePath != null && resourcePath.length() > 0)
-      {
-         if (resourcePath.startsWith("/"))
-            resourcePath = resourcePath.substring(1);
-
-         try
-         {
-            // assign an absolute URL 
-            resourceURL = new URL(resourcePath);
-         }
-         catch (MalformedURLException ex)
-         {
-            // ignore
-         }
-
-         if (resourceURL == null && getVfRoot() != null)
-         {
-            UnifiedVirtualFile vfResource = getVfRoot().findChild(resourcePath);
-            resourceURL = vfResource.toURL();
-         }
-
-         if (resourceURL == null)
-         {
-            String deploymentPath = getUrl().toExternalForm();
-
-            if (deploymentPath.startsWith("jar:") && deploymentPath.endsWith("!/") == false)
-               deploymentPath += "!/";
-
-            if (deploymentPath.startsWith("war:") && deploymentPath.endsWith("!/") == false)
-               deploymentPath += "!/";
-
-            if (deploymentPath.endsWith("/") == false)
-               deploymentPath += "/";
-
-            // assign a relative URL
-            resourceURL = new URL(deploymentPath + resourcePath);
-         }
-      }
-      return resourceURL;
-   }
 }

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -68,6 +68,7 @@
 import org.jboss.wsf.common.ObjectNameFactory;
 import org.jboss.wsf.spi.SPIProvider;
 import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
@@ -145,13 +146,16 @@
       // If not, derive the context root from the deployment
       if (contextRoot == null)
       {
-         String simpleName = udi.getSimpleName();
+         String simpleName = dep.getSimpleName();
          contextRoot = simpleName.substring(0, simpleName.indexOf('.'));
-         if (udi.getParent() != null)
+         if (dep instanceof ArchiveDeployment)
          {
-            simpleName = udi.getParent().getSimpleName();
-            simpleName = simpleName.substring(0, simpleName.indexOf('.'));
-            contextRoot = simpleName + "-" + contextRoot;
+            if (((ArchiveDeployment)dep).getParent() != null)
+            {
+               simpleName = ((ArchiveDeployment)dep).getParent().getSimpleName();
+               simpleName = simpleName.substring(0, simpleName.indexOf('.'));
+               contextRoot = simpleName + "-" + contextRoot;
+            }
          }
       }
 

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -70,12 +70,12 @@
     */
    public UnifiedMetaData buildMetaData(ArchiveDeployment dep, JAXRPCDeployment udi)
    {
-      log.debug("START buildMetaData: [name=" + udi.getCanonicalName() + "]");
+      log.debug("START buildMetaData: [name=" + dep.getCanonicalName() + "]");
       try
       {
          // For every webservice-description build the ServiceMetaData
          UnifiedMetaData wsMetaData = new UnifiedMetaData(dep.getRootFile());
-         wsMetaData.setDeploymentName(udi.getCanonicalName());
+         wsMetaData.setDeploymentName(dep.getCanonicalName());
          wsMetaData.setClassLoader(dep.getInitialClassLoader());
 
          WebserviceDescriptionMetaData[] wsDescriptionArr = udi.getWebservicesMetaData().getWebserviceDescriptions();
@@ -94,7 +94,7 @@
 
             // Unmarshall the jaxrpc-mapping.xml
             String mappingFile = wsdMetaData.getJaxrpcMappingFile();
-            serviceMetaData.setMappingLocation(udi.getMetaDataFileURL(mappingFile));
+            serviceMetaData.setMappingLocation(dep.getMetaDataFileURL(mappingFile));
             JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
             if (javaWsdlMapping == null)
                throw new WSException("jaxrpc-mapping-file not configured from webservices.xml");

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -32,7 +32,6 @@
 import org.jboss.ws.WSException;
 import org.jboss.ws.metadata.umdm.UnifiedMetaData;
 import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
@@ -55,11 +54,11 @@
     */
    public UnifiedMetaData buildMetaData(ArchiveDeployment dep, UnifiedDeploymentInfo udi)
    {
-      log.debug("START buildMetaData: [name=" + udi.getCanonicalName() + "]");
+      log.debug("START buildMetaData: [name=" + dep.getCanonicalName() + "]");
       try
       {
          UnifiedMetaData wsMetaData = new UnifiedMetaData(dep.getRootFile());
-         wsMetaData.setDeploymentName(udi.getCanonicalName());
+         wsMetaData.setDeploymentName(dep.getCanonicalName());
          wsMetaData.setClassLoader(dep.getInitialClassLoader());
 
          // The container objects below provide access to all of the ejb metadata

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -46,11 +46,11 @@
     */
    public UnifiedMetaData buildMetaData(ArchiveDeployment dep, UnifiedDeploymentInfo udi)
    {
-      log.debug("START buildMetaData: [name=" + udi.getCanonicalName() + "]");
+      log.debug("START buildMetaData: [name=" + dep.getCanonicalName() + "]");
       try
       {
          UnifiedMetaData wsMetaData = new UnifiedMetaData(dep.getRootFile());
-         wsMetaData.setDeploymentName(udi.getCanonicalName());
+         wsMetaData.setDeploymentName(dep.getCanonicalName());
          wsMetaData.setClassLoader(dep.getInitialClassLoader());
 
          // For every bean

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -47,9 +47,9 @@
 import org.jboss.ws.metadata.umdm.UnifiedMetaData;
 import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
 import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.common.JavaUtils;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
-import org.jboss.wsf.common.JavaUtils;
 
 /**
  * A server side meta data builder that is based on JSR-181 annotations
@@ -60,7 +60,7 @@
  */
 public class JAXWSProviderMetaDataBuilder extends JAXWSServerMetaDataBuilder
 {
-   public ServerEndpointMetaData buildProviderMetaData(Deployment dep, UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException
+   public ServerEndpointMetaData buildProviderMetaData(ArchiveDeployment dep, UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException
    {
       // 5.3 Conformance (Provider implementation): A Provider based service endpoint implementation MUST
       // implement a typed Provider interface.
@@ -121,7 +121,7 @@
       String wsdlLocation = anWebServiceProvider.wsdlLocation();
       if (wsdlLocation.length() > 0)
       {
-         URL wsdlURL = udi.getMetaDataFileURL(wsdlLocation);
+         URL wsdlURL = dep.getMetaDataFileURL(wsdlLocation);
          serviceMetaData.setWsdlLocation(wsdlURL);
       }
 

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -30,6 +30,7 @@
 import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
 import org.jboss.ws.metadata.umdm.UnifiedMetaData;
 import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
@@ -42,7 +43,7 @@
  */
 public abstract class JAXWSServerMetaDataBuilder extends JAXWSMetaDataBuilder
 {
-   static void setupProviderOrWebService(Deployment dep, UnifiedMetaData umd, UnifiedDeploymentInfo udi, Class<?> beanClass, String beanName) throws Exception
+   static void setupProviderOrWebService(ArchiveDeployment dep, UnifiedMetaData umd, UnifiedDeploymentInfo udi, Class<?> beanClass, String beanName) throws Exception
    {
       if (beanClass.isAnnotationPresent(WebService.class))
       {

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -58,6 +58,7 @@
 import org.jboss.ws.tools.wsdl.WSDLWriter;
 import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
 import org.jboss.wsf.common.IOUtils;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
@@ -275,8 +276,8 @@
       }
    }
 
-   private EndpointResult processWebService(Deployment dep, UnifiedMetaData wsMetaData, Class<?> sepClass, UnifiedDeploymentInfo udi) throws ClassNotFoundException,
-         IOException
+   private EndpointResult processWebService(Deployment dep, UnifiedMetaData wsMetaData, Class<?> sepClass, UnifiedDeploymentInfo udi)
+         throws ClassNotFoundException, IOException
    {
       WebService anWebService = sepClass.getAnnotation(WebService.class);
       if (anWebService == null)
@@ -342,9 +343,11 @@
       result.serviceMetaData = new ServiceMetaData(wsMetaData, new QName(serviceNS, serviceName));
       result.sepMetaData = new ServerEndpointMetaData(result.serviceMetaData, portQName, portTypeQName, EndpointMetaData.Type.JAXWS);
       result.epClass = (seiClass != null ? seiClass : sepClass);
-      result.wsdlLocation = udi.getMetaDataFileURL(wsdlLocation);
       result.serviceMetaData.addEndpoint(result.sepMetaData);
       wsMetaData.addService(result.serviceMetaData);
+      
+      if (dep instanceof ArchiveDeployment)
+         result.wsdlLocation = ((ArchiveDeployment)dep).getMetaDataFileURL(wsdlLocation);
 
       return result;
    }

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java	2007-07-26 10:00:45 UTC (rev 3998)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java	2007-07-26 11:33:20 UTC (rev 3999)
@@ -1,43 +1,44 @@
 /*
-* 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.ws.tools.jaxws.impl;
 
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URL;
+import java.net.URLClassLoader;
+
 import org.jboss.ws.WSException;
 import org.jboss.ws.integration.ResourceLoaderAdapter;
 import org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder;
 import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
 import org.jboss.wsf.spi.tools.WSContractProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.SPIProvider;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-
 /**
  * The default WSContractProvider implementation.
  * 
@@ -52,17 +53,17 @@
    private File resourceDir = null;
    private File sourceDir = null;
    private PrintStream messageStream = new NullPrintStream();
-   
+
    private void createDirectories(File resourceDir, File sourceDir)
    {
       if (!outputDir.exists())
          if (!outputDir.mkdirs())
             throw new WSException("Could not create directory: " + outputDir);
-      
+
       if (generateWsdl && !resourceDir.exists())
          if (!resourceDir.mkdirs())
             throw new WSException("Could not create directory: " + resourceDir);
-      
+
       if (generateSource && !sourceDir.exists())
          if (!sourceDir.mkdirs())
             throw new WSException("Could not create directory: " + sourceDir);
@@ -70,15 +71,7 @@
 
    private UnifiedDeploymentInfo createUDI(Class<?> endpointClass, ClassLoader loader)
    {
-      //DeploymentType type = (endpointClass.isAnnotationPresent(Stateless.class)) ? JAXWS_EJB3 : JAXWS_JSE;
-      UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo()
-      {
-         @Override
-         public URL getMetaDataFileURL(String resourcePath) throws IOException
-         {
-            return null;
-         }
-      };
+      UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo();
       return udi;
    }
 
@@ -88,33 +81,34 @@
       // Use the output directory as the default
       File resourceDir = (this.resourceDir != null) ? this.resourceDir : outputDir;
       File sourceDir = (this.sourceDir != null) ? this.sourceDir : outputDir;
-      
+
       createDirectories(resourceDir, sourceDir);
-      
+
       // Create a dummy classloader to catch generated classes
       ClassLoader loader = new URLClassLoader(new URL[0], this.loader);
       UnifiedMetaData umd = new UnifiedMetaData(new ResourceLoaderAdapter(loader));
       umd.setClassLoader(loader);
-      
+
       ChainedWritableWrapperGenerator generator = new ChainedWritableWrapperGenerator();
       if (generateSource)
          generator.add(new SourceWrapperGenerator(loader, messageStream), sourceDir);
       generator.add(new BytecodeWrapperGenerator(loader, messageStream), outputDir);
-      
+
       JAXWSWebServiceMetaDataBuilder builder = new JAXWSWebServiceMetaDataBuilder();
       builder.setWrapperGenerator(generator);
       builder.setGenerateWsdl(generateWsdl);
       builder.setToolMode(true);
       builder.setWsdlDirectory(resourceDir);
       builder.setMessageStream(messageStream);
-      
+
       if (generateWsdl)
          messageStream.println("Generating WSDL:");
 
       UnifiedDeploymentInfo udi = createUDI(endpointClass, loader);
 
       SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-      Deployment dep = spiProvider.getSPI(DeploymentModelFactory.class).createDeployment(loader);
+      DeploymentModelFactory factory = spiProvider.getSPI(DeploymentModelFactory.class);
+      Deployment dep = factory.createDeployment("wsprovide-deployment", loader);
 
       builder.buildWebServiceMetaData(dep, umd, udi, endpointClass, null);
       try
@@ -163,7 +157,7 @@
    {
       this.generateSource = generateSource;
    }
-   
+
    @Override
    public void setResourceDirectory(File directory)
    {




More information about the jbossws-commits mailing list