[jbossws-commits] JBossWS SVN: r4276 - in container: jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50 and 1 other directory.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Aug 9 04:34:58 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-08-09 04:34:58 -0400 (Thu, 09 Aug 2007)
New Revision: 4276

Added:
   container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/DeployerHookPostJSE.java
Removed:
   container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/Phase2DeployerHookJSE.java
Modified:
   container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookPostJSE.java
   container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookPostJSE.java
   container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/AbstractWebServiceDeployer.java
   container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/DeployerHookPostJSE.java
   container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookPreJSE.java
Log:
Fix Post JSE handling

Copied: container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/DeployerHookPostJSE.java (from rev 4243, container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/Phase2DeployerHookJSE.java)
===================================================================
--- container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/DeployerHookPostJSE.java	                        (rev 0)
+++ container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/DeployerHookPostJSE.java	2007-08-09 08:34:58 UTC (rev 4276)
@@ -0,0 +1,61 @@
+/*
+ * 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.jboss42;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.wsf.spi.deployment.Deployment;
+
+/**
+ * @author Heiko.Braun at jboss.com
+ * @version $Revision$
+ */
+public abstract class DeployerHookPostJSE extends AbstractDeployerHookJSE
+{
+   /**
+    * The deployment should be created in phase 1.
+    */
+   @Override
+   public Deployment createDeployment(DeploymentInfo di)
+   {
+      Deployment deployment = (Deployment)di.context.get(Deployment.class);
+      if (null == deployment)
+         throw new IllegalArgumentException("spi.Deployment missing. Should be created in Phase 1");
+
+      return deployment;
+   }
+
+   /**
+    * A phase 2 deployer hook needs to reject first-place
+    * JSE deployments and wait for those that are re-written.
+    * We rely on the fact that spi.Deployment is created in phase 1.    
+    */
+   @Override
+   public boolean isWebServiceDeployment(DeploymentInfo di)
+   {
+      if (super.isWebServiceDeployment(di) == false)
+         return false;
+
+      Deployment deployment = (Deployment)di.context.get(Deployment.class);
+      return deployment != null;
+   }
+
+}

Modified: container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookPostJSE.java
===================================================================
--- container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookPostJSE.java	2007-08-09 08:32:39 UTC (rev 4275)
+++ container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/JAXRPCDeployerHookPostJSE.java	2007-08-09 08:34:58 UTC (rev 4276)
@@ -31,7 +31,7 @@
  * @author Thomas.Diesler at jboss.org
  * @since 25-Apr-2007
  */
-public class JAXRPCDeployerHookPostJSE extends Phase2DeployerHookJSE
+public class JAXRPCDeployerHookPostJSE extends DeployerHookPostJSE
 {
    /** Get the deployment type this deployer can handle
     */

Modified: container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookPostJSE.java
===================================================================
--- container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookPostJSE.java	2007-08-09 08:32:39 UTC (rev 4275)
+++ container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/JAXWSDeployerHookPostJSE.java	2007-08-09 08:34:58 UTC (rev 4276)
@@ -31,7 +31,7 @@
  * @author Heiko.Braun at jboss.com
  * @version $Revision$
  */
-public class JAXWSDeployerHookPostJSE extends Phase2DeployerHookJSE
+public class JAXWSDeployerHookPostJSE extends DeployerHookPostJSE
 {
    /** Get the deployment type this deployer can handle
     */

Deleted: container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/Phase2DeployerHookJSE.java
===================================================================
--- container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/Phase2DeployerHookJSE.java	2007-08-09 08:32:39 UTC (rev 4275)
+++ container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/Phase2DeployerHookJSE.java	2007-08-09 08:34:58 UTC (rev 4276)
@@ -1,64 +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.wsf.container.jboss42;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.wsf.spi.deployment.Deployment;
-
-/**
- * @author Heiko.Braun at jboss.com
- * @version $Revision$
- */
-public abstract class Phase2DeployerHookJSE extends AbstractDeployerHookJSE
-{
-   /**
-    * The deployment should be created in phase 1.
-    */
-   /**
-    * Create an endpoint for every servlet-link in webservices.xml
-    */
-   @Override
-   public Deployment createDeployment(DeploymentInfo di)
-   {
-      Deployment deployment = (Deployment)di.context.get(Deployment.class);
-      if(null == deployment)
-         throw new IllegalArgumentException("spi.Deployment missing. Should be created in Phase 1");
-      
-      return deployment;
-   }
-
-   /**
-    * A phase 2 deployer hook needs to reject first-place
-    * JSE deployments and wait for those that are re-written.
-    * We rely on the fact that spi.Deployment is created in phase 1.    
-    */
-   @Override
-   public boolean isWebServiceDeployment(DeploymentInfo di)
-   {
-      if(super.isWebServiceDeployment(di) == false)
-         return false;
-
-      Deployment deployment = (Deployment)di.context.get(Deployment.class);
-      return deployment!=null;
-   }
-  
-}

Modified: container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/AbstractWebServiceDeployer.java
===================================================================
--- container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/AbstractWebServiceDeployer.java	2007-08-09 08:32:39 UTC (rev 4275)
+++ container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/AbstractWebServiceDeployer.java	2007-08-09 08:34:58 UTC (rev 4276)
@@ -21,17 +21,16 @@
  */
 package org.jboss.wsf.container.jboss50;
 
+// $Id$
+
+import java.util.LinkedList;
+import java.util.List;
+
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.logging.Logger;
 
-import java.util.LinkedList;
-import java.util.List;
-
-//$Id$
-
 /**
  * This deployer that calls the registered DeployerHooks
  * 
@@ -44,7 +43,7 @@
    private static final Logger log = Logger.getLogger(AbstractWebServiceDeployer.class);
 
    private List<DeployerHook> deployerHooks = new LinkedList<DeployerHook>();
-   
+
    public void addDeployerHook(DeployerHook deployer)
    {
       log.debug("Add deployer hook: " + deployer);

Modified: container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/DeployerHookPostJSE.java
===================================================================
--- container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/DeployerHookPostJSE.java	2007-08-09 08:32:39 UTC (rev 4275)
+++ container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/DeployerHookPostJSE.java	2007-08-09 08:34:58 UTC (rev 4276)
@@ -23,18 +23,12 @@
 
 // $Id$
 
-import java.util.Iterator;
-
 import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.metadata.NameValuePair;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.web.Servlet;
 import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
 
 /**
  * @author Heiko.Braun at jboss.com
- * @version $Revision$
+ * @author Thomas.Diesler at jboss.com
  */
 public abstract class DeployerHookPostJSE extends AbstractDeployerHookJSE
 {
@@ -53,9 +47,7 @@
    /**
     * A phase 2 deployer hook needs to reject first-place
     * JSE deployments and wait for those that are re-written.
-    * We do it by inspecting the Servlet init parameter.
-    * @param unit
-    * @return
+    * We rely on the fact that spi.Deployment is created in phase 1.    
     */
    @Override
    public boolean isWebServiceDeployment(DeploymentUnit unit)
@@ -64,46 +56,6 @@
          return false;
 
       Deployment deployment = unit.getAttachment(Deployment.class);
-      boolean isModified = false;
-      if (deployment != null)
-         isModified = isModifiedServletClass(deployment);
-      return isModified;
+      return deployment != null;
    }
-
-   private boolean isModifiedServletClass(Deployment dep)
-   {
-      boolean modified = false;
-
-      WebMetaData webMetaData = dep.getAttachment(WebMetaData.class);
-      if (webMetaData != null)
-      {
-         for (Servlet servlet : webMetaData.getServlets())
-         {
-            String orgServletClass = servlet.getServletClass();
-
-            // JSP
-            if (orgServletClass == null || orgServletClass.length() == 0)
-            {
-               log.debug("Innore servlet class: " + orgServletClass);
-               continue;
-            }
-
-            modified = isAlreadyModified(servlet);
-         }
-      }
-
-      return modified;
-   }
-
-   private boolean isAlreadyModified(Servlet servlet)
-   {
-      Iterator itParams = servlet.getInitParams().iterator();
-      while (itParams.hasNext())
-      {
-         NameValuePair pair = (NameValuePair)itParams.next();
-         if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(pair.getName()))
-            return true;
-      }
-      return false;
-   }
 }

Modified: container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookPreJSE.java
===================================================================
--- container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookPreJSE.java	2007-08-09 08:32:39 UTC (rev 4275)
+++ container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookPreJSE.java	2007-08-09 08:34:58 UTC (rev 4276)
@@ -59,7 +59,7 @@
    {
       ArchiveDeployment dep = newDeployment(unit);
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
-      dep.setRuntimeClassLoader(null); // TODO: Create RuntimeLoader aspect
+      dep.setRuntimeClassLoader(null); 
       dep.setType(getDeploymentType());
 
       Service service = dep.getService();




More information about the jbossws-commits mailing list