本文整理汇总了Java中io.dropwizard.setup.Bootstrap.setConfigurationSourceProvider方法的典型用法代码示例。如果您正苦于以下问题:Java Bootstrap.setConfigurationSourceProvider方法的具体用法?Java Bootstrap.setConfigurationSourceProvider怎么用?Java Bootstrap.setConfigurationSourceProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.dropwizard.setup.Bootstrap
的用法示例。
在下文中一共展示了Bootstrap.setConfigurationSourceProvider方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<StubEventSinkConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
GuiceBundle<StubEventSinkConfiguration> guiceBundle = defaultBuilder(StubEventSinkConfiguration.class)
.modules(new StubEventSinkModule())
.build();
bootstrap.addBundle(guiceBundle);
bootstrap.addBundle(new ServiceStatusBundle());
bootstrap.addBundle(new MonitoringBundle());
bootstrap.addBundle(new LoggingBundle());
}
示例2: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<SamlProxyConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
guiceBundle = defaultBuilder(SamlProxyConfiguration.class)
.modules(new SamlProxyModule())
.build();
bootstrap.addBundle(guiceBundle);
bootstrap.addBundle(new ServiceStatusBundle());
bootstrap.addBundle(new MonitoringBundle());
bootstrap.addBundle(new LoggingBundle());
}
示例3: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<PolicyConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
bootstrap.addBundle(new ServiceStatusBundle());
bootstrap.addBundle(new MonitoringBundle());
bootstrap.addBundle(new LoggingBundle());
bootstrap.addBundle(new IdaJsonProcessingExceptionMapperBundle());
final InfinispanBundle infinispanBundle = new InfinispanBundle();
// the infinispan cache manager needs to be lazy loaded because it is not initialized at this point.
bootstrap.addBundle(infinispanBundle);
guiceBundle = GuiceBundle.defaultBuilder(PolicyConfiguration.class)
.modules(getPolicyModule(), bindInfinispan(infinispanBundle.getInfinispanCacheManagerProvider()))
.build();
bootstrap.addBundle(guiceBundle);
}
示例4: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<SamlEngineConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
MDC.clear();
bootstrap.addBundle(new ServiceStatusBundle());
bootstrap.addBundle(new MonitoringBundle());
bootstrap.addBundle(new LoggingBundle());
bootstrap.addBundle(new IdaJsonProcessingExceptionMapperBundle());
final InfinispanBundle infinispanBundle = new InfinispanBundle();
bootstrap.addBundle(infinispanBundle);
guiceBundle = defaultBuilder(SamlEngineConfiguration.class)
.modules(new SamlEngineModule(), new CryptoModule(), bindInfinispan(infinispanBundle.getInfinispanCacheManagerProvider()))
.build();
bootstrap.addBundle(guiceBundle);
}
示例5: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<SamlSoapProxyConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
bootstrap.addBundle(new IdaJsonProcessingExceptionMapperBundle());
guiceBundle = defaultBuilder(SamlSoapProxyConfiguration.class)
.modules(new SamlSoapProxyModule())
.build();
bootstrap.addBundle(guiceBundle);
bootstrap.addBundle(new ServiceStatusBundle());
bootstrap.addBundle(new MonitoringBundle());
bootstrap.addBundle(new LoggingBundle());
}
示例6: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<ConfigConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
guiceBundle = GuiceBundle.defaultBuilder(ConfigConfiguration.class)
.modules(new ConfigModule())
.build();
bootstrap.addBundle(guiceBundle);
bootstrap.addBundle(new ServiceStatusBundle());
bootstrap.addBundle(new MonitoringBundle());
bootstrap.addBundle(new LoggingBundle());
}
示例7: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<MatchingServiceAdapterConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
// Built in Stage.DEVELOPMENT for lazy loading of Singleton objects,
// this is required as we have Singletons which require the jersey
// Environment (not available at initialize)
//
// See this issue for updates on a lazy Singleton scope
//
// https://github.com/google/guice/issues/357
GuiceBundle<MatchingServiceAdapterConfiguration> guiceBundle = defaultBuilder(MatchingServiceAdapterConfiguration.class)
.modules(new MatchingServiceAdapterModule())
.build();
bootstrap.addBundle(guiceBundle);
bootstrap.addBundle(new LoggingBundle());
bootstrap.addBundle(new MonitoringBundle());
bootstrap.addBundle(new ServiceStatusBundle());
}
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:25,代码来源:MatchingServiceAdapterApplication.java
示例8: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<ServerConfiguration> bootstrap) {
bootstrap.addBundle(hibernateBundle);
bootstrap.addBundle(new AssetsBundle("/swagger-spec", "/api-spec", null));
bootstrap.addBundle(GuiceBundle.<ServerConfiguration>newBuilder()
.addModule(new AbstractModule(){
@Override protected void configure() {}
@Provides SessionFactory sessionFactoryProvider() { return hibernateBundle.getSessionFactory();}
})
.setConfigClass(ServerConfiguration.class)
.enableAutoConfig(getClass().getPackage().getName())
.build(Stage.DEVELOPMENT)
);
bootstrap.addBundle(new Java8Bundle());
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
}
示例9: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<BlockExplorerConfiguration> bootstrap) {
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor()
)
);
hyperLedgerBundle = new HyperLedgerBundle<BlockExplorerConfiguration>() {
@Override
protected HyperLedgerConfiguration getSupernodeConfiguration(BlockExplorerConfiguration configuration) {
return configuration.getHyperLedger();
}
};
bootstrap.addBundle(hyperLedgerBundle);
bootstrap.getObjectMapper().registerModule(new JSR310Module());
}
示例10: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<AdminUsersConfig> bootstrap) {
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(NON_STRICT_VARIABLE_SUBSTITUTOR)
)
);
bootstrap.addBundle(new MigrationsBundle<AdminUsersConfig>() {
@Override
public DataSourceFactory getDataSourceFactory(AdminUsersConfig configuration) {
return configuration.getDataSourceFactory();
}
});
bootstrap.addCommand(new DependentResourceWaitCommand());
bootstrap.addCommand(new MigrateToInitialDbState());
}
示例11: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(
bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor()
)
);
bootstrap.addCommand(new TestCommand(this,
Optional.empty(),
//testDescription(AssetIntegrationTest.class, "newAssetMustHaveId"),
SmokeTest.class,
ServerIntegrationTest.class,
GroupIntegrationTest.class,
ApplicationIntegrationTest.class,
AssetIntegrationTest.class,
SearchIntegrationTest.class
));
}
示例12: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {
final List<ViewRenderer> renderers = Arrays.asList(new MarkdownViewRenderer(), new HtmlViewRenderer(), new MustacheViewRenderer());
bootstrap.addBundle(new ViewBundle<SamConfiguration>(renderers));
bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.mustache", "static"));
bootstrap.addBundle(new AssetsBundle("/docs", "/docs", "index.html", "docs"));
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(
bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor()
)
);
bootstrap.addCommand(new OAuth2Command());
bootstrap.addCommand(new CreateDatabaseCommand(this));
bootstrap.addCommand(new AddTestdataCommand(this));
}
示例13: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<BlockExplorerConfiguration> bootstrap) {
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor()
)
);
hyperLedgerBundle = new HyperLedgerBundle<BlockExplorerConfiguration>() {
@Override
protected HyperLedgerConfiguration getSupernodeConfiguration(BlockExplorerConfiguration configuration) {
return configuration.getHyperLedger();
// return configuration.getGRPCConnectedHyperLedger();
}
};
bootstrap.addBundle(hyperLedgerBundle);
bootstrap.getObjectMapper().registerModule(new JSR310Module());
}
示例14: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<?> bootstrap) {
// Replace variables with values from Consul KV. Please override
// getConsulAgentHost() and getConsulAgentPort() if Consul is not
// listening on the default localhost:8500.
try {
final Consul consul = Consul.builder().withHostAndPort(HostAndPort
.fromParts(getConsulAgentHost(), getConsulAgentPort()))
.build();
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(
bootstrap.getConfigurationSourceProvider(),
new ConsulSubstitutor(consul, strict,
substitutionInVariables)));
} catch (ConsulException e) {
LOGGER.warn(
"Unable to query Consul running on {}:{},"
+ " disabling configuration subsitution",
getConsulAgentHost(), getConsulAgentPort(), e);
}
}
示例15: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<Config> bootstrap) {
// This allows us to use templating in the YAML configuration.
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(
bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)));
bootstrap.addBundle(hibernateBundle);
}