@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(final Bootstrap<AuthriteServiceConfiguration> bootstrap) { bootstrap.addBundle(new Java8Bundle()); if (useClasspathAssets) { bootstrap.addBundle(new AssetsBundle("/assets/", "/")); } else { bootstrap.addBundle(new FileAssetsBundle("src/main/resources/assets", "/")); } bootstrap.addBundle(new MigrationsBundle<AuthriteServiceConfiguration>() { @Override public DataSourceFactory getDataSourceFactory(final AuthriteServiceConfiguration configuration) { return configuration.getDatabase(); } }); }
@Override public void initialize(Bootstrap<TodoListConfiguration> bootstrap) { ebeanBundle = new EbeanBundle(); //rabbitMqBundle = new RabbitMQBundle(); // This outputs xDateTimes as ISO strings rather than an array of numbers in JSON. bootstrap.getObjectMapper().disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); bootstrap.addBundle(new Java8Bundle()); bootstrap.addBundle(ebeanBundle); //bootstrap.addBundle(rabbitMqBundle); bootstrap.addBundle(new OAuth2Bundle(ebeanBundle)); bootstrap.addBundle(new TodoClientBundle()); bootstrap.addBundle(new MigrationsBundle<TodoListConfiguration>() { @Override public DataSourceFactory getDataSourceFactory(TodoListConfiguration configuration) { return configuration.getDatabaseConfig(); } }); // The anonymous subclass seems to be needed for the config type to be picked up correctly. bootstrap.addCommand(new WorkersCommand<TodoListConfiguration>(TodoListApplication.this) {}); bootstrap.addCommand(new DbDiffCommand<TodoListConfiguration>() {}); }
@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(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)); }
@Override public void initialize(Bootstrap<CassandraExecutorConfiguration> bootstrap) { super.initialize(bootstrap); bootstrap.addBundle(new Java8Bundle()); bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new StrSubstitutor( new EnvironmentVariableLookup(false)))); }
@Override public void initialize(Bootstrap<KeywhizConfig> bootstrap) { customizeObjectMapper(bootstrap.getObjectMapper()); logger.debug("Registering commands"); bootstrap.addCommand(new PreviewMigrateCommand()); bootstrap.addCommand(new MigrateCommand()); bootstrap.addCommand(new DbSeedCommand()); bootstrap.addCommand(new GenerateAesKeyCommand()); bootstrap.addCommand(new AddUserCommand()); logger.debug("Registering bundles"); bootstrap.addBundle(new Java8Bundle()); }
@Override public void initialize(Bootstrap<DropwizardServerConfiguration> bootstrap) { guiceBundle = GuiceBundle.<DropwizardServerConfiguration>newBuilder() .addModule(new HelloModule()) .addModule(new CarModule()) .setConfigClass(DropwizardServerConfiguration.class) .build(); bootstrap.addBundle(guiceBundle); bootstrap.addBundle(new Java8Bundle()); ObjectMapper objectMapper = bootstrap.getObjectMapper(); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); }
@Override public void initialize(Bootstrap<CivilizationConfiguration> bootstrap) { bootstrap.addBundle(new Java8Bundle()); bootstrap.addBundle(new AssetsBundle()); }
@Override public void initialize(Bootstrap<CivilizationTestConfiguration> bootstrap) { bootstrap.addBundle(new Java8Bundle()); bootstrap.addBundle(new AssetsBundle()); }