cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1559994 - in /cxf/branches/2.6.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
Date Tue, 21 Jan 2014 12:04:38 GMT
Author: ningjiang
Date: Tue Jan 21 12:04:37 2014
New Revision: 1559994

URL: http://svn.apache.org/r1559994
Log:
Merged revisions 1559989 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

CXF-5505 SpringBus should shutdown the bus when the application context is closed 

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
    cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1559989

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

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java?rev=1559994&r1=1559993&r2=1559994&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
Tue Jan 21 12:04:37 2014
@@ -23,7 +23,6 @@ import java.util.List;
 
 import org.apache.cxf.bus.BusState;
 import org.apache.cxf.bus.extension.ExtensionManagerBus;
-import org.apache.cxf.buslifecycle.BusLifeCycleManager;
 import org.apache.cxf.configuration.ConfiguredBeanLocator;
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.configuration.spring.ConfigurerImpl;
@@ -126,8 +125,10 @@ public class SpringBus extends Extension
                 if (getState() != BusState.RUNNING) {
                     initialize();
                 }
-            } else if (event instanceof ContextClosedEvent) {
-                getExtension(BusLifeCycleManager.class).postShutdown();
+            } else if (event instanceof ContextClosedEvent && getState() == BusState.RUNNING)
{
+                // The bus could be create by using SpringBusFactory.createBus("/cxf.xml");

+                // Just to make sure the shutdown is called rightly 
+                shutdown(); 
             }
         }
     }

Modified: cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java?rev=1559994&r1=1559993&r2=1559994&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
Tue Jan 21 12:04:37 2014
@@ -96,6 +96,14 @@ public class SpringBusFactoryTest extend
         Bus bus = new SpringBusFactory().createBus(cfgFile, true);
         checkCustomerConfiguration(bus);
     }
+
+    @Test 
+    public void testCustomerBusShutdown() { 
+        String cfgFile = "org/apache/cxf/bus/spring/customerBus.xml"; 
+        Bus bus = new SpringBusFactory().createBus(cfgFile, true); 
+        // We have three bus here, which should be closed rightly 
+        bus.shutdown(true); 
+    } 
     
     @Test
     public void testCustomFileURLFromSystemProperty() {



Mime
View raw message