aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.0/libjava/testsuite/libjava.lang/TestProxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.0/libjava/testsuite/libjava.lang/TestProxy.java')
-rw-r--r--gcc-4.4.0/libjava/testsuite/libjava.lang/TestProxy.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc-4.4.0/libjava/testsuite/libjava.lang/TestProxy.java b/gcc-4.4.0/libjava/testsuite/libjava.lang/TestProxy.java
new file mode 100644
index 000000000..08e16aa33
--- /dev/null
+++ b/gcc-4.4.0/libjava/testsuite/libjava.lang/TestProxy.java
@@ -0,0 +1,36 @@
+import java.lang.reflect.Proxy;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.net.*;
+
+public class TestProxy
+{
+ public static class MyInvocationHandler implements InvocationHandler
+ {
+ public Object invoke (Object proxy,
+ Method method,
+ Object[] args)
+ throws Throwable
+ {
+ System.out.println (args[0]);
+ return null;
+ }
+ }
+
+ public static void main (String[] args)
+ {
+ try {
+ InvocationHandler ih = new MyInvocationHandler();
+
+ SocketOptions c = (SocketOptions)
+ Proxy.newProxyInstance (SocketOptions.class.getClassLoader(),
+ new Class[]{SocketOptions.class},
+ ih);
+
+ c.getOption (555);
+
+ } catch (Exception e) {
+ e.printStackTrace ();
+ }
+ }
+}