1 15 16 package com.jdon.bussinessproxy.remote; 17 18 import java.lang.reflect.InvocationHandler ; 19 import java.lang.reflect.Method ; 20 21 import com.jdon.bussinessproxy.TargetMetaDef; 22 import com.jdon.bussinessproxy.remote.auth.Authenticator; 23 import com.jdon.bussinessproxy.remote.http.HttpClient; 24 import com.jdon.util.Debug; 25 26 public class RemoteInvocationHandler implements InvocationHandler { 27 28 private final static String module = RemoteInvocationHandler.class.getName(); 29 private final static HttpClient httpClient = HttpClient.getInstance(); 30 31 private TargetMetaDef targetMetaDef = null; 32 33 public RemoteInvocationHandler(TargetMetaDef targetMetaDef) { 34 this.targetMetaDef = targetMetaDef; 35 } 36 37 public Object invoke(Object p_proxy, Method method, Object [] args) throws 38 Throwable { 39 Debug.logVerbose("[JdonFramework]method:" + method.getName(), module); 40 41 if (method.getName().equals(Authenticator.AUTH_METHOD_NAME)) 42 return httpClient.invokeAuth(args); 43 else 44 return httpClient.invoke(targetMetaDef, method, args); 45 } 46 47 48 49 } 50 | Popular Tags |