1 23 24 33 34 package com.sun.enterprise.webservice; 35 36 import java.lang.reflect.InvocationHandler ; 37 import java.lang.reflect.Method ; 38 import java.security.AccessController ; 39 import java.security.PrivilegedExceptionAction ; 40 41 47 public class PortInvocationHandler implements InvocationHandler { 48 49 Object target; 50 51 52 public PortInvocationHandler() { 53 } 54 55 public void setTarget(Object target) { 56 this.target = target; 57 } 58 59 public Object invoke(Object proxy, final Method m, final Object [] args) { 60 try { 61 final Method toInvoke = target.getClass().getMethod(m.getName(), m.getParameterTypes()); 62 return AccessController.doPrivileged(new PrivilegedExceptionAction () { 63 public Object run() throws Exception { 64 return toInvoke.invoke(target, args); 65 } 66 }); 67 } catch(Exception e) { 68 throw new RuntimeException (e); 69 } 70 } 71 } 72 | Popular Tags |