[jbossws-commits] JBossWS SVN: r3903 - in branches/tdiesler/trunk: integration/native/src/main/java/org/jboss/wsf/stack/jbws and 3 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Jul 17 03:12:11 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-07-17 03:12:11 -0400 (Tue, 17 Jul 2007)
New Revision: 3903

Removed:
   branches/tdiesler/trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointContextListener.java
Modified:
   branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java
   branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
   branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
   branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
   branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
   branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeploymentAspect.java
   branches/tdiesler/trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointServlet.java
   branches/tdiesler/trunk/integration/native/src/main/resources/jbossws-native-config.xml
   branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java
   branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifierImpl.java
   branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
Log:
partial

Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/DeploymentInfoAdapter.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -88,7 +88,7 @@
          // Since we create temporary classes, we need to create a delegate loader
          // This prevents CCE problems where the parent loader is available at deploy time,
          // and a child loader is available at start time.
-         udi.classLoader = new URLClassLoader(new URL[] {}, unit.getInitialClassLoader());
+         udi.classLoader = new URLClassLoader(new URL[] {}, unit.getClassLoader());
 
          log.debug("UnifiedDeploymentInfo:\n" + udi);
       }

Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookEJB21.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -55,7 +55,8 @@
    {
       Deployment dep = createDeployment();
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
-      dep.setClassLoader(unit.getClassLoader());
+      dep.setInitialClassLoader(unit.getClassLoader());
+      dep.setRuntimeClassLoader(unit.getClassLoader());
       dep.setType(getDeploymentType());
 
       Service service = dep.getService();

Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXRPCDeployerHookJSE.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -59,6 +59,7 @@
       Deployment dep = createDeployment();
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
       dep.setInitialClassLoader(unit.getClassLoader());
+      dep.setRuntimeClassLoader(null);
       dep.setType(getDeploymentType());
 
       Service service = dep.getService();

Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookEJB3.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -58,7 +58,8 @@
    {
       Deployment dep = createDeployment();
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
-      dep.setInitialClassLoader(unit.getInitialClassLoader());
+      dep.setInitialClassLoader(unit.getClassLoader());
+      dep.setRuntimeClassLoader(unit.getClassLoader());
       dep.setType(getDeploymentType());
 
       Service service = dep.getService();

Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/JAXWSDeployerHookJSE.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -58,7 +58,8 @@
    {
       Deployment dep = createDeployment();
       dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
-      dep.setInitialClassLoader(unit.getInitialClassLoader());
+      dep.setInitialClassLoader(unit.getClassLoader());
+      dep.setRuntimeClassLoader(null);
       dep.setType(getDeploymentType());
 
       Service service = dep.getService();
@@ -70,7 +71,7 @@
       // Copy the attachments
       dep.getContext().addAttachment(WebMetaData.class, webMetaData);
 
-      List<Servlet> servlets = getRelevantServlets(webMetaData, unit.getInitialClassLoader());
+      List<Servlet> servlets = getRelevantServlets(webMetaData, unit.getClassLoader());
       for (Servlet servlet : servlets)
       {
          String servletName = servlet.getName();
@@ -98,7 +99,7 @@
       try
       {
          WebMetaData webMetaData = unit.getAttachment(WebMetaData.class);
-         List<Servlet> servlets = getRelevantServlets(webMetaData, unit.getInitialClassLoader());
+         List<Servlet> servlets = getRelevantServlets(webMetaData, unit.getClassLoader());
          isWebServiceDeployment = servlets.size() > 0;
       }
       catch (Exception ex)

Modified: branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeploymentAspect.java
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeploymentAspect.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ModifyWebMetaDataDeploymentAspect.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -35,6 +35,7 @@
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.DeploymentAspect;
 import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.WebAppDesciptorModifier;
 
 /**
  * A deployer that modifies the web.xml meta data 
@@ -47,19 +48,19 @@
    @Override
    public void create(Deployment dep)
    {
-      String propKey = "ServletClass";
+      String propKey = WebAppDesciptorModifier.SERVLET_CLASS;
       String servletClass = (String)dep.getContext().getProperty(propKey);
       if (servletClass == null)
          throw new IllegalStateException("Cannot obtain context property: " + propKey);
 
       modifyServletClass(dep, servletClass);
 
-      propKey = "ServletContextListener";
+      propKey = WebAppDesciptorModifier.SERVLET_CONTEXT_LISTENER;
       String listenerClass = (String)dep.getContext().getProperty(propKey);
       if (listenerClass != null)
          modifyListener(dep, listenerClass);
       
-      propKey = "ContextParameterMap";
+      propKey = WebAppDesciptorModifier.CONTEXT_PARAMETER_MAP;
       Map<String, String> contextParams = (Map<String, String>)dep.getContext().getProperty(propKey);
       if (contextParams != null)
          modifyContextParams(dep, contextParams);

Deleted: branches/tdiesler/trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointContextListener.java
===================================================================
--- branches/tdiesler/trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointContextListener.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointContextListener.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.jbws;
-
-// $Id: ServiceEndpointServlet.java 3395 2007-06-02 20:38:33Z thomas.diesler at jboss.com $
-
-import javax.management.ObjectName;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-
-/**
- * A listener that initializes the UnifiedMetaDataModel
- *
- * @author Thomas.Diesler at jboss.org
- * @since 25-Apr-2007
- */
-public class ServiceEndpointContextListener implements ServletContextListener
-{
-   public void contextInitialized(ServletContextEvent event)
-   {
-      EndpointRegistry epRegistry = EndpointRegistryFactory.getEndpointRegistry();
-      ServletContext ctx = event.getServletContext();
-      String contextPath = ctx.getContextPath();
-
-      for (ObjectName sepId : epRegistry.getEndpoints())
-      {
-         String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
-         if (contextPath.equals("/" + propContext))
-         {
-            Endpoint ep = epRegistry.getEndpoint(sepId);
-            Deployment dep = ep.getService().getDeployment();
-
-            if (dep.getType() == DeploymentType.JAXRPC_JSE || dep.getType() == DeploymentType.JAXWS_JSE)
-            {
-               // For JSE endpoints, this should be the tomcat classloader
-               ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-               dep.setRuntimeClassLoader(classLoader);
-
-               UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
-               if (umd.isEagerInitialized() == false)
-               {
-                  umd.setClassLoader(classLoader);
-                  umd.eagerInitialize();
-               }
-
-               // start the endpoint
-               if (ep.getState() == EndpointState.CREATED)
-                  ep.getLifecycleHandler().start(ep);
-            }
-         }
-      }
-   }
-
-   public void contextDestroyed(ServletContextEvent event)
-   {
-      EndpointRegistry epRegistry = EndpointRegistryFactory.getEndpointRegistry();
-      ServletContext ctx = event.getServletContext();
-      String contextPath = ctx.getContextPath();
-
-      for (ObjectName sepId : epRegistry.getEndpoints())
-      {
-         String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
-         if (contextPath.equals(propContext))
-         {
-            Endpoint ep = epRegistry.getEndpoint(sepId);
-            Deployment dep = ep.getService().getDeployment();
-
-            if (dep.getType() == DeploymentType.JAXRPC_JSE || dep.getType() == DeploymentType.JAXWS_JSE)
-            {
-               if (ep.getState() == EndpointState.STARTED)
-                  ep.getLifecycleHandler().stop(ep);
-            }
-         }
-      }
-   }
-}

Modified: branches/tdiesler/trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointServlet.java
===================================================================
--- branches/tdiesler/trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointServlet.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointServlet.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -27,7 +27,10 @@
 
 import org.jboss.logging.Logger;
 import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
 import org.jboss.wsf.spi.invocation.EndpointServlet;
 
 /**
@@ -61,5 +64,25 @@
          log.debug("Updating service endpoint config\n  config-name: " + configName + "\n  config-file: " + configFile);
          epMetaData.setConfigName(configName, configFile);
       }
+      
+      Deployment dep = endpoint.getService().getDeployment();
+      if (dep.getType() == DeploymentType.JAXRPC_JSE || dep.getType() == DeploymentType.JAXWS_JSE)
+      {
+         // For JSE endpoints, this should be the tomcat classloader
+         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+         dep.setRuntimeClassLoader(classLoader);
+
+         // Initialize the meta data model
+         UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
+         if (umd.isEagerInitialized() == false)
+         {
+            umd.setClassLoader(classLoader);
+            umd.eagerInitialize();
+         }
+
+         // Start the endpoint
+         if (endpoint.getState() == EndpointState.CREATED)
+            endpoint.getLifecycleHandler().start(endpoint);
+      }
    }
 }

Modified: branches/tdiesler/trunk/integration/native/src/main/resources/jbossws-native-config.xml
===================================================================
--- branches/tdiesler/trunk/integration/native/src/main/resources/jbossws-native-config.xml	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/native/src/main/resources/jbossws-native-config.xml	2007-07-17 07:12:11 UTC (rev 3903)
@@ -52,7 +52,6 @@
     <property name="contextProperties">
       <map keyClass="java.lang.String" valueClass="java.lang.String">
         <entry><key>ServletClass</key><value>org.jboss.wsf.stack.jbws.ServiceEndpointServlet</value></entry>
-        <entry><key>ServletContextListener</key><value>org.jboss.wsf.stack.jbws.ServiceEndpointContextListener</value></entry>
       </map>
     </property>
   </bean>

Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifier.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -35,8 +35,12 @@
  */
 public interface WebAppDesciptorModifier
 {
+   final String SERVLET_CONTEXT_LISTENER = "ServletContextListener";
+   final String CONTEXT_PARAMETER_MAP = "ContextParameterMap";
+   final String SERVLET_CLASS = "ServletClass";
+   
    // The results of the URL rewriting
-   public class RewriteResults
+   class RewriteResults
    {
       // The URL to the rewrittn web.xml
       public URL webXML;

Modified: branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifierImpl.java
===================================================================
--- branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifierImpl.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/WebAppDesciptorModifierImpl.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -44,12 +44,12 @@
       RewriteResults results = new RewriteResults();
       Element root = webXml.getRootElement();
       
-      String propKey = "ServletClass";
+      String propKey = SERVLET_CLASS;
       String servletClass = (String)dep.getContext().getProperty(propKey);
       if (servletClass == null)
          throw new IllegalStateException("Cannot obtain context property: " + propKey);
       
-      propKey = "ContextParameterMap";
+      propKey = CONTEXT_PARAMETER_MAP;
       Map<String, String> contextParams = (Map<String, String>)dep.getContext().getProperty(propKey);
       if (contextParams != null)
       {
@@ -61,7 +61,7 @@
          }
       }
       
-      propKey = "ServletContextListener";
+      propKey = SERVLET_CONTEXT_LISTENER;
       String listenerClass = (String)dep.getContext().getProperty(propKey);
       if (listenerClass != null)
       {

Modified: branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
===================================================================
--- branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java	2007-07-16 22:20:11 UTC (rev 3902)
+++ branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java	2007-07-17 07:12:11 UTC (rev 3903)
@@ -181,12 +181,11 @@
     * allows for concurrent read-only access to a <code>UnifiedMetaData</code>
     * instance. This method, however, must be called from a single thread.
     */
-   public void eagerInitialize()
+   public synchronized void eagerInitialize()
    {
       if (eagerInitialized == false)
       {
-         if (log.isDebugEnabled())
-            log.debug("Eagerly initialize the meta data model");
+         log.debug("Eagerly initialize the meta data model");
          for (ServiceMetaData service : services)
          {
             service.eagerInitialize();




More information about the jbossws-commits mailing list