1 16 17 package org.springframework.ejb.access; 18 19 import javax.naming.NamingException ; 20 21 import org.springframework.aop.framework.ProxyFactory; 22 import org.springframework.beans.factory.BeanClassLoaderAware; 23 import org.springframework.beans.factory.FactoryBean; 24 import org.springframework.util.ClassUtils; 25 26 59 public class SimpleRemoteStatelessSessionProxyFactoryBean extends SimpleRemoteSlsbInvokerInterceptor 60 implements FactoryBean, BeanClassLoaderAware { 61 62 63 private Class businessInterface; 64 65 private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); 66 67 68 private Object proxy; 69 70 71 81 public void setBusinessInterface(Class businessInterface) { 82 this.businessInterface = businessInterface; 83 } 84 85 88 public Class getBusinessInterface() { 89 return this.businessInterface; 90 } 91 92 public void setBeanClassLoader(ClassLoader classLoader) { 93 this.beanClassLoader = classLoader; 94 } 95 96 public void afterPropertiesSet() throws NamingException { 97 super.afterPropertiesSet(); 98 if (this.businessInterface == null) { 99 throw new IllegalArgumentException ("businessInterface is required"); 100 } 101 this.proxy = new ProxyFactory(this.businessInterface, this).getProxy(this.beanClassLoader); 102 } 103 104 105 public Object getObject() { 106 return this.proxy; 107 } 108 109 public Class getObjectType() { 110 return this.businessInterface; 111 } 112 113 public boolean isSingleton() { 114 return true; 115 } 116 117 } 118 | Popular Tags |