本文整理汇总了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;
}
示例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());
}
}
}
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}