当前位置: 首页>>代码示例>>Java>>正文


Java ExtensionFactory类代码示例

本文整理汇总了Java中com.alibaba.dubbo.common.extension.ExtensionFactory的典型用法代码示例。如果您正苦于以下问题:Java ExtensionFactory类的具体用法?Java ExtensionFactory怎么用?Java ExtensionFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExtensionFactory类属于com.alibaba.dubbo.common.extension包,在下文中一共展示了ExtensionFactory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AdaptiveExtensionFactory

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public AdaptiveExtensionFactory() {
    ExtensionLoader<ExtensionFactory> loader = ExtensionLoader.getExtensionLoader(ExtensionFactory.class);
    List<ExtensionFactory> list = new ArrayList<ExtensionFactory>();
    for (String name : loader.getSupportedExtensions()) {
        //保存所有ExtensionFactory的实现
        list.add(loader.getExtension(name));
    }
    factories = Collections.unmodifiableList(list);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:10,代码来源:AdaptiveExtensionFactory.java

示例2: getExtension

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public <T> T getExtension(Class<T> type, String name) {
    //依次遍历各个ExtensionFactory实现的getExtension方法
    //找到Extension后立即返回,没找到返回null
    for (ExtensionFactory factory : factories) {
        T extension = factory.getExtension(type, name);
        if (extension != null) {
            return extension;
        }
    }
    return null;
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:12,代码来源:AdaptiveExtensionFactory.java

示例3: AdaptiveExtensionFactory

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public AdaptiveExtensionFactory() {
    ExtensionLoader<ExtensionFactory> loader = ExtensionLoader.getExtensionLoader(ExtensionFactory.class);
    List<ExtensionFactory> list = new ArrayList<ExtensionFactory>();
    for (String name : loader.getSupportedExtensions()) {
        list.add(loader.getExtension(name));
    }
    factories = Collections.unmodifiableList(list);
}
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:9,代码来源:AdaptiveExtensionFactory.java

示例4: getExtension

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public <T> T getExtension(Class<T> type, String name) {
    for (ExtensionFactory factory : factories) {
        T extension = factory.getExtension(type, name);
        if (extension != null) {
            return extension;
        }
    }
    return null;
}
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:10,代码来源:AdaptiveExtensionFactory.java

示例5: AdaptiveExtensionFactory

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public AdaptiveExtensionFactory() {
    ExtensionLoader<ExtensionFactory> loader = ExtensionLoader.getExtensionLoader(ExtensionFactory.class);
    List<ExtensionFactory> list = new ArrayList<ExtensionFactory>();
    //FIXME 获取dubbo下所有的RegistryFactory  add by jileng
    for (String name : loader.getSupportedExtensions()) {
        list.add(loader.getExtension(name));
    }
    factories = Collections.unmodifiableList(list);
}
 
开发者ID:spccold,项目名称:dubbo-comments,代码行数:10,代码来源:AdaptiveExtensionFactory.java

示例6: AdaptiveExtensionFactory

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public AdaptiveExtensionFactory() {
    ExtensionLoader<ExtensionFactory> loader = ExtensionLoader.getExtensionLoader(ExtensionFactory.class);
    List<ExtensionFactory> list = new ArrayList<>();
    for (String name : loader.getSupportedExtensions()) {
        list.add(loader.getExtension(name));
    }
    factories = Collections.unmodifiableList(list);
}
 
开发者ID:linux-china,项目名称:dubbo3,代码行数:9,代码来源:AdaptiveExtensionFactory.java

示例7: AdaptiveExtensionFactory

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public AdaptiveExtensionFactory() {
    //获得ExtensionFactory对应的扩展类加载器
    ExtensionLoader<ExtensionFactory> loader = ExtensionLoader.getExtensionLoader(ExtensionFactory.class);
    List<ExtensionFactory> list = new ArrayList<ExtensionFactory>();
    for (String name : loader.getSupportedExtensions()) {
        list.add(loader.getExtension(name));
    }
    factories = Collections.unmodifiableList(list);
}
 
开发者ID:DoubleSmile,项目名称:dubbo-learning,代码行数:10,代码来源:AdaptiveExtensionFactory.java

示例8: AdaptiveExtensionFactory

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public AdaptiveExtensionFactory() {
    ExtensionLoader<ExtensionFactory> loader = ExtensionLoader.getExtensionLoader(ExtensionFactory.class);
    List<ExtensionFactory> list = new ArrayList<ExtensionFactory>();
    for (String name : loader.getSupportedExtensions()) { // 将所有ExtensionFactory实现保存起来
        list.add(loader.getExtension(name));
    }
    factories = Collections.unmodifiableList(list);
}
 
开发者ID:yuexiahandao,项目名称:DubboCode,代码行数:9,代码来源:AdaptiveExtensionFactory.java

示例9: getExtension

import com.alibaba.dubbo.common.extension.ExtensionFactory; //导入依赖的package包/类
public <T> T getExtension(Class<T> type, String name) {
    // 依次遍历各个ExtensionFactory实现的getExtension方法,一旦获取到Extension即返回
    // 如果遍历完所有的ExtensionFactory实现均无法找到Extension,则返回null
    for (ExtensionFactory factory : factories) {
        T extension = factory.getExtension(type, name);
        if (extension != null) {
            return extension;
        }
    }
    return null;
}
 
开发者ID:yuexiahandao,项目名称:DubboCode,代码行数:12,代码来源:AdaptiveExtensionFactory.java


注:本文中的com.alibaba.dubbo.common.extension.ExtensionFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。