Dead
[official-gcc.git] / gomp-20050608-branch / libjava / testsuite / libjava.lang / TestProxy.java
blobea2e1f04a93ee9f8fcd622261d56ae0170fdd75a
1 import java.lang.reflect.*;
2 import java.net.*;
4 public class TestProxy
6 public static 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 ();