本文整理汇总了Java中com.alibaba.dubbo.rpc.cluster.Merger类的典型用法代码示例。如果您正苦于以下问题:Java Merger类的具体用法?Java Merger怎么用?Java Merger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Merger类属于com.alibaba.dubbo.rpc.cluster包,在下文中一共展示了Merger类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMerger
import com.alibaba.dubbo.rpc.cluster.Merger; //导入依赖的package包/类
public static <T> Merger<T> getMerger(Class<T> returnType) {
Merger result;
if (returnType.isArray()) {
Class type = returnType.getComponentType();
result = mergerCache.get(type);
if (result == null) {
loadMergers();
result = mergerCache.get(type);
}
if(result == null && ! type.isPrimitive()) {
result = ArrayMerger.INSTANCE;
}
} else {
result = mergerCache.get(returnType);
if (result == null) {
loadMergers();
result = mergerCache.get(returnType);
}
}
return result;
}
示例2: getMerger
import com.alibaba.dubbo.rpc.cluster.Merger; //导入依赖的package包/类
public static <T> Merger<T> getMerger(Class<T> returnType) {
Merger result;
if (returnType.isArray()) {
Class type = returnType.getComponentType();
result = mergerCache.get(type);
if (result == null) {
loadMergers();
result = mergerCache.get(type);
}
if (result == null && !type.isPrimitive()) {
result = ArrayMerger.INSTANCE;
}
} else {
result = mergerCache.get(returnType);
if (result == null) {
loadMergers();
result = mergerCache.get(returnType);
}
}
return result;
}
示例3: loadMergers
import com.alibaba.dubbo.rpc.cluster.Merger; //导入依赖的package包/类
static void loadMergers() {
Set<String> names = ExtensionLoader.getExtensionLoader(Merger.class)
.getSupportedExtensions();
for (String name : names) {
Merger m = ExtensionLoader.getExtensionLoader(Merger.class).getExtension(name);
mergerCache.putIfAbsent(ReflectUtils.getGenericClass(m.getClass()), m);
}
}