Search in sources :

Example 1 with DependentResourceWaitCommand

use of uk.gov.pay.ledger.healthcheck.DependentResourceWaitCommand 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)

Aggregations

EnvironmentVariableSubstitutor (io.dropwizard.configuration.EnvironmentVariableSubstitutor)1 SubstitutingSourceProvider (io.dropwizard.configuration.SubstitutingSourceProvider)1 DataSourceFactory (io.dropwizard.db.DataSourceFactory)1 JdbiExceptionsBundle (io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle)1 DependentResourceWaitCommand (uk.gov.pay.ledger.healthcheck.DependentResourceWaitCommand)1