Lines Matching refs:Proxy
23 import java.lang.reflect.Proxy;
33 Object proxy = createProxy(proxyMe);
35 if (!Proxy.isProxyClass(proxy.getClass()))
36 System.out.println("not a proxy class?");
37 if (Proxy.getInvocationHandler(proxy) == null)
38 System.out.println("ERROR: Proxy.getInvocationHandler is null");
41 Shapes shapes = (Shapes) proxy;
45 Quads quads = (Quads) proxy;
48 Colors colors = (Colors) proxy;
53 Trace trace = (Trace) proxy;
56 // Test the proxy spec: These Object functions are supposed to be given to the handler.
75 * Exercise annotations on Proxy classes. This is mostly to ensure
79 Method[] methods = proxy.getClass().getDeclaredMethods();
81 System.out.println("Proxy interfaces: " +
82 Arrays.deepToString(proxy.getClass().getInterfaces()));
83 System.out.println("Proxy methods: " +
97 /* create the proxy class */
98 Class<?> proxyClass = Proxy.getProxyClass(Shapes.class.getClassLoader(),
102 /* create a proxy object, passing the handler object in */
103 Object proxy = null;
107 proxy = cons.newInstance(handler);
118 return proxy;
223 * Invocation handler, defining the implementation of the proxy functions.
233 * This is called when anything gets invoked in the proxy object.
235 public Object invoke(Object proxy, Method method, Object[] args)