Author: dkulp Date: Fri Nov 16 01:49:57 2012 New Revision: 1410151 URL: http://svn.apache.org/viewvc?rev=1410151&view=rev Log: Merged revisions 1410146 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
........ r1410146 | dkulp | 2012-11-15 20:47:52 -0500 (Thu, 15 Nov 2012) | 11 lines Merged revisions 1410141 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1410141 | dkulp | 2012-11-15 20:36:13 -0500 (Thu, 15 Nov 2012) | 3 lines Workaround an issue with the IBM7 JDK that causes the proxy to be garbage collected while an invocation is still in progress. ........ ........ Modified: cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java Modified: cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=1410151&r1=1410150&r2=1410151&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original) +++ cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Fri Nov 16 01:49:57 2012 @@ -104,6 +104,12 @@ public class ClientImpl protected Executor executor; + // This is mostly to hold onto the client proxy that is using this ClientImpl so + // the IBM JDK's aggressive garbage collector doesn't gc the ClientProxy while + // an invocation is being made + private Object clientProxy; + + public ClientImpl(Bus b, Endpoint e) { this(b, e, (ConduitSelector)null); } @@ -193,6 +199,12 @@ public class ClientImpl } notifyLifecycleManager(); } + public void setProxyObject(Object cp) { + clientProxy = cp; + } + public Object getProxyObject() { + return clientProxy; + } public Bus getBus() { return bus; Modified: cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java?rev=1410151&r1=1410150&r2=1410151&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java (original) +++ cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java Fri Nov 16 01:49:57 2012 @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.apache.cxf.common.i18n.Message; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.endpoint.Client; +import org.apache.cxf.endpoint.ClientImpl; import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.service.model.BindingOperationInfo; @@ -45,6 +46,9 @@ public class ClientProxy implements Invo public ClientProxy(Client c) { endpoint = c.getEndpoint(); client = c; + if (c instanceof ClientImpl) { + ((ClientImpl)c).setProxyObject(this); + } } public void close() throws IOException { if (client != null) { @@ -119,4 +123,5 @@ public class ClientProxy implements Invo public static Client getClient(Object o) { return ((ClientProxy)Proxy.getInvocationHandler(o)).getClient(); } + }
