You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2022/05/10 17:38:28 UTC

[cxf] branch 3.5.x-fixes updated (758b1bf33c -> 680bd3cb34)

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a change to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


    from 758b1bf33c Fixing post-cherrypick build issues (related to CXF-8699)
     new ad1235af81 [CXF-8702] If the Spring application context is creating the bus and has the shutdown method already wired, don't call shutdown when the application context is closed as that may interfere with other close events.
     new 680bd3cb34 Recording .gitmergeinfo Changes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                               |  4 ++++
 core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java | 13 ++++++++++++-
 core/src/main/resources/META-INF/cxf/cxf.xml                |  4 +++-
 3 files changed, 19 insertions(+), 2 deletions(-)


[cxf] 02/02: Recording .gitmergeinfo Changes

Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 680bd3cb3477202730bfdd7f98157b02e53f7936
Author: Daniel Kulp <da...@kulp.com>
AuthorDate: Tue May 10 13:38:19 2022 -0400

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index f3559e9f98..c4b0e780c7 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -1,12 +1,16 @@
 origin/master
 
+B 00bbab65e59b8f27366335aec19e50129b7759f0
 B 3457c8555d1ecb49cf13e29a60f7ab01ec5f2ff4
+B 79ee9824ee30b1b710d7385efc3cec736b4a5c54
 B 7f683ba748e2133af0f93f1d77df5921b4e86011
 B 8f7c9dae610cd708b5e17828b58b642a5485b9cc
 B 9723e32190d3a820e0eecf19177561155399c867
 B a6501f782cd2b392f09edb4ccb99a83acd2e75a2
 B b176e8e4a5a6bb6097c4e399ee0fa843f81e4b32
 B b740e0a7f606d9e5acb8c27dfb3a671708bb19db
+B ba839e6b1f3ee5c26fd600834ea10227dd4cc317
+B cad4f0b76bb79f82a5ef4bc7e435e93996eb884b
 B cfca13411eb72d2d07ca243e24ced6e9743e6124
 B d77fd3ac9eb11bd69e5d534dffe53296e4c00ae8
 M 11502cd9e0f85ded3ae83b3df7226d2e107159ab


[cxf] 01/02: [CXF-8702] If the Spring application context is creating the bus and has the shutdown method already wired, don't call shutdown when the application context is closed as that may interfere with other close events.

Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit ad1235af81d74fe0e9d68922d167b540965cc369
Author: Daniel Kulp <da...@kulp.com>
AuthorDate: Tue May 10 12:18:36 2022 -0400

    [CXF-8702] If the Spring application context is creating the bus and has the shutdown method already wired, don't call shutdown when the application context is closed as that may interfere with other close events.
    
    (cherry picked from commit 2b3ec63eb1c71f9dc58cff5e6244a2dfa356340e)
---
 core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java | 13 ++++++++++++-
 core/src/main/resources/META-INF/cxf/cxf.xml                |  4 +++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java b/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
index 6616c8ed85..0c625e4fc6 100644
--- a/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
+++ b/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
@@ -40,9 +40,18 @@ public class SpringBus extends ExtensionManagerBus
 
     AbstractApplicationContext ctx;
     boolean closeContext;
+    boolean contextLifecycleManaged;
 
     public SpringBus() {
     }
+    
+    public SpringBus(boolean ctxManaged) {
+        // if this Bus is created via the cxf.xml, then the spring context has the "shutdown" method
+        // already configured as a destroy method.  Thus, we should NOT call destroy
+        // when the context is closed as Spring will do so the rest of the dependencies
+        // and such are ready to be destroyed.
+        contextLifecycleManaged = ctxManaged;
+    }
 
     public void setBusConfig(BusDefinitionParser.BusConfig bc) {
         bc.setBus(this);
@@ -102,7 +111,9 @@ public class SpringBus extends ExtensionManagerBus
                 if (getState() != BusState.RUNNING) {
                     initialize();
                 }
-            } else if (event instanceof ContextClosedEvent && getState() == BusState.RUNNING) {
+            } else if (event instanceof ContextClosedEvent
+                && getState() == BusState.RUNNING
+                && (!contextLifecycleManaged || ctx instanceof BusApplicationContext)) {
                 // The bus could be create by using SpringBusFactory.createBus("/cxf.xml");
                 // Just to make sure the shutdown is called rightly
                 shutdown();
diff --git a/core/src/main/resources/META-INF/cxf/cxf.xml b/core/src/main/resources/META-INF/cxf/cxf.xml
index fb5949cd38..ed01df8b24 100644
--- a/core/src/main/resources/META-INF/cxf/cxf.xml
+++ b/core/src/main/resources/META-INF/cxf/cxf.xml
@@ -26,7 +26,9 @@
                 <bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"/>
                 <context:annotation-config/>
         -->
-    <bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus" destroy-method="shutdown"/>
+    <bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus" destroy-method="shutdown">
+    	<constructor-arg type="boolean" value="true" />
+    </bean>
     <bean id="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor" class="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor"/>
     <bean id="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor" class="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor"/>
     <bean id="org.apache.cxf.bus.spring.BusExtensionPostProcessor" class="org.apache.cxf.bus.spring.BusExtensionPostProcessor"/>