com.wichell.core.util.DubboUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wichell-common Show documentation
Show all versions of wichell-common Show documentation
common project com.wichell.wichell jar
The newest version!
package com.wichell.core.util;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.springframework.context.ApplicationContext;
import com.alibaba.dubbo.config.spring.ReferenceBean;
/**
* @author Wichell
* @version 2016年5月27日 下午4:23:06
*/
public class DubboUtil {
private DubboUtil() {
}
private static final ConcurrentMap> referenceConfigs = new ConcurrentHashMap>();
/** 获取Dubbo服务 */
public static Object refer(ApplicationContext applicationContext, String interfaceName) {
String key = "/" + interfaceName + ":";
ReferenceBean> referenceConfig = referenceConfigs.get(key);
if (referenceConfig == null) {
referenceConfig = new ReferenceBean © 2015 - 2025 Weber Informatics LLC | Privacy Policy