Java 类io.dropwizard.java8.Java8Bundle 实例源码

项目:StopCozi-api    文件:Server.java   
@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)
        )
    );
}
项目:authrite    文件:AuthriteServiceApplication.java   
@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();
        }
    });
}
项目:dropwizard-experiment    文件:TodoListApplication.java   
@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>() {});
}
项目:outland    文件:ServerMain.java   
@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);
}
项目:dcos-cassandra-service    文件:Main.java   
@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));
}
项目:dcos-cassandra-service    文件:Main.java   
@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))));
}
项目:keywhiz    文件:KeywhizService.java   
@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());
}
项目:microservices-comparison    文件:DropwizardApplication.java   
@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);
}
项目:civilization-boardgame-rest    文件:CivilizationApplication.java   
@Override
public void initialize(Bootstrap<CivilizationConfiguration> bootstrap) {
    bootstrap.addBundle(new Java8Bundle());
    bootstrap.addBundle(new AssetsBundle());
}
项目:civilization-boardgame-rest    文件:CivilizationIntegrationTestApplication.java   
@Override
public void initialize(Bootstrap<CivilizationTestConfiguration> bootstrap) {
    bootstrap.addBundle(new Java8Bundle());
    bootstrap.addBundle(new AssetsBundle());
}