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


Java Plugin类代码示例

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


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

示例1: loadModuleReferences

import io.crate.Plugin; //导入依赖的package包/类
private List<CrateComponentLoader.OnModuleReference> loadModuleReferences(Plugin plugin) {
    List<CrateComponentLoader.OnModuleReference> list = Lists.newArrayList();
    for (Method method : plugin.getClass().getDeclaredMethods()) {
        if (!method.getName().equals("onModule")) {
            continue;
        }
        if (method.getParameterTypes().length == 0 || method.getParameterTypes().length > 1) {
            logger.warn("Plugin: {} implementing onModule with no parameters or more than one parameter", plugin.name());
            continue;
        }
        Class moduleClass = method.getParameterTypes()[0];
        if (!Module.class.isAssignableFrom(moduleClass)) {
            logger.warn("Plugin: {} implementing onModule by the type is not of Module type {}", plugin.name(), moduleClass);
            continue;
        }
        method.setAccessible(true);
        //noinspection unchecked
        list.add(new CrateComponentLoader.OnModuleReference(moduleClass, method));
    }

    return list;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:23,代码来源:PluginLoader.java

示例2: processModule

import io.crate.Plugin; //导入依赖的package包/类
public void processModule(Module module) {
    for (Plugin plugin : plugins) {
        // see if there are onModule references
        List<CrateComponentLoader.OnModuleReference> references = onModuleReferences.get(plugin);
        if (references != null) {
            for (CrateComponentLoader.OnModuleReference reference : references) {
                if (reference.moduleClass.isAssignableFrom(module.getClass())) {
                    try {
                        reference.onModuleMethod.invoke(plugin, module);
                    } catch (Exception e) {
                        logger.warn("Plugin {}, failed to invoke custom onModule method", e, plugin.name());
                    }
                }
            }
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:PluginLoader.java

示例3: nodeModules

import io.crate.Plugin; //导入依赖的package包/类
public Collection<Module> nodeModules() {
    List<Module> modules = Lists.newArrayList();
    for (Plugin plugin : plugins) {
        modules.addAll(plugin.nodeModules());

        // deprecated methods support
        Collection<Class<? extends Module>> modulesClasses = Lists.newArrayList();
        modulesClasses.addAll(plugin.modules());
        modulesClasses.addAll(plugin.modules(settings));
        for (Class<? extends Module> moduleClass : modulesClasses) {
            modules.add(createModule(moduleClass, settings));
        }
    }
    return modules;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:16,代码来源:PluginLoader.java

示例4: nodeServices

import io.crate.Plugin; //导入依赖的package包/类
public Collection<Class<? extends LifecycleComponent>> nodeServices() {
    List<Class<? extends LifecycleComponent>> services = Lists.newArrayList();
    for (Plugin plugin : plugins) {
        services.addAll(plugin.nodeServices());
        services.addAll(plugin.services());
    }
    return services;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:PluginLoader.java

示例5: indexModules

import io.crate.Plugin; //导入依赖的package包/类
public Collection<Module> indexModules(Settings indexSettings) {
    List<Module> modules = Lists.newArrayList();
    for (Plugin plugin : plugins) {
        modules.addAll(plugin.indexModules(indexSettings));

        // deprecated methods support
        for (Class<? extends Module> moduleClass : plugin.indexModules()) {
            modules.add(createModule(moduleClass, settings));
        }
    }
    return modules;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:PluginLoader.java

示例6: indexServices

import io.crate.Plugin; //导入依赖的package包/类
public Collection<Class<? extends Closeable>> indexServices() {
    List<Class<? extends Closeable>> services = Lists.newArrayList();
    for (Plugin plugin : plugins) {
        services.addAll(plugin.indexServices());
    }
    return services;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:PluginLoader.java

示例7: shardModules

import io.crate.Plugin; //导入依赖的package包/类
public Collection<Module> shardModules(Settings indexSettings) {
    List<Module> modules = Lists.newArrayList();
    for (Plugin plugin : plugins) {
        modules.addAll(plugin.shardModules(indexSettings));

        // deprecated methods support
        for (Class<? extends Module> moduleClass : plugin.shardModules()) {
            modules.add(createModule(moduleClass, settings));
        }
    }
    return modules;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:PluginLoader.java

示例8: shardServices

import io.crate.Plugin; //导入依赖的package包/类
public Collection<Class<? extends Closeable>> shardServices() {
    List<Class<? extends Closeable>> services = Lists.newArrayList();
    for (Plugin plugin : plugins) {
        services.addAll(plugin.shardServices());
    }
    return services;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:PluginLoader.java

示例9: additionalSettings

import io.crate.Plugin; //导入依赖的package包/类
public Settings additionalSettings() {
    Settings.Builder builder = Settings.settingsBuilder();
    for (Plugin plugin : plugins) {
        builder.put(plugin.additionalSettings());
    }
    return builder.build();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:PluginLoader.java


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