本文整理汇总了Java中io.dropwizard.setup.Bootstrap.addCommand方法的典型用法代码示例。如果您正苦于以下问题:Java Bootstrap.addCommand方法的具体用法?Java Bootstrap.addCommand怎么用?Java Bootstrap.addCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.dropwizard.setup.Bootstrap
的用法示例。
在下文中一共展示了Bootstrap.addCommand方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的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.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(
bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor()
)
);
bootstrap.addCommand(new TestCommand(this,
Optional.empty(),
//testDescription(AssetIntegrationTest.class, "newAssetMustHaveId"),
SmokeTest.class,
ServerIntegrationTest.class,
GroupIntegrationTest.class,
ApplicationIntegrationTest.class,
AssetIntegrationTest.class,
SearchIntegrationTest.class
));
}
示例3: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {
final List<ViewRenderer> renderers = Arrays.asList(new MarkdownViewRenderer(), new HtmlViewRenderer(), new MustacheViewRenderer());
bootstrap.addBundle(new ViewBundle<SamConfiguration>(renderers));
bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.mustache", "static"));
bootstrap.addBundle(new AssetsBundle("/docs", "/docs", "index.html", "docs"));
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(
bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor()
)
);
bootstrap.addCommand(new OAuth2Command());
bootstrap.addCommand(new CreateDatabaseCommand(this));
bootstrap.addCommand(new AddTestdataCommand(this));
}
示例4: run
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void run(final String... arguments) throws Exception {
final Bootstrap<AppConfiguration> bootstrap = new Bootstrap<>(this);
bootstrap.addCommand(command);
initialize(bootstrap);
ObjectMapper objectMapper = bootstrap.getObjectMapper();
bootstrap.getObjectMapper()
.setVisibilityChecker(objectMapper.getSerializationConfig().getDefaultVisibilityChecker()
.withFieldVisibility(JsonAutoDetect.Visibility.ANY)
.withGetterVisibility(JsonAutoDetect.Visibility.NONE)
.withSetterVisibility(JsonAutoDetect.Visibility.NONE)
.withCreatorVisibility(JsonAutoDetect.Visibility.NONE));
final Cli cli = new Cli(new JarLocation(getClass()), bootstrap, System.out, System.err);
if (!cli.run(arguments)) {
System.exit(1);
}
}
示例5: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
public void initialize(Bootstrap<ApplicationConfig> configurationBootstrap) {
configurationBootstrap.addCommand(new NewCommand());
configurationBootstrap.addCommand(new GenerateCommand());
configurationBootstrap.addCommand(new UsersCommand());
configurationBootstrap.addCommand(new ValidateCommand());
configurationBootstrap.addCommand(new RunCommand());
}
示例6: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<EmoConfiguration> bootstrap) {
bootstrap.addCommand(new CreateKeyspacesCommand());
bootstrap.addCommand(new RegisterCassandraCommand());
bootstrap.addCommand(new ListCassandraCommand());
bootstrap.addCommand(new UnregisterCassandraCommand());
bootstrap.addCommand(new PurgeDatabusEventsCommand());
bootstrap.addCommand(new AllTablesReportCommand());
bootstrap.addCommand(new EncryptConfigurationApiKeyCommand());
// Write Date objects using ISO8601 strings instead of numeric milliseconds-since-1970.
bootstrap.getObjectMapper().setDateFormat(new ISO8601DateFormat());
bootstrap.getObjectMapper().registerModule(new LazyJsonModule());
bootstrap.getMetricRegistry().register("jvm.gc.totals", new EmoGarbageCollectorMetricSet());
}
示例7: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<KeystoreConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(
bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
bootstrap.addCommand(new TLSTruststoreTestCommand<>(this));
}
示例8: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public final void initialize(Bootstrap<?> bootstrap) {
final Class<T> klass = (Class<T>) bootstrap.getApplication().getConfigurationClass();
bootstrap.addCommand(new DbCommand<>(name(), this, klass, getMigrationsFileName()));
}
示例9: initialize
import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<KTSDConfiguration> bootstrap) {
super.initialize(bootstrap);
bootstrap.addCommand(new PutBench(this));
}