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


Java Names类代码示例

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


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

示例1: configure

import org.elasticsearch.common.inject.name.Names; //导入依赖的package包/类
@Override
protected void configure() {
    bind(IndexDeletionPolicy.class)
            .annotatedWith(Names.named("actual"))
            .to(KeepOnlyLastDeletionPolicy.class)
            .asEagerSingleton();

    bind(SnapshotDeletionPolicy.class)
            .asEagerSingleton();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:DeletionPolicyModule.java

示例2: configure

import org.elasticsearch.common.inject.name.Names; //导入依赖的package包/类
@Override
protected void configure() {
    bind(ObjectMapper.class).toInstance(new ObjectMapper());
    bind(StatusRestHandler.class).asEagerSingleton();
    bind(SearchRestHandler.class).asEagerSingleton();
    bind(ProjectsRestHandler.class).asEagerSingleton();
    bind(ShowRestHandler.class).asEagerSingleton();
    bind(InitRestHandler.class).asEagerSingleton();
    bind(String.class).annotatedWith(Names.named("codeIndex")).toInstance("devsearch");
}
 
开发者ID:raymyers,项目名称:dev-search,代码行数:11,代码来源:DevSearchModule.java

示例3: configure

import org.elasticsearch.common.inject.name.Names; //导入依赖的package包/类
@Override
protected void configure() {
    bind(String.class).annotatedWith(Names.named("appName")).toInstance("elasticshell");
    bind(InputStream.class).annotatedWith(Names.named("shellInput")).toInstance(System.in);
    bind(PrintStream.class).annotatedWith(Names.named("shellOutput")).toInstance(new PrintStream(System.out, true));
    bind(ShutdownHook.class).asEagerSingleton();
    bind(ResourceRegistry.class).to(DefaultResourceRegistry.class).asEagerSingleton();
    bind(Scheduler.class).to(DefaultScheduler.class).asEagerSingleton();
}
 
开发者ID:javanna,项目名称:elasticshell,代码行数:10,代码来源:ShellModule.java

示例4: getInstance

import org.elasticsearch.common.inject.name.Names; //导入依赖的package包/类
/**
 * Returns an instance of the given type with the {@link org.elasticsearch.common.inject.name.Named}
 * annotation value.
 * <p>
 * This method allows you to switch this code
 * <code>injector.getInstance(Key.get(type, Names.named(name)));</code>
 * <p>
 * to the more concise
 * <code>Injectors.getInstance(injector, type, name);</code>
 */
public static <T> T getInstance(Injector injector, java.lang.Class<T> type, String name) {
    return injector.getInstance(Key.get(type, Names.named(name)));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:14,代码来源:Injectors.java


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