Lines Matching refs:Proxy
19 import java.lang.reflect.Proxy;
32 public Object invoke(Object proxy, Method method, Object[] args) {
33 // Force garbage collection to try to make `proxy` move in memory
37 System.out.println("Proxy for " + TestInterface.class + "." + method.getName());
39 testMethod0(proxy, args);
41 testMethod1(proxy, args);
43 testMethod10(proxy, args);
45 testMethod10Even(proxy, args);
50 private void testMethod0(Object proxy, Object[] args) {
51 // Get argument 0 (method target) from the proxy method frame ($Proxy0.method0 activation).
54 Main.assertEquals(proxy, arg0);
57 private void testMethod1(Object proxy, Object[] args) {
58 // Get argument 0 (method target) from the proxy method frame ($Proxy0.method0 activation).
61 Main.assertEquals(proxy, arg0);
62 // Get argument 1 from the proxy method frame ($Proxy0.method1 activation).
68 private void testMethod10(Object proxy, Object[] args) {
69 // Get argument 0 (method target) from the proxy method frame ($Proxy0.method10 activation).
72 Main.assertEquals(proxy, arg0);
73 // Get argument `i` from the proxy method frame ($Proxy0.method10 activation).
82 private void testMethod10Even(Object proxy, Object[] args) {
83 // Get argument 0 (method target) from the proxy method frame ($Proxy0.method10Even
87 Main.assertEquals(proxy, arg0);
88 // Get argument `i` from the proxy method frame ($Proxy0.method10Even activation).
97 // Get reference argument at position `arg_pos` in proxy frame.
101 // Find proxy frame in stack (from a testMethod* method).
109 // 4 java.lang.reflect.Proxy.invoke
110 // -> 5 TestInterface.method* (proxy method)
126 TestInterface proxy = (TestInterface) Proxy.newProxyInstance(
130 System.out.println("proxy: " + proxy.getClass().getName());
132 proxy.method0();
133 proxy.method1("a");
134 proxy.method10("one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten");
135 proxy.method10Even((byte) 1, "two", (short) 3, "four", 5, "six", 7L, "eight", 9.0, "ten");