Mercurial > hg > truffle
diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/logging/LoggingProxy.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/LoggingProxy.java Fri Apr 08 13:47:56 2011 +0200 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/logging/LoggingProxy.java Mon Apr 11 10:37:24 2011 +0200 @@ -22,6 +22,8 @@ import java.lang.reflect.*; +import com.sun.hotspot.c1x.server.*; + /** * A java.lang.reflect proxy that hierarchically logs all method invocations along with their parameters and return values. * @@ -64,8 +66,12 @@ return result; } + /** + * The object returned by this method will implement all interfaces that are implemented by delegate. + */ public static <T> T getProxy(Class<T> interf, T delegate) { - Object obj = Proxy.newProxyInstance(interf.getClassLoader(), new Class[] {interf}, new LoggingProxy<T>(delegate)); + Class<?>[] interfaces = ReplacingStreams.getAllInterfaces(delegate.getClass()); + Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new LoggingProxy<T>(delegate)); return interf.cast(obj); } }