作者:夏未夏至青_872 | 来源:互联网 | 2023-09-13 10:21
本文整理了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 extends BootstrapModule> 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;
}