1 7 8 package com.sun.corba.se.spi.orbutil.proxy ; 9 10 import java.io.Serializable ; 11 12 import java.util.Map ; 13 import java.util.LinkedHashMap ; 14 15 import java.lang.reflect.Proxy ; 16 import java.lang.reflect.Method ; 17 import java.lang.reflect.InvocationHandler ; 18 import java.lang.reflect.InvocationTargetException ; 19 import com.sun.corba.se.impl.presentation.rmi.DynamicAccessPermission ; 20 21 public abstract class DelegateInvocationHandlerImpl 22 { 23 private DelegateInvocationHandlerImpl() {} 24 25 public static InvocationHandler create( final Object delegate ) 26 { 27 SecurityManager s = System.getSecurityManager(); 28 if (s != null) { 29 s.checkPermission(new DynamicAccessPermission("access")); 30 } 31 32 return new InvocationHandler () { 33 public Object invoke( Object proxy, Method method, Object [] args ) 34 throws Throwable 35 { 36 try { 39 return method.invoke( delegate, args ) ; 40 } catch (InvocationTargetException ite) { 41 throw ite.getCause() ; 44 } 45 } 46 } ; 47 } 48 } 49 | Popular Tags |