You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2008/08/06 12:42:47 UTC
svn commit: r683216 - in /cxf/branches/2.0.x-fixes:
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Author: ffang
Date: Wed Aug 6 03:42:46 2008
New Revision: 683216
URL: http://svn.apache.org/viewvc?rev=683216&view=rev
Log:
[CXF-1652]CXF Decoupled Endpoints are not getting cleaned up properly even after bus.Shutdown() in org.apache.cxf.systest.ws.rm.SequenceTest.
Modified:
cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Modified: cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=683216&r1=683215&r2=683216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Wed Aug 6 03:42:46 2008
@@ -921,6 +921,9 @@
if (--decoupledDestinationRefCount == 0) {
LOG.log(Level.INFO, "shutting down decoupled destination");
decoupledDestination.shutdown();
+
+ //this way we can release the port of decoupled destination
+ decoupledDestination.setMessageObserver(null);
}
}
Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=683216&r1=683215&r2=683216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java (original)
+++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java Wed Aug 6 03:42:46 2008
@@ -1255,7 +1255,7 @@
greeter.greetMeOneWay("neutrophil");
greeter.greetMeOneWay("basophil");
greeter.greetMeOneWay("eosinophil");
- stopGreeter();
+ stopGreeterButNotCloseConduit();
awaitMessages(6, 8);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages());
@@ -1355,7 +1355,11 @@
}
private void stopGreeter() {
- if (null != greeterBus) {
+ if (null != greeterBus) {
+
+ //ensure we close the decoupled destination of the conduit,
+ //so that release the port if the destination reference count hit zero
+ ClientProxy.getClient(greeter).getConduit().close();
greeterBus.shutdown(true);
greeter = null;
greeterBus = null;
@@ -1369,6 +1373,15 @@
}
}
+ private void stopGreeterButNotCloseConduit() {
+ if (null != greeterBus) {
+
+ greeterBus.shutdown(true);
+ greeter = null;
+ greeterBus = null;
+ }
+ }
+
private void awaitMessages(int nExpectedOut, int nExpectedIn) {
awaitMessages(nExpectedOut, nExpectedIn, 10000);
}