1 22 package org.jboss.security.srp; 23 24 import java.io.Serializable ; 25 import java.lang.reflect.InvocationHandler ; 26 import java.lang.reflect.InvocationTargetException ; 27 import java.lang.reflect.Method ; 28 29 import org.jboss.security.srp.SRPServerInterface; 30 31 39 public class SRPServerProxy implements InvocationHandler , Serializable 40 { 41 42 private static final long serialVersionUID = 5255628656806648070L; 43 44 private SRPServerInterface server; 45 46 49 SRPServerProxy(SRPServerInterface server) 50 { 51 this.server = server; 52 } 53 54 57 public Object invoke(Object proxy, Method method, Object [] args) throws Throwable 58 { 59 Object ret = null; 60 try 61 { 62 ret = method.invoke(server, args); 63 } 64 catch (InvocationTargetException e) 65 { 66 throw e.getTargetException(); 67 } 68 catch (Throwable e) 69 { 70 e.printStackTrace(); 71 throw e; 72 } 73 return ret; 74 } 75 } 76 | Popular Tags |