[jboss-cvs] JBossAS SVN: r66108 - in trunk: testsuite and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Oct 13 08:07:46 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-10-13 08:07:46 -0400 (Sat, 13 Oct 2007)
New Revision: 66108

Added:
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebApp50GeneratorDeploymentAspect.java
Modified:
   trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java
   trunk/testsuite/build.xml
   trunk/webservices/.classpath
   trunk/webservices/build.xml
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/JSEArchiveMetaDataAdapter.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeploymentAspect.java
   trunk/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
Log:
jbossws integration fixes for new MDM

Modified: trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java	2007-10-13 06:51:46 UTC (rev 66107)
+++ trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java	2007-10-13 12:07:46 UTC (rev 66108)
@@ -25,7 +25,9 @@
 
 import javax.management.ObjectName;
 
+import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.helpers.AttachmentLocator;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
 import org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer;
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
@@ -115,4 +117,25 @@
          unit.addAttachment(LoaderRepositoryConfig.class, loaderConfig);
       }      
    }
+
+   /**
+    * Make sure we always have a JBossWebMetaData object attached, even if there is no jboss-web.xml
+    * in the deployment
+    */
+   @Override
+   protected void createMetaData(DeploymentUnit unit, String name, String suffix, String key) throws DeploymentException
+   {
+      super.createMetaData(unit, name, suffix, key);
+      
+      WebMetaData wmd = unit.getTransientManagedObjects().getAttachment(WebMetaData.class);
+      JBossWebMetaData result = unit.getTransientManagedObjects().getAttachment(getOutput());
+      if (result == null && wmd != null)
+      {
+         result = new JBossWebMetaData();
+         result.setOverridenMetaData(wmd);
+      }
+      
+      // Register it
+      unit.getTransientManagedObjects().addAttachment(key, result, getOutput());
+   }
 }

Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml	2007-10-13 06:51:46 UTC (rev 66107)
+++ trunk/testsuite/build.xml	2007-10-13 12:07:46 UTC (rev 66108)
@@ -88,12 +88,6 @@
    &libraries;
    &testsuite-libraries;
 
-   <!-- define jbossws classpath explicitly because jbossws/lib contains other integration layers as well -->
-   <path id="jbossws.integration.classpath">
-     <pathelement path="${jboss.jbossws.lib}/jbossws-jboss42-integration.jar"/>
-     <pathelement path="${jboss.jbossws.lib}/jbossws-client.jar"/>
-   </path>
-
    <!-- The combined library classpath -->
    <path id="library.classpath">
       <path refid="apache.avalon.classpath"/>
@@ -132,7 +126,6 @@
       <path refid="jboss.remoting.classpath"/>
       <path refid="jboss.serialization.classpath"/>
       <path refid="jboss.jbossws.classpath"/>
-      <path refid="jbossws.integration.classpath"/>
       <path refid="jboss.jbossxb.classpath"/>
       <path refid="jboss.metadata.classpath"/>
       <path refid="jboss.integration.classpath"/>

Modified: trunk/webservices/.classpath
===================================================================
--- trunk/webservices/.classpath	2007-10-13 06:51:46 UTC (rev 66107)
+++ trunk/webservices/.classpath	2007-10-13 12:07:46 UTC (rev 66108)
@@ -37,5 +37,6 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/jbosssx/lib/jbosssx.jar" sourcepath="/thirdparty/jboss/jbosssx/lib/jbosssx-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/metadata/lib/jboss-metadata.jar" sourcepath="/thirdparty/jboss/metadata/lib/jboss-metadata-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/sun-jaxb/lib/jaxb-api.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/jbossws-framework/lib/jbossws-framework.jar" sourcepath="/thirdparty/jboss/jbossws-framework/lib/jbossws-framework-src.zip"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: trunk/webservices/build.xml
===================================================================
--- trunk/webservices/build.xml	2007-10-13 06:51:46 UTC (rev 66107)
+++ trunk/webservices/build.xml	2007-10-13 12:07:46 UTC (rev 66108)
@@ -78,6 +78,7 @@
       <path refid="jboss.jbosssx.classpath"/>
       <path refid="jboss.jbossws.classpath"/>
       <path refid="jboss.jbossws.common.classpath"/>
+      <path refid="jboss.jbossws.framework.classpath"/>
       <path refid="jboss.jbossws.spi.classpath"/>
       <path refid="jboss.jbossxb.classpath"/>
       <path refid="jboss.microcontainer.classpath"/>

Modified: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/JSEArchiveMetaDataAdapter.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/JSEArchiveMetaDataAdapter.java	2007-10-13 06:51:46 UTC (rev 66107)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/JSEArchiveMetaDataAdapter.java	2007-10-13 12:07:46 UTC (rev 66108)
@@ -35,6 +35,7 @@
 import org.jboss.metadata.web.spec.ServletMappingsMetaData;
 import org.jboss.metadata.web.spec.ServletMetaData;
 import org.jboss.metadata.web.spec.ServletsMetaData;
+import org.jboss.metadata.web.spec.WebMetaData;
 import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
 import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
 import org.jboss.wsf.spi.deployment.Deployment;
@@ -57,8 +58,11 @@
    {
       String contextRoot = null;
       
-      JBossWebMetaData wmd = unit.getAttachment(JBossWebMetaData.class);
-      dep.addAttachment(JBossWebMetaData.class, wmd);
+      WebMetaData wmd = unit.getAttachment(WebMetaData.class);
+      dep.addAttachment(WebMetaData.class, wmd);
+      
+      JBossWebMetaData jbwmd = unit.getAttachment(JBossWebMetaData.class);
+      dep.addAttachment(JBossWebMetaData.class, jbwmd);
 
       if (unit.getParent() != null)
       {
@@ -75,17 +79,17 @@
       }
       
       if (contextRoot == null)
-         contextRoot = wmd.getContextRoot();
+         contextRoot = jbwmd.getContextRoot();
       
       JSEArchiveMetaData umd = new JSEArchiveMetaData();
       umd.setContextRoot(contextRoot);
-      umd.setServletMappings(getServletMappings(wmd));
-      umd.setServletClassNames(getServletClassMap(wmd));
-      umd.setConfigName(wmd.getConfigName());
-      umd.setConfigFile(wmd.getConfigFile());
-      umd.setSecurityDomain(wmd.getSecurityDomain());
-      umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
-      umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
+      umd.setServletMappings(getServletMappings(jbwmd));
+      umd.setServletClassNames(getServletClassMap(jbwmd));
+      umd.setConfigName(jbwmd.getConfigName());
+      umd.setConfigFile(jbwmd.getConfigFile());
+      umd.setSecurityDomain(jbwmd.getSecurityDomain());
+      umd.setPublishLocationAdapter(getPublishLocationAdpater(jbwmd));
+      umd.setSecurityMetaData(getSecurityMetaData(jbwmd.getSecurityContraints()));
 
       return umd;
    }
@@ -109,25 +113,26 @@
    protected List<JSESecurityMetaData> getSecurityMetaData(final List<SecurityConstraintMetaData> securityConstraints)
    {
       ArrayList<JSESecurityMetaData> unifiedsecurityMetaData = new ArrayList<JSESecurityMetaData>();
-
-      for (SecurityConstraintMetaData securityMetaData : securityConstraints)
+      if (securityConstraints != null)
       {
-         JSESecurityMetaData current = new JSESecurityMetaData();
-         unifiedsecurityMetaData.add(current);
+         for (SecurityConstraintMetaData securityMetaData : securityConstraints)
+         {
+            JSESecurityMetaData current = new JSESecurityMetaData();
+            unifiedsecurityMetaData.add(current);
 
-         current.setTransportGuarantee(securityMetaData.getTransportGuarantee().name());
+            current.setTransportGuarantee(securityMetaData.getTransportGuarantee().name());
 
-         WebResourceCollectionsMetaData resources = securityMetaData.getResourceCollections();
-         for (WebResourceCollectionMetaData webResource : resources)
-         {
-            JSEResourceCollection currentResource = current.addWebResource(webResource.getName());
-            for (String currentPattern : webResource.getUrlPatterns())
+            WebResourceCollectionsMetaData resources = securityMetaData.getResourceCollections();
+            for (WebResourceCollectionMetaData webResource : resources)
             {
-               currentResource.addPattern(currentPattern);
+               JSEResourceCollection currentResource = current.addWebResource(webResource.getName());
+               for (String currentPattern : webResource.getUrlPatterns())
+               {
+                  currentResource.addPattern(currentPattern);
+               }
             }
          }
       }
-
       return unifiedsecurityMetaData;
    }
 

Modified: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeploymentAspect.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeploymentAspect.java	2007-10-13 06:51:46 UTC (rev 66107)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeploymentAspect.java	2007-10-13 12:07:46 UTC (rev 66108)
@@ -23,6 +23,8 @@
 
 //$Id: ModifyWebMetaDataDeployer.java 3150 2007-05-20 00:29:48Z thomas.diesler at jboss.com $
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 import org.jboss.metadata.javaee.spec.ParamValueMetaData;
@@ -74,7 +76,7 @@
             // JSP
             if (orgServletClass == null || orgServletClass.length() == 0)
             {
-               log.debug("Innore servlet class: " + orgServletClass);
+               log.debug("Ignore servlet class: " + orgServletClass);
                continue;
             }
 
@@ -85,7 +87,13 @@
                ParamValueMetaData initParam = new ParamValueMetaData();
                initParam.setParamName(Endpoint.SEPID_DOMAIN_ENDPOINT);
                initParam.setParamValue(orgServletClass);
-               servlet.getInitParam().add(initParam);
+               List<ParamValueMetaData> initParams = servlet.getInitParam();
+               if (initParams == null)
+               {
+                  initParams = new ArrayList<ParamValueMetaData>();
+                  servlet.setInitParam(initParams);
+               }
+               initParams.add(initParam);
             }
          }
       }
@@ -102,17 +110,23 @@
       }
    }
 
-   private void modifyContextParams(Deployment dep, Map<String, String> contextParams)
+   private void modifyContextParams(Deployment dep, Map<String, String> newParams)
    {
       WebMetaData webMetaData = dep.getAttachment(WebMetaData.class);
       if (webMetaData != null)
       {
-         for (Map.Entry<String, String> entry : contextParams.entrySet())
+         for (Map.Entry<String, String> entry : newParams.entrySet())
          {
             ParamValueMetaData ctxParam = new ParamValueMetaData();
             ctxParam.setParamName(entry.getKey());
             ctxParam.setParamValue(entry.getValue());
-            webMetaData.getContextParams().add(ctxParam);
+            List<ParamValueMetaData> contextParams = webMetaData.getContextParams();
+            if (contextParams == null)
+            {
+               contextParams = new ArrayList<ParamValueMetaData>();
+               webMetaData.setContextParams(contextParams);
+            }
+            contextParams.add(ctxParam);
          }
       }
    }
@@ -141,10 +155,14 @@
 
    private boolean isAlreadyModified(ServletMetaData servlet)
    {
-      for (ParamValueMetaData param : servlet.getInitParam())
+      List<ParamValueMetaData> initParams = servlet.getInitParam();
+      if (initParams != null)
       {
-         if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(param.getParamName()))
-            return true;
+         for (ParamValueMetaData param : initParams)
+         {
+            if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(param.getParamName()))
+               return true;
+         }
       }
       return false;
    }

Added: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebApp50GeneratorDeploymentAspect.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebApp50GeneratorDeploymentAspect.java	                        (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebApp50GeneratorDeploymentAspect.java	2007-10-13 12:07:46 UTC (rev 66108)
@@ -0,0 +1,54 @@
+/*
+ * 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.wsf.container.jboss50;
+
+// $Id: WebAppDeployerDeployer.java 3772 2007-07-01 19:29:13Z thomas.diesler at jboss.com $
+
+import org.dom4j.Document;
+import org.jboss.wsf.framework.deployment.WebAppGeneratorDeploymentAspect;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.SecurityHandler;
+
+/**
+ * Add doctype declarations to the generated descriptors 
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 13-Oct-2007
+ */
+public class WebApp50GeneratorDeploymentAspect extends WebAppGeneratorDeploymentAspect
+{
+   @Override
+   protected Document createWebAppDescriptor(Deployment dep, SecurityHandler securityHandler)
+   {
+      Document document = super.createWebAppDescriptor(dep, securityHandler);
+      document.addDocType("web-app", "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", "http://java.sun.com/dtd/web-app_2_3.dtd");
+      return document;
+   }
+
+   @Override
+   protected Document createJBossWebAppDescriptor(Deployment dep, SecurityHandler securityHandler)
+   {
+      Document document = super.createJBossWebAppDescriptor(dep, securityHandler);
+      document.addDocType("jboss-web", "-//JBoss//DTD Web Application 5.0//EN", "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd");
+      return document;
+   }
+}

Modified: trunk/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
--- trunk/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml	2007-10-13 06:51:46 UTC (rev 66107)
+++ trunk/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml	2007-10-13 12:07:46 UTC (rev 66108)
@@ -260,7 +260,7 @@
     <property name="mainDeployer"><inject bean="MainDeployer"/></property>
   </bean>
   
-  <bean name="WSWebAppGeneratorDeploymentAspect" class="org.jboss.wsf.framework.deployment.WebAppGeneratorDeploymentAspect">
+  <bean name="WSWebAppGeneratorDeploymentAspect" class="org.jboss.wsf.container.jboss50.WebApp50GeneratorDeploymentAspect">
     <property name="requires">URLPattern</property>
     <property name="provides">WebMetaData</property>
     <property name="securityHandlerEJB21"><inject bean="WSSecurityHandlerEJB21"/></property>




More information about the jboss-cvs-commits mailing list