1 22 package org.jboss.ejb3.service; 23 24 import java.lang.reflect.InvocationTargetException ; 25 import org.jboss.ejb3.JBossProxy; 26 import org.jboss.ejb3.ProxyFactoryHelper; 27 28 29 33 public class ServiceLocalProxyFactory extends BaseServiceProxyFactory 34 { 35 protected Class [] getInterfaces() 36 { 37 Class [] localInterfaces = ProxyFactoryHelper.getLocalInterfaces(container); 38 Class [] interfaces = new Class [localInterfaces.length + 1]; 39 System.arraycopy(localInterfaces, 0, interfaces, 0, localInterfaces.length); 40 interfaces[localInterfaces.length] = JBossProxy.class; 41 return interfaces; 42 } 43 44 protected void initializeJndiName() 45 { 46 jndiName = ProxyFactoryHelper.getLocalJndiName(container); 47 } 48 49 public Object createProxy() 50 { 51 try 52 { 53 Object [] args = {new ServiceLocalProxy(container)}; 54 return proxyConstructor.newInstance(args); 55 } 56 catch (InstantiationException e) 57 { 58 throw new RuntimeException (e); } 60 catch (IllegalAccessException e) 61 { 62 throw new RuntimeException (e); } 64 catch (IllegalArgumentException e) 65 { 66 throw new RuntimeException (e); } 68 catch (InvocationTargetException e) 69 { 70 throw new RuntimeException (e.getTargetException()); } 72 } 73 74 } 75 | Popular Tags |