Search in sources :

Example 1 with RenderCommand

use of com.example.helloworld.cli.RenderCommand in project dropwizard by dropwizard.

the class HelloWorldApplication method initialize.

@Override
public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    bootstrap.addCommand(new RenderCommand());
    bootstrap.addBundle(new AssetsBundle());
    bootstrap.addBundle(new MigrationsBundle<HelloWorldConfiguration>() {

        @Override
        public DataSourceFactory getDataSourceFactory(HelloWorldConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    });
    bootstrap.addBundle(hibernateBundle);
    bootstrap.addBundle(new ViewBundle<HelloWorldConfiguration>() {

        @Override
        public Map<String, Map<String, String>> getViewConfiguration(HelloWorldConfiguration configuration) {
            return configuration.getViewRendererConfiguration();
        }
    });
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) RenderCommand(com.example.helloworld.cli.RenderCommand) DataSourceFactory(io.dropwizard.db.DataSourceFactory) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) AssetsBundle(io.dropwizard.assets.AssetsBundle) Map(java.util.Map)

Aggregations

RenderCommand (com.example.helloworld.cli.RenderCommand)1 AssetsBundle (io.dropwizard.assets.AssetsBundle)1 EnvironmentVariableSubstitutor (io.dropwizard.configuration.EnvironmentVariableSubstitutor)1 SubstitutingSourceProvider (io.dropwizard.configuration.SubstitutingSourceProvider)1 DataSourceFactory (io.dropwizard.db.DataSourceFactory)1 Map (java.util.Map)1