Search in sources :

Example 11 with EnvironmentVariableSubstitutor

use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project zucchini-ui by pgentile.

the class BackendBundle method initialize.

@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));
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) WebSocketEnablerBundle(io.zucchiniui.backend.support.websocket.WebSocketEnablerBundle) SpringBundle(io.zucchiniui.backend.support.spring.SpringBundle)

Example 12 with EnvironmentVariableSubstitutor

use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project pay-connector by alphagov.

the class ConnectorApp method initialize.

@Override
public void initialize(Bootstrap<ConnectorConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(NON_STRICT_VARIABLE_SUBSTITUTOR)));
    bootstrap.addBundle(new MigrationsBundle<ConnectorConfiguration>() {

        @Override
        public DataSourceFactory getDataSourceFactory(ConnectorConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    });
    bootstrap.addCommand(new DependentResourceWaitCommand());
    bootstrap.addCommand(new RenderStateTransitionGraphCommand());
    bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(LogstashConsoleAppenderFactory.class);
    bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(GovUkPayDropwizardRequestJsonLogLayoutFactory.class);
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) RenderStateTransitionGraphCommand(uk.gov.pay.connector.command.RenderStateTransitionGraphCommand) DataSourceFactory(io.dropwizard.db.DataSourceFactory) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) DependentResourceWaitCommand(uk.gov.pay.connector.util.DependentResourceWaitCommand)

Example 13 with EnvironmentVariableSubstitutor

use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project pay-ledger by alphagov.

the class LedgerApp method initialize.

@Override
public void initialize(Bootstrap<LedgerConfig> bootstrap) {
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    bootstrap.addBundle(new MigrationsBundle<>() {

        @Override
        public DataSourceFactory getDataSourceFactory(LedgerConfig configuration) {
            return configuration.getDataSourceFactory();
        }
    });
    bootstrap.addBundle(new JdbiExceptionsBundle());
    bootstrap.addCommand(new DependentResourceWaitCommand());
    bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(LogstashConsoleAppenderFactory.class);
    bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(GovUkPayDropwizardRequestJsonLogLayoutFactory.class);
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) DataSourceFactory(io.dropwizard.db.DataSourceFactory) JdbiExceptionsBundle(io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) DependentResourceWaitCommand(uk.gov.pay.ledger.healthcheck.DependentResourceWaitCommand)

Example 14 with EnvironmentVariableSubstitutor

use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project pay-cardid by alphagov.

the class CardApi method initialize.

@Override
public void initialize(Bootstrap<CardConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(LogstashConsoleAppenderFactory.class);
    bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(GovUkPayDropwizardRequestJsonLogLayoutFactory.class);
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor)

Example 15 with EnvironmentVariableSubstitutor

use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project bisq-api by mrosseel.

the class BisqApiApplication method initialize.

@Override
public void initialize(Bootstrap<ApiConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(new ResourceConfigurationSourceProvider());
    bootstrap.addBundle(new SwaggerBundle<ApiConfiguration>() {

        @Override
        protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(ApiConfiguration configuration) {
            return configuration.swaggerBundleConfiguration;
        }
    });
    // Overriding settings through environment variables, added to override the http port from 8080 to something else
    // See http://www.dropwizard.io/1.1.4/docs/manual/core.html#configuration
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) ResourceConfigurationSourceProvider(io.dropwizard.configuration.ResourceConfigurationSourceProvider) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) SwaggerBundleConfiguration(io.federecio.dropwizard.swagger.SwaggerBundleConfiguration)

Aggregations

EnvironmentVariableSubstitutor (io.dropwizard.configuration.EnvironmentVariableSubstitutor)27 SubstitutingSourceProvider (io.dropwizard.configuration.SubstitutingSourceProvider)27 DataSourceFactory (io.dropwizard.db.DataSourceFactory)6 LoggingBundle (uk.gov.ida.bundles.LoggingBundle)6 MonitoringBundle (uk.gov.ida.bundles.MonitoringBundle)6 ServiceStatusBundle (uk.gov.ida.bundles.ServiceStatusBundle)6 GuiceBundle (uk.gov.ida.hub.shared.guice.GuiceBundle)6 PrometheusBundle (uk.gov.ida.metrics.bundle.PrometheusBundle)5 SwaggerBundleConfiguration (io.federecio.dropwizard.swagger.SwaggerBundleConfiguration)3 EventEmitterModule (uk.gov.ida.eventemitter.EventEmitterModule)3 ConsulFactory (com.smoketurner.dropwizard.consul.ConsulFactory)2 AssetsBundle (io.dropwizard.assets.AssetsBundle)2 ConfigurationSourceProvider (io.dropwizard.configuration.ConfigurationSourceProvider)2 ResourceConfigurationSourceProvider (io.dropwizard.configuration.ResourceConfigurationSourceProvider)2 JdbiExceptionsBundle (io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle)2 PrometheusBundle (org.dhatim.dropwizard.prometheus.PrometheusBundle)2 RenderCommand (com.example.helloworld.cli.RenderCommand)1 ActiveMQBundle (com.kjetland.dropwizard.activemq.ActiveMQBundle)1 ElasticsearchConfiguration (gov.ca.cwds.rest.ElasticsearchConfiguration)1 ApiException (gov.ca.cwds.rest.api.ApiException)1