本文整理汇总了Java中org.elasticsearch.common.inject.multibindings.MapBinder.newMapBinder方法的典型用法代码示例。如果您正苦于以下问题:Java MapBinder.newMapBinder方法的具体用法?Java MapBinder.newMapBinder怎么用?Java MapBinder.newMapBinder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.common.inject.multibindings.MapBinder
的用法示例。
在下文中一共展示了MapBinder.newMapBinder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
MapBinder<ReferenceIdent, BlobShardReferenceImplementation> binder = MapBinder
.newMapBinder(binder(), ReferenceIdent.class, BlobShardReferenceImplementation.class);
if (settings.getAsBoolean(BlobIndices.SETTING_INDEX_BLOBS_ENABLED, false)){
binder.addBinding(SysShardsTableInfo.ReferenceIdents.ID).to(BlobShardIdExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.NUM_DOCS).to(BlobShardNumDocsExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.PRIMARY).to(BlobShardPrimaryExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.RELOCATING_NODE).to(BlobShardRelocatingNodeExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.SCHEMA_NAME).to(BlobShardSchemaNameExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.SIZE).to(BlobShardSizeExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.STATE).to(BlobShardStateExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.ROUTING_STATE).to(BlobShardRoutingStateExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.TABLE_NAME).to(BlobShardTableNameExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.PARTITION_IDENT).to(BlobShardPartitionIdentExpression.class).asEagerSingleton();
binder.addBinding(SysShardsTableInfo.ReferenceIdents.ORPHAN_PARTITION).to(BlobShardPartitionOrphanedExpression.class).asEagerSingleton();
}
}
示例2: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
MapBinder<ReferenceIdent, ShardReferenceImplementation> b = MapBinder
.newMapBinder(binder(), ReferenceIdent.class, ShardReferenceImplementation.class);
b.addBinding(SysShardsTableInfo.ReferenceIdents.ID).to(ShardIdExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.SIZE).to(ShardSizeExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.NUM_DOCS).to(ShardNumDocsExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.PRIMARY).to(ShardPrimaryExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.STATE).to(ShardStateExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.ROUTING_STATE).to(ShardRoutingStateExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.RELOCATING_NODE).to(ShardRelocatingNodeExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.TABLE_NAME).to(ShardTableNameExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.SCHEMA_NAME).to(ShardSchemaNameExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.PARTITION_IDENT).to(ShardPartitionIdentExpression.class).asEagerSingleton();
b.addBinding(SysShardsTableInfo.ReferenceIdents.ORPHAN_PARTITION).to(ShardPartitionOrphanedExpression.class).asEagerSingleton();
}
示例3: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
MapBinder<String, NativeScriptFactory> scriptsBinder
= MapBinder.newMapBinder(binder(), String.class, NativeScriptFactory.class);
for (Map.Entry<String, Class<? extends NativeScriptFactory>> entry : scripts.entrySet()) {
scriptsBinder.addBinding(entry.getKey()).to(entry.getValue()).asEagerSingleton();
}
Multibinder<ScriptEngineService> multibinder = Multibinder.newSetBinder(binder(), ScriptEngineService.class);
multibinder.addBinding().to(NativeScriptEngineService.class);
try {
Class.forName("com.github.mustachejava.Mustache");
multibinder.addBinding().to(MustacheScriptEngineService.class).asEagerSingleton();
} catch (Throwable t) {
Loggers.getLogger(ScriptService.class, settings).debug("failed to load mustache", t);
}
for (Class<? extends ScriptEngineService> scriptEngine : scriptEngines) {
multibinder.addBinding().to(scriptEngine).asEagerSingleton();
}
bind(ScriptContextRegistry.class).toInstance(new ScriptContextRegistry(customScriptContexts));
bind(ScriptService.class).asEagerSingleton();
}
示例4: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
bind(TransportReindexAction.class).asEagerSingleton();
bind(ReindexParser.class).asEagerSingleton();
MapBinder<GenericAction, TransportAction> transportActionsBinder =
MapBinder.newMapBinder(
binder(), GenericAction.class, TransportAction.class);
transportActionsBinder.addBinding(ReindexAction.INSTANCE).to(
TransportReindexAction.class).asEagerSingleton();
MapBinder<String, GenericAction> actionsBinder = MapBinder
.newMapBinder(binder(), String.class, GenericAction.class);
actionsBinder.addBinding(ReindexAction.NAME).toInstance(
ReindexAction.INSTANCE);
}
示例5: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
bind(RepositoriesService.class).asEagerSingleton();
bind(SnapshotsService.class).asEagerSingleton();
bind(SnapshotShardsService.class).asEagerSingleton();
bind(TransportNodesSnapshotsStatus.class).asEagerSingleton();
bind(RestoreService.class).asEagerSingleton();
MapBinder<String, Repository.Factory> typesBinder = MapBinder.newMapBinder(binder(), String.class, Repository.Factory.class);
repositoryTypes.forEach((k, v) -> typesBinder.addBinding(k).toInstance(v));
}
示例6: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
Multibinder<ActionFilter> actionFilterMultibinder = Multibinder.newSetBinder(binder(), ActionFilter.class);
for (Class<? extends ActionFilter> actionFilter : actionFilters) {
actionFilterMultibinder.addBinding().to(actionFilter);
}
bind(ActionFilters.class).asEagerSingleton();
bind(DestructiveOperations.class).toInstance(destructiveOperations);
if (false == transportClient) {
// Supporting classes only used when not a transport client
bind(AutoCreateIndex.class).toInstance(autoCreateIndex);
bind(TransportLivenessAction.class).asEagerSingleton();
// register GenericAction -> transportAction Map used by NodeClient
@SuppressWarnings("rawtypes")
MapBinder<GenericAction, TransportAction> transportActionsBinder
= MapBinder.newMapBinder(binder(), GenericAction.class, TransportAction.class);
for (ActionHandler<?, ?> action : actions.values()) {
// bind the action as eager singleton, so the map binder one will reuse it
bind(action.getTransportAction()).asEagerSingleton();
transportActionsBinder.addBinding(action.getAction()).to(action.getTransportAction()).asEagerSingleton();
for (Class<?> supportAction : action.getSupportTransportActions()) {
bind(supportAction).asEagerSingleton();
}
}
}
}
示例7: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
MapBinder<String, FileInputFactory> binder = MapBinder.newMapBinder(binder(), String.class, FileInputFactory.class);
binder.addBinding(LocalFsFileInputFactory.NAME).to(LocalFsFileInputFactory.class).asEagerSingleton();
binder.addBinding(S3FileInputFactory.NAME).to(S3FileInputFactory.class).asEagerSingleton();
}
示例8: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
functionBinder = MapBinder.newMapBinder(binder(), FunctionIdent.class, FunctionImplementation.class);
resolverBinder = MapBinder.newMapBinder(binder(), String.class, DynamicFunctionResolver.class);
IsNullPredicate.register(this);
NotPredicate.register(this);
MatchPredicate.register(this);
}
示例9: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
Unnest.register(this);
MapBinder<String,TableFunctionImplementation> functionBinder =
MapBinder.newMapBinder(binder(), String.class, TableFunctionImplementation.class);
for (Map.Entry<String, TableFunctionImplementation> entry : functions.entrySet()) {
functionBinder.addBinding(entry.getKey()).toInstance(entry.getValue());
}
functions.clear();
functions = null;
}
示例10: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
MapBinder<ReferenceIdent, ReferenceImplementation> b = MapBinder
.newMapBinder(binder(), ReferenceIdent.class, ReferenceImplementation.class);
b.addBinding(clusterIdent(ClusterIdExpression.NAME)).to(
ClusterIdExpression.class).asEagerSingleton();
b.addBinding(clusterIdent(ClusterNameExpression.NAME)).to(
ClusterNameExpression.class).asEagerSingleton();
b.addBinding(clusterIdent(ClusterMasterNodeExpression.NAME)).to(
ClusterMasterNodeExpression.class).asEagerSingleton();
b.addBinding(clusterIdent(ClusterSettingsExpression.NAME)).to(
ClusterSettingsExpression.class).asEagerSingleton();
}
示例11: bindExtensions
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void bindExtensions(Binder binder) {
MapBinder<K, V> mapBinder = MapBinder.newMapBinder(binder, keyType, valueType);
for (Map.Entry<K, V> entry : map.entrySet()) {
mapBinder.addBinding(entry.getKey()).toInstance(entry.getValue());
}
}
示例12: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
bind(TransportImportAction.class).asEagerSingleton();
bind(ImportParser.class).asEagerSingleton();
bind(Importer.class).asEagerSingleton();
MapBinder<GenericAction, TransportAction> transportActionsBinder = MapBinder.newMapBinder(binder(), GenericAction.class, TransportAction.class);
transportActionsBinder.addBinding(ImportAction.INSTANCE).to(TransportImportAction.class).asEagerSingleton();
MapBinder<String, GenericAction> actionsBinder = MapBinder.newMapBinder(binder(), String.class, GenericAction.class);
actionsBinder.addBinding(ImportAction.NAME).toInstance(ImportAction.INSTANCE);
}
示例13: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
bind(TransportSearchIntoAction.class).asEagerSingleton();
bind(SearchIntoParser.class).asEagerSingleton();
MapBinder<GenericAction, TransportAction> transportActionsBinder =
MapBinder.newMapBinder(
binder(), GenericAction.class, TransportAction.class);
transportActionsBinder.addBinding(SearchIntoAction.INSTANCE).to(
TransportSearchIntoAction.class).asEagerSingleton();
MapBinder<String, GenericAction> actionsBinder = MapBinder
.newMapBinder(binder(), String.class, GenericAction.class);
actionsBinder.addBinding(SearchIntoAction.NAME).toInstance(
SearchIntoAction.INSTANCE);
MapBinder<String, WriterCollectorFactory> collectorBinder
= MapBinder.newMapBinder(binder(),
String.class, WriterCollectorFactory.class);
collectorBinder.addBinding(BulkWriterCollector.NAME).toProvider(
FactoryProvider
.newFactory(WriterCollectorFactory.class,
BulkWriterCollector.class));
}
示例14: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
bind(TransportExportAction.class).asEagerSingleton();
bind(ExportParser.class).asEagerSingleton();
bind(Exporter.class).asEagerSingleton();
MapBinder<GenericAction, TransportAction> transportActionsBinder = MapBinder.newMapBinder(binder(), GenericAction.class, TransportAction.class);
transportActionsBinder.addBinding(ExportAction.INSTANCE).to(TransportExportAction.class).asEagerSingleton();
MapBinder<String, GenericAction> actionsBinder = MapBinder.newMapBinder(binder(), String.class, GenericAction.class);
actionsBinder.addBinding(ExportAction.NAME).toInstance(ExportAction.INSTANCE);
}
示例15: configure
import org.elasticsearch.common.inject.multibindings.MapBinder; //导入方法依赖的package包/类
@Override
protected void configure() {
refBinder = MapBinder.newMapBinder(binder(), ReferenceIdent.class, ReferenceImplementation.class);
bind(NodeSysExpression.class).asEagerSingleton();
}