comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java @ 5529:d487ae06265d

Move graal.hotspot.server into its own project.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 08 Jun 2012 20:17:14 +0200
parents e808627bd16f
children 5e3d1a68664e
comparison
equal deleted inserted replaced
5528:751b6ab65d54 5529:d487ae06265d
24 24
25 import java.lang.reflect.*; 25 import java.lang.reflect.*;
26 import java.util.*; 26 import java.util.*;
27 import java.util.concurrent.*; 27 import java.util.concurrent.*;
28 import java.util.concurrent.atomic.*; 28 import java.util.concurrent.atomic.*;
29
30 import com.oracle.graal.hotspot.server.*;
31 29
32 /** 30 /**
33 * A java.lang.reflect proxy that hierarchically logs all method invocations along with their parameters and return 31 * A java.lang.reflect proxy that hierarchically logs all method invocations along with their parameters and return
34 * values. 32 * values.
35 */ 33 */
71 } 69 }
72 return result; 70 return result;
73 } 71 }
74 72
75 public static <T> T getProxy(Class<T> interf, T delegate) { 73 public static <T> T getProxy(Class<T> interf, T delegate) {
76 Class<?>[] interfaces = ReplacingStreams.getAllInterfaces(delegate.getClass()); 74 Class<?>[] interfaces = ProxyUtil.getAllInterfaces(delegate.getClass());
77 Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new CountingProxy<>(delegate)); 75 Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new CountingProxy<>(delegate));
78 return interf.cast(obj); 76 return interf.cast(obj);
79 } 77 }
80 78
81 private static ArrayList<CountingProxy> proxies = new ArrayList<>(); 79 private static ArrayList<CountingProxy> proxies = new ArrayList<>();