diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/logging/CountingProxy.java @ 2288:8c426c2891c8

client/server: new interface Remote marks classes that should not be serialized, but called remotely
author Lukas Stadler <lukas.stadler@jku.at>
date Mon, 11 Apr 2011 10:37:24 +0200
parents 9e5e83ca2259
children
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/logging/CountingProxy.java	Fri Apr 08 13:47:56 2011 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/logging/CountingProxy.java	Mon Apr 11 10:37:24 2011 +0200
@@ -23,6 +23,8 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.sun.hotspot.c1x.server.*;
+
 /**
  * A java.lang.reflect proxy that hierarchically logs all method invocations along with their parameters and return
  * values.
@@ -66,7 +68,8 @@
     }
 
     public static <T> T getProxy(Class<T> interf, T delegate) {
-        Object obj = Proxy.newProxyInstance(interf.getClassLoader(), new Class[] {interf}, new CountingProxy<T>(delegate));
+        Class<?>[] interfaces = ReplacingStreams.getAllInterfaces(delegate.getClass());
+        Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new CountingProxy<T>(delegate));
         return interf.cast(obj);
     }