You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2013/07/29 08:59:05 UTC

[1/3] git commit: CAMEL-6585 cxfEndpoint should shutdown the bus if the bus is created by itself.

Updated Branches:
  refs/heads/camel-2.10.x 427c84a7b -> 3d85a1920
  refs/heads/camel-2.11.x 51369fbc5 -> 5949857eb
  refs/heads/master 0d0902001 -> 9ad9245ce


CAMEL-6585 cxfEndpoint should shutdown the bus if the bus is created by itself.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9ad9245c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9ad9245c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9ad9245c

Branch: refs/heads/master
Commit: 9ad9245ce7bf0fc08f9c68c842e7fd01fa031107
Parents: 0d09020
Author: Willem Jiang <ni...@apache.org>
Authored: Mon Jul 29 14:47:21 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Mon Jul 29 14:47:21 2013 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/cxf/CxfEndpoint.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9ad9245c/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index 156aec3..cc3e48f 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -111,6 +111,7 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
     private static final Logger LOG = LoggerFactory.getLogger(CxfEndpoint.class);
 
     protected Bus bus;
+    private boolean createBus;
 
     private String wsdlURL;
     private Class<?> serviceClass;
@@ -766,11 +767,13 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
 
     public void setBus(Bus bus) {
         this.bus = bus;
+        this.createBus = false;
     }
 
     public Bus getBus() {
         if (bus == null) {
             bus = CxfEndpointUtils.createBus(getCamelContext());
+            this.createBus = true;
             LOG.debug("Using DefaultBus {}", bus);
         }
 
@@ -870,7 +873,13 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
 
     @Override
     protected void doStop() throws Exception {
-        // noop
+        // we should consider to shutdown the bus if the bus is created by cxfEndpoint
+        if (createBus && bus != null) {
+            LOG.info("shutdown the bus ... " + bus);
+            getBus().shutdown(false);
+            // clean up the bus to create a new one if the endpoint is started again
+            bus = null;
+        }
     }
 
     public void setAddress(String address) {


[3/3] git commit: CAMEL-6585 cxfEndpoint should shutdown the bus if the bus is created by itself.

Posted by ni...@apache.org.
CAMEL-6585 cxfEndpoint should shutdown the bus if the bus is created by itself.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3d85a192
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3d85a192
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3d85a192

Branch: refs/heads/camel-2.10.x
Commit: 3d85a19205f85d39a08ec280d88fcdb630f43529
Parents: 427c84a
Author: Willem Jiang <ni...@apache.org>
Authored: Mon Jul 29 14:47:21 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Mon Jul 29 14:58:04 2013 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/cxf/CxfEndpoint.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3d85a192/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index 6d8379b..2a328f9 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -108,6 +108,7 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
     private static final Logger LOG = LoggerFactory.getLogger(CxfEndpoint.class);
 
     protected Bus bus;
+    private boolean createBus;
 
     private String wsdlURL;
     private Class<?> serviceClass;
@@ -732,11 +733,13 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
 
     public void setBus(Bus bus) {
         this.bus = bus;
+        this.createBus = false;
     }
 
     public Bus getBus() {
         if (bus == null) {
             bus = CxfEndpointUtils.createBus(getCamelContext());
+            this.createBus = true;
             LOG.debug("Using DefaultBus {}", bus);
         }
 
@@ -836,7 +839,13 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
 
     @Override
     protected void doStop() throws Exception {
-        // noop
+        // we should consider to shutdown the bus if the bus is created by cxfEndpoint
+        if (createBus && bus != null) {
+            LOG.info("shutdown the bus ... " + bus);
+            getBus().shutdown(false);
+            // clean up the bus to create a new one if the endpoint is started again
+            bus = null;
+        }
     }
 
     public void setAddress(String address) {


[2/3] git commit: CAMEL-6585 cxfEndpoint should shutdown the bus if the bus is created by itself.

Posted by ni...@apache.org.
CAMEL-6585 cxfEndpoint should shutdown the bus if the bus is created by itself.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5949857e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5949857e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5949857e

Branch: refs/heads/camel-2.11.x
Commit: 5949857eb2b2026807070e5d11176803124fdf59
Parents: 51369fb
Author: Willem Jiang <ni...@apache.org>
Authored: Mon Jul 29 14:47:21 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Mon Jul 29 14:54:18 2013 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/cxf/CxfEndpoint.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5949857e/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index f193295..6105269 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -110,6 +110,7 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
     private static final Logger LOG = LoggerFactory.getLogger(CxfEndpoint.class);
 
     protected Bus bus;
+    private boolean createBus;
 
     private String wsdlURL;
     private Class<?> serviceClass;
@@ -765,11 +766,13 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
 
     public void setBus(Bus bus) {
         this.bus = bus;
+        this.createBus = false;
     }
 
     public Bus getBus() {
         if (bus == null) {
             bus = CxfEndpointUtils.createBus(getCamelContext());
+            this.createBus = true;
             LOG.debug("Using DefaultBus {}", bus);
         }
 
@@ -869,7 +872,13 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
 
     @Override
     protected void doStop() throws Exception {
-        // noop
+        // we should consider to shutdown the bus if the bus is created by cxfEndpoint
+        if (createBus && bus != null) {
+            LOG.info("shutdown the bus ... " + bus);
+            getBus().shutdown(false);
+            // clean up the bus to create a new one if the endpoint is started again
+            bus = null;
+        }
     }
 
     public void setAddress(String address) {