本文整理匯總了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();
}