Search in sources :

Example 1 with DependentResourceWaitCommand

use of uk.gov.pay.products.healthchecks.DependentResourceWaitCommand in project pay-products by alphagov.

the class ProductsApplication method initialize.

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

        @Override
        public DataSourceFactory getDataSourceFactory(ProductsConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    });
    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) ProductsConfiguration(uk.gov.pay.products.config.ProductsConfiguration) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) DependentResourceWaitCommand(uk.gov.pay.products.healthchecks.DependentResourceWaitCommand)

Aggregations

EnvironmentVariableSubstitutor (io.dropwizard.configuration.EnvironmentVariableSubstitutor)1 SubstitutingSourceProvider (io.dropwizard.configuration.SubstitutingSourceProvider)1 DataSourceFactory (io.dropwizard.db.DataSourceFactory)1 ProductsConfiguration (uk.gov.pay.products.config.ProductsConfiguration)1 DependentResourceWaitCommand (uk.gov.pay.products.healthchecks.DependentResourceWaitCommand)1