@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()); }
@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()); }
@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); }
@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); }
@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()); }
@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()); }
@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" ); }
@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()); }
@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) ) ); }
@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()); }
@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()); }
@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"); }
@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 )); }
@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)); }
@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()); }
@Test public void testName() throws Exception { MutableSchedulerConfiguration mutable = factory.build( new SubstitutingSourceProvider( new FileConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false, true)), Resources.getResource("scheduler.yml").getFile()); mutable.getCassandraConfig().getApplication().writeDaemonConfiguration(Paths.get(".").resolve("cassandra.yaml")); final ServiceConfig serviceConfig = mutable.getServiceConfig(); final ServiceConfig updated = ServiceConfig.create("yo", serviceConfig.getId(), serviceConfig.getVersion(), serviceConfig.getUser(), serviceConfig.getCluster(), serviceConfig.getRole(), serviceConfig.getPrincipal(), serviceConfig.getFailoverTimeoutS(), serviceConfig.getSecret(), serviceConfig.isCheckpoint()); mutable.setServiceConfig(updated); final ConfigValidator configValidator = new ConfigValidator(); final List<ConfigValidationError> validate = configValidator.validate( configuration.createConfig(), mutable.createConfig()); Assert.assertTrue(validate.size() == 1); }
@Test public void testCluster() throws Exception { MutableSchedulerConfiguration mutable = factory.build( new SubstitutingSourceProvider( new FileConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false, true)), Resources.getResource("scheduler.yml").getFile()); final ServiceConfig serviceConfig = mutable.getServiceConfig(); final ServiceConfig updated = ServiceConfig.create(serviceConfig.getName(), serviceConfig.getId(), serviceConfig.getVersion(), serviceConfig.getUser(), serviceConfig.getCluster() + "1234", serviceConfig.getRole(), serviceConfig.getPrincipal(), serviceConfig.getFailoverTimeoutS(), serviceConfig.getSecret(), serviceConfig.isCheckpoint()); mutable.setServiceConfig(updated); final ConfigValidator configValidator = new ConfigValidator(); final List<ConfigValidationError> validate = configValidator.validate(configuration.createConfig(), mutable.createConfig()); Assert.assertTrue(validate.size() == 1); }
@Test public void testPrincipal() throws Exception { MutableSchedulerConfiguration mutable = factory.build( new SubstitutingSourceProvider( new FileConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false, true)), Resources.getResource("scheduler.yml").getFile()); final ServiceConfig serviceConfig = mutable.getServiceConfig(); final ServiceConfig updated = ServiceConfig.create(serviceConfig.getName(), serviceConfig.getId(), serviceConfig.getVersion(), serviceConfig.getUser(), serviceConfig.getCluster(), serviceConfig.getRole(), serviceConfig.getPrincipal() + "asdf", serviceConfig.getFailoverTimeoutS(), serviceConfig.getSecret(), serviceConfig.isCheckpoint()); mutable.setServiceConfig(updated); final ConfigValidator configValidator = new ConfigValidator(); final List<ConfigValidationError> validate = configValidator.validate(configuration.createConfig(), mutable.createConfig()); Assert.assertTrue(validate.size() == 1); }
@Test public void testRole() throws Exception { MutableSchedulerConfiguration mutable = factory.build( new SubstitutingSourceProvider( new FileConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false, true)), Resources.getResource("scheduler.yml").getFile()); final ServiceConfig serviceConfig = mutable.getServiceConfig(); final ServiceConfig updated = ServiceConfig.create(serviceConfig.getName(), serviceConfig.getId(), serviceConfig.getVersion(), serviceConfig.getUser(), serviceConfig.getCluster(), serviceConfig.getRole() + "qwerty", serviceConfig.getPrincipal(), serviceConfig.getFailoverTimeoutS(), serviceConfig.getSecret(), serviceConfig.isCheckpoint()); mutable.setServiceConfig(updated); final ConfigValidator configValidator = new ConfigValidator(); final List<ConfigValidationError> validate = configValidator.validate(configuration.createConfig(),mutable.createConfig()); Assert.assertTrue(validate.size() == 1); }
@Override public void initialize(Bootstrap<AppConfiguration> bootstrap) { bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor() ) ); /* Configure objectMapper to instantiate immutable configuration correctly */ ObjectMapper objectMapper = bootstrap.getObjectMapper(); objectMapper.registerModule(new JSR310Module()); bootstrap.getObjectMapper() .setVisibilityChecker(objectMapper.getSerializationConfig().getDefaultVisibilityChecker() .withFieldVisibility(JsonAutoDetect.Visibility.ANY) .withGetterVisibility(JsonAutoDetect.Visibility.NONE) .withSetterVisibility(JsonAutoDetect.Visibility.NONE) .withCreatorVisibility(JsonAutoDetect.Visibility.NONE)); /* Host static resources */ bootstrap.addBundle((new AssetsBundle("/assets", "/", "index.html", "static"))); /* Enable WebSockets support */ bootstrap.addBundle(websocketBundle = new WebsocketBundle<>()); }
@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); } }
@Override public void initialize(Bootstrap<PublicAuthConfiguration> bootstrap) { bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false) ) ); bootstrap.addBundle(new DBIExceptionsBundle()); bootstrap.addBundle(new MigrationsBundle<PublicAuthConfiguration>() { @Override public DataSourceFactory getDataSourceFactory(PublicAuthConfiguration configuration) { return configuration.getDataSourceFactory(); } }); bootstrap.addCommand(new DependentResourceWaitCommand()); }
@Override public void initialize(Bootstrap<C> bootstrap) { bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(new ResourceConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)) ); µsBundle.Builder<C> µsBundleBuilder = µsBundle.<C>newBuilder(); initialize(µsBundleBuilder); µsBundleInstance = µsBundleBuilder.setConfigClass(getConfigurationClass()).addGuiceLifecycleListener(this).build(); bootstrap.addBundle(µsBundleInstance); if (ZipkinAware.class.isAssignableFrom(getConfigurationClass())) { logger.info("Register " + ZipkinBundle.class.getSimpleName() + " ..."); bootstrap.addBundle(new ZipkinBundle<C>(getName()) { @Override public ZipkinFactory getZipkinFactory(C c) { return ((ZipkinAware)c).getZipkin(); } }); } }
@Override public void initialize(final Bootstrap<DropWizardk8s2Configuration> bootstrap) { System.out.println("================Environment=============="); System.out.println(System.getenv()); // Enable variable substitution with environment variables bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor() ) ); // TODO: application initialization }
@Override public void initialize(final Bootstrap<DropWizardK8S1Configuration> bootstrap) { System.out.println("================Environment=============="); System.out.println(System.getenv()); // Enable variable substitution with environment variables bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false) ) ); // TODO: application initialization }
@Override public void initialize(final Bootstrap<?> bootstrap) { // Enable variable substitution with environment variables bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false) )); // Configure Jackson mapper bootstrap.getObjectMapper() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .setSerializationInclusion(JsonInclude.Include.NON_NULL); // Enable WebSockets for Jetty bootstrap.addBundle(new WebSocketEnablerBundle()); // Register Spring context applicationContext.register(BackendSpringConfig.class); bootstrap.addBundle(new SpringBundle(applicationContext)); }
@Override public void initialize(Bootstrap<AppConfiguration> bootstrap) { MigrationsBundle<AppConfiguration> migrationBundle = new MigrationsBundle<AppConfiguration>() { @Override public DataSourceFactory getDataSourceFactory(AppConfiguration configuration) { return configuration.getDataSourceFactory(); } }; // allow using Environment variable in yaml bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false) ) ); bootstrap.addBundle(migrationBundle); bootstrap.addBundle(hibernate); bootstrap.addBundle(new ConfiguredAssetsBundle("/app", "/app", "index.html")); }
@Override public void initialize(final Bootstrap<CredentialStorageConfiguration> bootstrap) { bootstrap.addBundle(this.circuitBreakerBundle); bootstrap.addBundle(this.petite); bootstrap.addBundle(this.adminResourceBundle); bootstrap.addBundle(new SwaggerBundle<CredentialStorageConfiguration>() { @Override protected SwaggerBundleConfiguration getSwaggerBundleConfiguration( final CredentialStorageConfiguration configuration) { return configuration.getSwaggerBundleConfiguration(); } }); bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false))); }
@Override public void initialize(Bootstrap<TimbuctooConfiguration> bootstrap) { //bundles activeMqBundle = new ActiveMQBundle(); bootstrap.addBundle(activeMqBundle); bootstrap.addBundle(new MultiPartBundle()); bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.html")); /* * Make it possible to use environment variables in the config. * see: http://www.dropwizard.io/0.9.1/docs/manual/core.html#environment-variables */ bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(true) )); }
@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); }
@Override public void initialize(Bootstrap<ServerConfiguration> bootstrap) { final boolean strict = false; bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(strict))); bootstrap.addBundle(new Java8Bundle()); bootstrap.addBundle(new Protobuf3Bundle()); super.initialize(bootstrap); }
@Override public void initialize(final Bootstrap<BenchConfiguration> bootstrap) { bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(true) ) ); }
@Override public void initialize(Bootstrap<VerifyServiceProviderConfiguration> bootstrap) { // Enable variable substitution with environment variables bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false) ) ); IdaSamlBootstrap.bootstrap(); bootstrap.getObjectMapper().setDateFormat(ISO8601DateFormat.getInstance()); }
@Override public void initialize(final Bootstrap<GraphiakConfiguration> bootstrap) { // Enable variable substitution with environment variables bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false))); bootstrap.addBundle(new RiakBundle<GraphiakConfiguration>() { @Override public RiakFactory getRiakFactory( GraphiakConfiguration configuration) { return configuration.getRiak(); } }); }
/** * * @param bootstrap The pre-start application environment, containing everything required to bootstrap a Dropwizard command. * It wires up everything being used in the Environment, including the Configuration and the Application */ @Override public void initialize(Bootstrap<EncryptionServiceConfiguration> bootstrap) { // Enable variable substitution with environment variables bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false) ) ); bootstrap.addBundle(new AssetsBundle()); }
/** * * @param bootstrap The pre-start application environment, containing everything required to bootstrap a Dropwizard command. * It wires up everything being used in the Environment, including the Configuration and the Application */ @Override public void initialize(Bootstrap<ConnectionServiceConfiguration> bootstrap) { // Enable variable substitution with environment variables bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false) ) ); bootstrap.addBundle(new AssetsBundle()); }
@Override public void initialize(Bootstrap<DemoConfiguration> bootstrap) { bootstrap.addBundle(new AssetsBundle("/assets/index.html", "/")); bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor() ) ); }
@Override public void initialize(Bootstrap<MutableSchedulerConfiguration> bootstrap) { super.initialize(bootstrap); StrSubstitutor strSubstitutor = new StrSubstitutor(new EnvironmentVariableLookup(false)); strSubstitutor.setEnableSubstitutionInVariables(true); bootstrap.addBundle(new Java8Bundle()); bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), strSubstitutor)); }