cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1170877 - in /cxf/branches/2.4.x-fixes: ./ rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
Date Wed, 14 Sep 2011 22:45:25 GMT
Author: dkulp
Date: Wed Sep 14 22:45:24 2011
New Revision: 1170877

URL: http://svn.apache.org/viewvc?rev=1170877&view=rev
Log:
Merged revisions 1170869 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1170869 | dkulp | 2011-09-14 18:20:47 -0400 (Wed, 14 Sep 2011) | 1 line
  
  [CXF-3803] Make sure bus.shutdown is called at servlet shutdown time
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
    cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java?rev=1170877&r1=1170876&r2=1170877&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
Wed Sep 14 22:45:24 2011
@@ -128,5 +128,10 @@ public class CXFNonSpringServlet extends
             }
         }
         destinationRegistry = null;
+        destroyBus();
+    }
+    
+    public void destroyBus() {
+        bus.shutdown(true);
     }
 }

Modified: cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java?rev=1170877&r1=1170876&r2=1170877&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
Wed Sep 14 22:45:24 2011
@@ -31,7 +31,9 @@ import org.springframework.web.context.s
 import org.springframework.web.context.support.XmlWebApplicationContext;
 
 public class CXFServlet extends CXFNonSpringServlet {
-
+    private boolean busCreated;
+    private XmlWebApplicationContext createdContext; 
+    
     public CXFServlet() {
     }
 
@@ -57,6 +59,7 @@ public class CXFServlet extends CXFNonSp
         if (wac != null) {
             setBus(wac.getBean("cxf", Bus.class));
         } else {
+            busCreated = true;
             setBus(BusFactory.newInstance().createBus());
         }
     }
@@ -75,6 +78,7 @@ public class CXFServlet extends CXFNonSp
                                                    ServletConfig sc,
                                                    String location) {
         XmlWebApplicationContext ctx2 = new XmlWebApplicationContext();
+        createdContext = ctx2;
         ctx2.setServletConfig(sc);
 
         Resource r = ctx2.getResource(location);
@@ -109,10 +113,20 @@ public class CXFServlet extends CXFNonSp
             }
         } else {
             ctx2.setConfigLocations(new String[] {"classpath:/META-INF/cxf/cxf.xml",
-                                                  location});            
+                                                  location});
+            createdContext = ctx2;
         }
         ctx2.refresh();
         return ctx2;
     }
+    public void destroyBus() {
+        if (busCreated) {
+            //if we created the Bus, we need to destroy it.  Otherwise, spring will handleit.
+            getBus().shutdown(true);
+        }
+        if (createdContext != null) {
+            createdContext.close();
+        }
+    }
 
 }



Mime
View raw message