1 16 17 package org.springframework.remoting.caucho; 18 19 import org.springframework.aop.framework.ProxyFactory; 20 import org.springframework.beans.factory.BeanClassLoaderAware; 21 import org.springframework.beans.factory.FactoryBean; 22 import org.springframework.util.ClassUtils; 23 24 45 public class HessianProxyFactoryBean extends HessianClientInterceptor 46 implements FactoryBean, BeanClassLoaderAware { 47 48 private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); 49 50 private Object serviceProxy; 51 52 53 public void setBeanClassLoader(ClassLoader classLoader) { 54 this.beanClassLoader = classLoader; 55 } 56 57 public void afterPropertiesSet() { 58 super.afterPropertiesSet(); 59 this.serviceProxy = new ProxyFactory(getServiceInterface(), this).getProxy(this.beanClassLoader); 60 } 61 62 63 public Object getObject() { 64 return this.serviceProxy; 65 } 66 67 public Class getObjectType() { 68 return getServiceInterface(); 69 } 70 71 public boolean isSingleton() { 72 return true; 73 } 74 75 } 76 | Popular Tags |