当前位置: 首页>>代码示例>>Java>>正文


Java MigrationsBundle类代码示例

本文整理汇总了Java中io.dropwizard.migrations.MigrationsBundle的典型用法代码示例。如果您正苦于以下问题:Java MigrationsBundle类的具体用法?Java MigrationsBundle怎么用?Java MigrationsBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MigrationsBundle类属于io.dropwizard.migrations包,在下文中一共展示了MigrationsBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<AdminUsersConfig> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(NON_STRICT_VARIABLE_SUBSTITUTOR)
            )
    );

    bootstrap.addBundle(new MigrationsBundle<AdminUsersConfig>() {
        @Override
        public DataSourceFactory getDataSourceFactory(AdminUsersConfig configuration) {
            return configuration.getDataSourceFactory();
        }
    });

    bootstrap.addCommand(new DependentResourceWaitCommand());
    bootstrap.addCommand(new MigrateToInitialDbState());
}
 
开发者ID:alphagov,项目名称:pay-adminusers,代码行数:19,代码来源:AdminUsersApp.java

示例2: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(final Bootstrap<ProductCatalogConfiguration> bootstrap) {
	bootstrap.addBundle(discoveryBundle);
	bootstrap.addBundle(new MigrationsBundle<ProductCatalogConfiguration>() {

		@Override
		public PooledDataSourceFactory getDataSourceFactory(ProductCatalogConfiguration configuration) {
			return configuration.getDataSourceFactory();
		}
	});
	guiceBundle = GuiceBundle.<ProductCatalogConfiguration> newBuilder().addModule(new ProductCatalogModule())
			.enableAutoConfig(getClass().getPackage().getName()).setConfigClass(ProductCatalogConfiguration.class)
			.build(Stage.PRODUCTION);
	bootstrap.addBundle(guiceBundle);
	// Uncomment below to read the yaml file from Jar
	// bootstrap.setConfigurationSourceProvider(new
	// ResourceConfigurationSourceProvider());
}
 
开发者ID:G1GC,项目名称:dropwizard-microservices-example,代码行数:19,代码来源:ProductCatalogApplication.java

示例3: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(final Bootstrap<ProductReviewConfiguration> bootstrap) {
	bootstrap.addBundle(discoveryBundle);
	bootstrap.addBundle(new MigrationsBundle<ProductReviewConfiguration>() {

		@Override
		public PooledDataSourceFactory getDataSourceFactory(ProductReviewConfiguration configuration) {
			return configuration.getDataSourceFactory();
		}
	});
	guiceBundle = GuiceBundle.<ProductReviewConfiguration> newBuilder().addModule(new ProductReviewModule())
			.enableAutoConfig(getClass().getPackage().getName()).setConfigClass(ProductReviewConfiguration.class)
			.build(Stage.PRODUCTION);
	bootstrap.addBundle(guiceBundle);
	// Uncomment below to read the yaml file from Jar
	// bootstrap.setConfigurationSourceProvider(new
	// ResourceConfigurationSourceProvider());
}
 
开发者ID:G1GC,项目名称:dropwizard-microservices-example,代码行数:19,代码来源:ProductReviewApplication.java

示例4: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<PublicAuthConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    bootstrap.addBundle(new DBIExceptionsBundle());

    bootstrap.addBundle(new MigrationsBundle<PublicAuthConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(PublicAuthConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    });

    bootstrap.addCommand(new DependentResourceWaitCommand());
}
 
开发者ID:alphagov,项目名称:pay-publicauth,代码行数:20,代码来源:PublicAuthApp.java

示例5: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@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();
        }
    });
}
 
开发者ID:lewisd32,项目名称:authrite,代码行数:18,代码来源:AuthriteServiceApplication.java

示例6: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<AppConfiguration> bootstrap) {
    MigrationsBundle<AppConfiguration> migrationBundle = new MigrationsBundle<AppConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(AppConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    };

    // allow using Environment variable in yaml
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(
                    bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    bootstrap.addBundle(migrationBundle);
    bootstrap.addBundle(hibernate);
    bootstrap.addBundle(new ConfiguredAssetsBundle("/app", "/app", "index.html"));
}
 
开发者ID:paukiatwee,项目名称:budgetapp,代码行数:22,代码来源:BudgetApplication.java

示例7: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<NebulaServiceConfiguration> bootstrap) {
  GuiceBundle<NebulaServiceConfiguration> guiceBundle = GuiceBundle.<NebulaServiceConfiguration>newBuilder()
      .addModule(new NebulaServiceModule())
      .enableAutoConfig(getClass().getPackage().getName())
      .setConfigClass(NebulaServiceConfiguration.class)
      .build(Stage.DEVELOPMENT);

  bootstrap.addBundle(guiceBundle);

  // database migrations
  bootstrap.addBundle(new MigrationsBundle<NebulaServiceConfiguration>() {
    @Override
    public DataSourceFactory getDataSourceFactory(NebulaServiceConfiguration configuration) {
      return configuration.getDatabase();
    }
  });

  bootstrap.getObjectMapper().registerModule(new ProtobufModule());
  bootstrap.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
 
开发者ID:HubSpot,项目名称:Nebula,代码行数:22,代码来源:NebulaService.java

示例8: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@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>() {});
}
 
开发者ID:Lugribossk,项目名称:dropwizard-experiment,代码行数:25,代码来源:TodoListApplication.java

示例9: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<SkidRoadDropwizardExampleConfiguration> bootstrap) {

    ObjectMapper om = bootstrap.getObjectMapper();
    om.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
    om.registerModule(new JodaModule());
    om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);

    bootstrap.addBundle(new DBIExceptionsBundle());
    bootstrap.addBundle(new MigrationsBundle<SkidRoadDropwizardExampleConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(SkidRoadDropwizardExampleConfiguration configuration) {
            return configuration.getSkidRoad().getDatabaseConfiguration();
        }
    });
    bootstrap.addCommand(new GenerateRandomKey());
}
 
开发者ID:Multifarious,项目名称:skid-road,代码行数:18,代码来源:SkidRoadDropwizardExampleService.java

示例10: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ServerConfiguration> bootstrap) {

    bootstrap.addBundle(new MigrationsBundle<ServerConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(ServerConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    });

    bootstrap.addBundle(new AssetsBundle("/com/cloudwise/sap/niping/view/static", "/static", null, "static"));
    bootstrap.addBundle(new AssetsBundle("/com/cloudwise/sap/niping/view/vendor", "/vendor", null, "vendor"));
    bootstrap.addBundle(new ViewBundle<ServerConfiguration>());
}
 
开发者ID:CloudWise-OpenSource,项目名称:SAPNetworkMonitor,代码行数:15,代码来源:NiPingMonitorApplication.java

示例11: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<RufusConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/app", "/", "index.html"));
    bootstrap.addBundle(new ViewBundle<>());
    bootstrap.addBundle(new MultiPartBundle());
    bootstrap.addBundle(new MigrationsBundle<RufusConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(RufusConfiguration conf) {
            return conf.getDataSourceFactory();
        }
    });
}
 
开发者ID:jtanza,项目名称:rufus,代码行数:13,代码来源:RufusApplication.java

示例12: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<BlogConfiguration> bootstrap) {
    bootstrap.addBundle(hibernate);
    bootstrap.addBundle(new MigrationsBundle<BlogConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(BlogConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    });
}
 
开发者ID:zslucky,项目名称:dropwizard-myblog,代码行数:11,代码来源:BlogApplication.java

示例13: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(final Bootstrap<T> bootstrap) {
  if (!Strings.isNullOrEmpty(System.getProperty(SINGULARITY_DEFAULT_CONFIGURATION_PROPERTY))) {
    bootstrap.setConfigurationSourceProvider(new MergingSourceProvider(bootstrap.getConfigurationSourceProvider(), System.getProperty(SINGULARITY_DEFAULT_CONFIGURATION_PROPERTY), bootstrap.getObjectMapper(), new YAMLFactory()));
  }

  final Iterable<? extends Module> additionalModules = checkNotNull(getGuiceModules(bootstrap), "getGuiceModules() returned null");
  final Iterable<? extends Bundle> additionalBundles = checkNotNull(getDropwizardBundles(bootstrap), "getDropwizardBundles() returned null");
  final Iterable<? extends ConfiguredBundle<T>> additionalConfiguredBundles = checkNotNull(getDropwizardConfiguredBundles(bootstrap), "getDropwizardConfiguredBundles() returned null");

  final GuiceBundle<SingularityConfiguration> guiceBundle = GuiceBundle.defaultBuilder(SingularityConfiguration.class)
      .modules(new SingularityServiceModule())
      .modules(additionalModules)
      .build();
  bootstrap.addBundle(guiceBundle);

  bootstrap.addBundle(new CorsBundle());
  bootstrap.addBundle(new ViewBundle());
  bootstrap.addBundle(new AssetsBundle("/assets/static/", "/static/"));
  bootstrap.addBundle(new AssetsBundle("/assets/api-docs/", "/api-docs/", "index.html", "api-docs"));
  bootstrap.addBundle(new MigrationsBundle<SingularityConfiguration>() {
    @Override
    public DataSourceFactory getDataSourceFactory(final SingularityConfiguration configuration) {
      return configuration.getDatabaseConfiguration().get();
    }
  });

  for (Bundle bundle : additionalBundles) {
    bootstrap.addBundle(bundle);
  }

  for (ConfiguredBundle<T> configuredBundle : additionalConfiguredBundles) {
    bootstrap.addBundle(configuredBundle);
  }

  bootstrap.getObjectMapper().registerModule(new ProtobufModule());
  bootstrap.getObjectMapper().registerModule(new GuavaModule());
  bootstrap.getObjectMapper().setSerializationInclusion(Include.NON_NULL);
  bootstrap.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:41,代码来源:SingularityService.java

示例14: initialize

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<AppConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/ui", "/", "index.html"));
    bootstrap.addBundle(hibernate);
    bootstrap.addBundle(new MigrationsBundle<AppConfiguration>() {

        @Override
        public PooledDataSourceFactory getDataSourceFactory(AppConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    });
}
 
开发者ID:aytechnologies,项目名称:heroku-gradle-dropwizard,代码行数:13,代码来源:WebApplication.java

示例15: createMigrationBundle

import io.dropwizard.migrations.MigrationsBundle; //导入依赖的package包/类
private MigrationsBundle<AugmentedConfiguration> createMigrationBundle() {
    return new MigrationsBundle<AugmentedConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(final AugmentedConfiguration configuration) {
            return configuration.getRdbmsConfig();
        }
    };
}
 
开发者ID:blstream,项目名称:AugumentedSzczecin_java,代码行数:9,代码来源:AugmentedApplication.java


注:本文中的io.dropwizard.migrations.MigrationsBundle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。