ProxyDubboConfig.java 1.36 KB
package cn.com.glsx.dj.weapp.config;

import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import cn.com.glsx.scrm.proxy.remote.CommonProxyRemote;
import cn.com.glsx.scrm.proxy.remote.merchant.AccountRemote;
import cn.com.glsx.scrm.proxy.remote.merchant.MerchantRemote;
import cn.com.glsx.scrm.proxy.remote.merchant.StaffRemote;

@Configuration
public class ProxyDubboConfig{
	@Autowired
	private ReferenceBuilderFactory factory;
	
	protected final boolean CHECK = false;

	protected final int TIME_OUT = 30000;

	
    @Bean
    public StaffRemote staffRemote(){
        return factory.builder(StaffRemote.class).check(true).timeout(TIME_OUT).build();
    }

    @Bean(name="proxyMerchantRemote")
    public MerchantRemote merchantRemote(){
        return factory.builder(MerchantRemote.class).check(true).timeout(TIME_OUT).build();
    }
    
    @Bean
    public AccountRemote accountRemote(){
    	return factory.builder(AccountRemote.class).version("1.0.0").check(CHECK).timeout(TIME_OUT).build(); 
    }
    
    @Bean
    public CommonProxyRemote commonProxyRemote(){
    	return factory.builder(CommonProxyRemote.class).check(CHECK).timeout(TIME_OUT).build(); 
    }
    
}