cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [15/15] cxf git commit: [CXF-6091] Fix problems stoping servers that are using the MultiEndpointObserver Patch from Vadim Beilin applied
Date Fri, 07 Nov 2014 19:13:02 GMT
[CXF-6091] Fix problems stoping servers that are using the MultiEndpointObserver
Patch from Vadim Beilin applied


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

Branch: refs/heads/3.0.x-fixes
Commit: f68f775a7b95a268e66ebbc832d1f8a30c9ac240
Parents: 2d246e7
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Nov 7 13:40:46 2014 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Nov 7 13:58:53 2014 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/endpoint/ServerImpl.java |  9 +++++----
 .../cxf/frontend/soap/SoapBindingSelectionTest.java       | 10 ++++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f68f775a/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java b/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java
index bb9d7fc..5180594 100644
--- a/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java
+++ b/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java
@@ -167,11 +167,12 @@ public class ServerImpl implements Server {
         MessageObserver mo = getDestination().getMessageObserver();
         if (mo instanceof MultipleEndpointObserver) {
             ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint);
-            if (!((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) {
-                return;
+            if (((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) {
+                getDestination().setMessageObserver(null);
             }
-        }
-        getDestination().setMessageObserver(null);
+        } else {
+            getDestination().setMessageObserver(null);
+        } 
         stopped = true;
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/f68f775a/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
b/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
index a25379b..13277e5 100644
--- a/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
+++ b/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/soap/SoapBindingSelectionTest.java
@@ -94,6 +94,16 @@ public class SoapBindingSelectionTest extends AbstractSimpleFrontendTest
{
         
         assertFalse(service1Invoked);
         assertTrue(service2Invoked);
+        
+        server2.stop();
+        server2.start();
+        
+        nd = invoke("http://localhost/Hello", LocalTransportFactory.TRANSPORT_ID, "soap12.xml");
+        assertEquals("http://www.w3.org/2003/05/soap-envelope", getNs(nd));
+        
+        assertFalse(service1Invoked);
+        assertTrue(service2Invoked);
+        
     }
     
     private String getNs(Node nd) {


Mime
View raw message