2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / testsuite / libjava.lang / TestProxy.java
blobd1411a6f0a8921428b3d8adf719d27324fa99fe3
1 import java.lang.reflect.*;
2 import java.net.*;
4 public class TestProxy
6 public class MyInvocationHandler implements InvocationHandler
8 public Object invoke (Object proxy,
9 Method method,
10 Object[] args)
11 throws Throwable
13 System.out.println (args[0]);
14 return null;
18 public static void main (String[] args)
20 try {
21 InvocationHandler ih = new MyInvocationHandler();
23 SocketOptions c = (SocketOptions)
24 Proxy.newProxyInstance (SocketOptions.class.getClassLoader(),
25 new Class[]{SocketOptions.class},
26 ih);
28 c.getOption (555);
30 } catch (Exception e) {
31 e.printStackTrace ();