1 53 package org.bsf.remoting.http; 54 55 56 import org.bsf.remoting.EJBDefinition; 57 58 import javax.ejb.EJBObject ; 59 import java.lang.reflect.InvocationHandler ; 60 import java.lang.reflect.Method ; 61 62 71 72 public class HttpServiceInvocationHandler implements InvocationHandler { 73 74 private Object _remote = null; 75 private EJBDefinition _service = null; 76 private HttpServiceKey _serviceKey = null; 77 78 private int _connectionMode; 79 80 83 public HttpServiceInvocationHandler(EJBDefinition p_service) { 84 _service = p_service; 85 } 86 87 90 public HttpServiceInvocationHandler(HttpServiceKey p_serviceKey) { 91 _serviceKey = p_serviceKey; 92 } 93 94 97 public Object invoke(Object p_proxy, Method p_method, Object [] p_args) throws Throwable { 98 Object result = null; 99 EJBObject ejbResult = null; 100 if (_serviceKey != null) { 101 return HttpSessionClient.getInstance().invoke(_serviceKey, p_method, p_args); 102 } else { 103 return HttpSessionClient.getInstance().invoke(_service, p_method, p_args); 104 } 105 } 106 } | Popular Tags |