Java 类io.dropwizard.flyway.FlywayBundle 实例源码

项目:dropwizard-guicey-examples    文件:JdbiApplication.java   
@Override
public void initialize(Bootstrap<JdbiAppConfiguration> bootstrap) {

    bootstrap.addBundle(GuiceBundle.builder()
            .enableAutoConfig(JdbiApplication.class.getPackage().getName())
            .bundles(JdbiBundle.<JdbiAppConfiguration>forDatabase((conf, env) -> conf.getDatabase()))
            .build());
    // used for manual run to init db
    bootstrap.addBundle(new FlywayBundle<JdbiAppConfiguration>() {
        @Override
        public PooledDataSourceFactory getDataSourceFactory(JdbiAppConfiguration configuration) {
            return configuration.getDatabase();
        }
    });
}