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 15:39:13 UTC
svn commit: r683262 - in /cxf/trunk:
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 06:39:10 2008
New Revision: 683262
URL: http://svn.apache.org/viewvc?rev=683262&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/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=683262&r1=683261&r2=683262&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Wed Aug 6 06:39:10 2008
@@ -726,6 +726,7 @@
//
if (decoupledDestination != null) {
releaseDecoupledDestination();
+
}
}
@@ -924,6 +925,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/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=683262&r1=683261&r2=683262&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java Wed Aug 6 06:39:10 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);
}