cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1410471 - in /cxf/branches/2.6.x-fixes: api/src/main/java/org/apache/cxf/endpoint/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/simple/src/main/java/org/apache/cxf/frontend/
Date Fri, 16 Nov 2012 17:00:34 GMT
Author: dkulp
Date: Fri Nov 16 17:00:33 2012
New Revision: 1410471

URL: http://svn.apache.org/viewvc?rev=1410471&view=rev
Log:
Merged revisions 1410439 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1410439 | dkulp | 2012-11-16 11:31:58 -0500 (Fri, 16 Nov 2012) | 3 lines

  Previous fix held onto the clientimpl much longer than needed
  (potentially forever). Make a different attempt.

........

Modified:
    cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
    cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java

Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=1410471&r1=1410470&r2=1410471&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Fri
Nov 16 17:00:33 2012
@@ -103,13 +103,6 @@ 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);
     }
@@ -200,12 +193,6 @@ 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.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java?rev=1410471&r1=1410470&r2=1410471&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
Fri Nov 16 17:00:33 2012
@@ -178,8 +178,7 @@ public class JaxWsClientProxy extends or
                 }
             }
         }
-        return result;
-
+        return adjustObject(result);
     }
     boolean isAsync(Method m) {
         return m.getName().endsWith("Async")

Modified: cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java?rev=1410471&r1=1410470&r2=1410471&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java
Fri Nov 16 17:00:33 2012
@@ -30,7 +30,6 @@ 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.invoker.MethodDispatcher;
@@ -47,9 +46,6 @@ 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) {
@@ -82,7 +78,14 @@ public class ClientProxy implements Invo
             params = new Object[0];
         }
 
-        return invokeSync(method, oi, params);
+        Object o = invokeSync(method, oi, params);
+        //call a virtual method passing the object.  This causes the IBM JDK
+        //to keep the "this" pointer references and thus "this" doesn't get 
+        //finalized in the midst of an invoke operation
+        return adjustObject(o); 
+    }
+    protected Object adjustObject(Object o) {
+        return o;
     }
 
     public Object invokeSync(Method method, BindingOperationInfo oi, Object[] params)



Mime
View raw message