[jbossws-commits] JBossWS SVN: r4017 - trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Jul 27 02:12:20 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-07-27 02:12:20 -0400 (Fri, 27 Jul 2007)
New Revision: 4017

Modified:
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServletExt.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/RequestHandlerImpl.java
Log:
Use ServletContext attribute instead of Endpoint attachment

Modified: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServletExt.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServletExt.java	2007-07-27 06:00:11 UTC (rev 4016)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServletExt.java	2007-07-27 06:12:20 UTC (rev 4017)
@@ -29,6 +29,7 @@
 
 import javax.management.ObjectName;
 import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -75,9 +76,12 @@
       // Init the Endpoint
       SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
       epRegistry = spiProvider.getSPI(EndpointRegistryFactory.class).createEndpointRegistry();
-      String contextPath = servletConfig.getServletContext().getContextPath();
+      
+      ServletContext context = servletConfig.getServletContext();
+      String contextPath = context.getContextPath();
       endpoint = initServiceEndpoint(contextPath);
-      endpoint.addAttachment(ServletController.class, getController());
+      
+      context.setAttribute(ServletController.class.getName(), getController());
    }
 
    public ServletController createServletController()

Modified: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/RequestHandlerImpl.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/RequestHandlerImpl.java	2007-07-27 06:00:11 UTC (rev 4016)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/RequestHandlerImpl.java	2007-07-27 06:12:20 UTC (rev 4017)
@@ -56,7 +56,7 @@
 
    public void handleHttpRequest(Endpoint ep, HttpServletRequest req, HttpServletResponse res, ServletContext context) throws ServletException, IOException
    {
-      ServletController controller = ep.getAttachment(ServletController.class);
+      ServletController controller = (ServletController)context.getAttribute(ServletController.class.getName());
       if (controller == null)
          throw new IllegalStateException("Cannot obtain servlet controller");
 




More information about the jbossws-commits mailing list