1 45 package org.openejb.client.proxy; 46 47 import java.io.Serializable ; 48 import java.lang.reflect.Method ; 49 50 60 public class Jdk13InvocationHandler implements java.lang.reflect.InvocationHandler , Serializable { 61 62 65 private InvocationHandler delegate; 66 67 71 public Jdk13InvocationHandler() { 72 } 73 74 81 public Jdk13InvocationHandler(InvocationHandler delegate) { 82 setInvocationHandler(delegate); 83 } 84 85 90 public InvocationHandler getInvocationHandler() { 91 return delegate; 92 } 93 94 100 public InvocationHandler setInvocationHandler(InvocationHandler handler) { 101 InvocationHandler old = delegate; 102 delegate = handler; 103 return old; 104 } 105 106 116 public Object invoke(Object proxy, Method method, Object [] args) throws Throwable { 117 118 if ( delegate == null ) throw new NullPointerException ("No invocation handler for proxy "+proxy); 119 120 if(args == null) { 121 args = new Object [0]; 122 } 124 125 return delegate.invoke(proxy, method, args); 126 } 127 } 128 129 | Popular Tags |