當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。