本文整理汇总了Java中io.dropwizard.configuration.SubstitutingSourceProvider类的典型用法代码示例。如果您正苦于以下问题:Java SubstitutingSourceProvider类的具体用法?Java SubstitutingSourceProvider怎么用?Java SubstitutingSourceProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SubstitutingSourceProvider类属于io.dropwizard.configuration包,在下文中一共展示了SubstitutingSourceProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的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.configuration.SubstitutingSourceProvider; //导入依赖的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.configuration.SubstitutingSourceProvider; //导入依赖的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.configuration.SubstitutingSourceProvider; //导入依赖的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.configuration.SubstitutingSourceProvider; //导入依赖的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.configuration.SubstitutingSourceProvider; //导入依赖的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: shouldNotComplainWhenConfiguredCorrectly
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的package包/类
@Test
public void shouldNotComplainWhenConfiguredCorrectly() throws Exception {
environmentHelper.setEnv(new HashMap<String, String>() {{
put("PORT", "50555");
put("LOG_LEVEL", "ERROR");
put("VERIFY_ENVIRONMENT", "COMPLIANCE_TOOL");
put("MSA_METADATA_URL", "some-msa-metadata-url");
put("MSA_ENTITY_ID", "some-msa-entity-id");
put("SERVICE_ENTITY_IDS", "[\"http://some-service-entity-id\"]");
put("SAML_SIGNING_KEY", TEST_RP_PRIVATE_SIGNING_KEY);
put("SAML_PRIMARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
put("SAML_SECONDARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
put("CLOCK_SKEW", "PT5s");
}});
factory.build(
new SubstitutingSourceProvider(
new FileConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
),
"verify-service-provider.yml"
);
}
开发者ID:alphagov,项目名称:verify-service-provider,代码行数:24,代码来源:VerifyServiceProviderConfigurationTest.java
示例8: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的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
示例9: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的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)
)
);
}
示例10: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的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());
}
示例11: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的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());
}
示例12: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<RegisterConfiguration> bootstrap) {
bootstrap.addBundle(new ViewBundle<>(ImmutableList.of(new ThymeleafViewRenderer("HTML5", "/templates/", ".html", false))));
if (isRunningOnCloudFoundry()) {
bootstrap.setConfigurationSourceProvider(new UrlConfigurationSourceProvider());
}
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
));
bootstrap.addBundle(new AssetsBundle("/assets"));
bootstrap.addBundle(new CorsBundle());
bootstrap.addBundle(new LogstashBundle());
System.setProperty("java.protocol.handler.pkgs", "uk.gov.register.protocols");
}
示例13: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的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
));
}
示例14: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的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));
}
示例15: initialize
import io.dropwizard.configuration.SubstitutingSourceProvider; //导入依赖的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());
}