本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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();
}
});
}
示例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"));
}
示例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);
}
示例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>() {});
}
示例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());
}
示例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>());
}
示例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();
}
});
}
示例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();
}
});
}
示例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);
}
示例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();
}
});
}
示例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();
}
};
}