热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.netflix.governator.guice.LifecycleInjectorBuilder.withAdditionalBootstrapModules()方法的使用及代码示例

本文整理了Java中com.netflix.governator.guice.LifecycleInjectorBuilder.withAdditionalBootstrapModu

本文整理了Java中com.netflix.governator.guice.LifecycleInjectorBuilder.withAdditionalBootstrapModules()方法的一些代码示例,展示了LifecycleInjectorBuilder.withAdditionalBootstrapModules()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LifecycleInjectorBuilder.withAdditionalBootstrapModules()方法的具体详情如下:
包路径:com.netflix.governator.guice.LifecycleInjectorBuilder
类名称:LifecycleInjectorBuilder
方法名:withAdditionalBootstrapModules

LifecycleInjectorBuilder.withAdditionalBootstrapModules介绍

[英]Specify additional bootstrap modules to use
[中]指定要使用的其他引导模块

代码示例

代码示例来源:origin: com.netflix.governator/governator

@Override
public LifecycleInjectorBuilder withAdditionalBootstrapModules(
BootstrapModule... modules) {
this.delegate = delegate.withAdditionalBootstrapModules(modules);
return this;
}

代码示例来源:origin: com.netflix.governator/governator

@Override
public LifecycleInjectorBuilder withBootstrapModule(BootstrapModule module) {
this.delegate = delegate.withAdditionalBootstrapModules(module);
return this;
}

代码示例来源:origin: com.netflix.governator/governator

@Override
public LifecycleInjectorBuilder withAdditionalBootstrapModules(
Iterable modules) {
this.delegate = delegate.withAdditionalBootstrapModules(modules);
return this;
}

代码示例来源:origin: net.spals.appbuilder/spals-appbuilder-app-core

public Builder addBootstrapModule(final BootstrapModule bootstrapModule) {
lifecycleInjectorBuilder.withAdditionalBootstrapModules(bootstrapModule);
return this;
}

代码示例来源:origin: com.netflix.karyon/karyon-archaius

@Override
public void configure(LifecycleInjectorBuilder builder) {
builder.withAdditionalBootstrapModules(new BootstrapModule() {
@Override
public void configure(BootstrapBinder bootstrapBinder) {
if (null != propertiesLoaderClass) {
bootstrapBinder.bind(PropertiesLoader.class).to(propertiesLoaderClass).asEagerSingleton();
} else {
bootstrapBinder.bind(PropertiesLoader.class).toInstance(propertiesLoader);
}
bootstrapBinder.bind(PropertiesInitializer.class).asEagerSingleton();
ArchaiusConfigurationProvider.Builder builder = ArchaiusConfigurationProvider.builder();
builder.withOwnershipPolicy(ConfigurationOwnershipPolicies.ownsAll());
bootstrapBinder.bindConfigurationProvider().toInstance(builder.build());
}
});
}

代码示例来源:origin: com.netflix.eureka2/eureka-testkit

protected void bindConfigurationProvider(LifecycleInjectorBuilder bootstrapBinder) {
final Properties props = new Properties();
props.setProperty(AdminResourcesContainer.CONTAINER_LISTEN_PORT, Integer.toString(config.getWebAdminPort()));
props.setProperty("netflix.platform.admin.pages.packages", "netflix");
bootstrapBinder.withAdditionalBootstrapModules(new BootstrapModule() {
@Override
public void configure(BootstrapBinder binder) {
binder.bind(PropertiesLoader.class).toInstance(new PropertiesLoader() {
@Override
public void load() {
ConfigurationManager.loadProperties(props);
}
});
binder.bind(PropertiesInitializer.class).asEagerSingleton();
Builder builder = ArchaiusConfigurationProvider.builder();
builder.withOwnershipPolicy(ConfigurationOwnershipPolicies.ownsAll());
binder.bindConfigurationProvider().toInstance(builder.build());
}
});
}

代码示例来源:origin: com.netflix.governator/governator

.asEagerSingleton();
builder.withAdditionalBootstrapModules(forAnnotation(annot));
builder.withAdditionalModuleClasses(bootstrap.module());
builder.withAdditionalBootstrapModules(forAnnotation(annot));

代码示例来源:origin: com.netflix.governator/governator

builder.withAdditionalBootstrapModules(injector.getInstance(Key.get(new TypeLiteral>() {})));

代码示例来源:origin: com.netflix.eureka/eureka2-server

builder.withAdditionalBootstrapModules(bootstrapModules);
builder.withModules(PostInjectorModule.forLifecycleInjectorBuilder(builder));
injector = builder.build().createInjector();

代码示例来源:origin: com.intuit.autumn/autumn-service

private Injector getInjector() throws ServiceManagerException {
Injector injector = LifecycleInjector
.builder()
.withBootstrapModule(new BootstrapModule() {
@Override
public void configure(BootstrapBinder binder) {
binder.bindConfigurationProvider().toInstance(new SystemConfigurationProvider());
}
})
.withAdditionalBootstrapModules(new BootstrapModule() {
@Override
public void configure(BootstrapBinder binder) {
CompositeConfigurationProvider compositeCOnfigurationProvider= new CompositeConfigurationProvider();
for (Properties property : getConfigurations()) {
compositeConfigurationProvider.add(new PropertiesConfigurationProvider(property));
}
binder.bindConfigurationProvider().toInstance(compositeConfigurationProvider);
}
})
.withModuleClasses(modules.getResources())
.build()
.createInjector();
lifecycleManager = injector.getInstance(LifecycleManager.class);
try {
lifecycleManager.start();
} catch (Exception e) {
throw new ServiceManagerException("unable to start the lifecycle manager", e);
}
return injector;
}

代码示例来源:origin: com.intuit.data.autumn/autumn.service

private Injector getInjector() throws ServiceManagerException {
Injector injector = LifecycleInjector
.builder()
.withBootstrapModule(new BootstrapModule() {
@Override
public void configure(BootstrapBinder binder) {
binder.bindConfigurationProvider().toInstance(new SystemConfigurationProvider());
}
})
.withAdditionalBootstrapModules(new BootstrapModule() {
@Override
public void configure(BootstrapBinder binder) {
CompositeConfigurationProvider compositeCOnfigurationProvider= new CompositeConfigurationProvider();
for (Properties property : getConfigurations()) {
compositeConfigurationProvider.add(new PropertiesConfigurationProvider(property));
}
binder.bindConfigurationProvider().toInstance(compositeConfigurationProvider);
}
})
.withModuleClasses(modules.getResources())
.build()
.createInjector();
lifecycleManager = injector.getInstance(LifecycleManager.class);
try {
lifecycleManager.start();
} catch (Exception e) {
throw new ServiceManagerException("unable to start the lifecycle manager", e);
}
return injector;
}

推荐阅读
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • 云原生边缘计算之KubeEdge简介及功能特点
    本文介绍了云原生边缘计算中的KubeEdge系统,该系统是一个开源系统,用于将容器化应用程序编排功能扩展到Edge的主机。它基于Kubernetes构建,并为网络应用程序提供基础架构支持。同时,KubeEdge具有离线模式、基于Kubernetes的节点、群集、应用程序和设备管理、资源优化等特点。此外,KubeEdge还支持跨平台工作,在私有、公共和混合云中都可以运行。同时,KubeEdge还提供数据管理和数据分析管道引擎的支持。最后,本文还介绍了KubeEdge系统生成证书的方法。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • JavaSE笔试题-接口、抽象类、多态等问题解答
    本文解答了JavaSE笔试题中关于接口、抽象类、多态等问题。包括Math类的取整数方法、接口是否可继承、抽象类是否可实现接口、抽象类是否可继承具体类、抽象类中是否可以有静态main方法等问题。同时介绍了面向对象的特征,以及Java中实现多态的机制。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 关键词:Golang, Cookie, 跟踪位置, net/http/cookiejar, package main, golang.org/x/net/publicsuffix, io/ioutil, log, net/http, net/http/cookiejar ... [详细]
  • 本文介绍了Java高并发程序设计中线程安全的概念与synchronized关键字的使用。通过一个计数器的例子,演示了多线程同时对变量进行累加操作时可能出现的问题。最终值会小于预期的原因是因为两个线程同时对变量进行写入时,其中一个线程的结果会覆盖另一个线程的结果。为了解决这个问题,可以使用synchronized关键字来保证线程安全。 ... [详细]
  • 本文介绍了Linux系统中正则表达式的基础知识,包括正则表达式的简介、字符分类、普通字符和元字符的区别,以及在学习过程中需要注意的事项。同时提醒读者要注意正则表达式与通配符的区别,并给出了使用正则表达式时的一些建议。本文适合初学者了解Linux系统中的正则表达式,并提供了学习的参考资料。 ... [详细]
author-avatar
夏未夏至青_872
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有