本文整理汇总了Java中io.dropwizard.java8.Java8Bundle类的典型用法代码示例。如果您正苦于以下问题:Java Java8Bundle类的具体用法?Java Java8Bundle怎么用?Java Java8Bundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Java8Bundle类属于io.dropwizard.java8包,在下文中一共展示了Java8Bundle类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的package包/类
@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)
)
);
}
示例2: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的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();
}
});
}
示例3: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的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>() {});
}
示例4: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的package包/类
@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);
}
示例5: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的package包/类
@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));
}
示例6: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的package包/类
@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))));
}
示例7: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的package包/类
@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());
}
示例8: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的package包/类
@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);
}
示例9: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<CivilizationConfiguration> bootstrap) {
bootstrap.addBundle(new Java8Bundle());
bootstrap.addBundle(new AssetsBundle());
}
示例10: initialize
import io.dropwizard.java8.Java8Bundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<CivilizationTestConfiguration> bootstrap) {
bootstrap.addBundle(new Java8Bundle());
bootstrap.addBundle(new AssetsBundle());
}
开发者ID:cash1981,项目名称:civilization-boardgame-rest,代码行数:6,代码来源:CivilizationIntegrationTestApplication.java