package cn.com.qmth.stmms.common.hessian;

import org.springframework.aop.framework.ProxyFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;

public class CombineHessianProxyFactoryBean extends CombineHessianClientInterceptor implements FactoryBean<Object>,
        InitializingBean {

    private Object serviceProxy;

    @Override
    public void afterPropertiesSet() {
        this.serviceProxy = new ProxyFactory(getServiceInterface(), this).getProxy(getBeanClassLoader());
    }

    public Object getObject() {
        return this.serviceProxy;
    }

    public Class<?> getObjectType() {
        return getServiceInterface();
    }

    public boolean isSingleton() {
        return true;
    }

}
