本文整理了Java中io.dropwizard.setup.Bootstrap.<init>()
方法的一些代码示例,展示了Bootstrap.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bootstrap.<init>()
方法的具体详情如下:
包路径:io.dropwizard.setup.Bootstrap
类名称:Bootstrap
方法名:<init>
[英]Creates a new Bootstrap for the given application.
[中]为给定的应用程序创建新的引导。
代码示例来源:origin: dropwizard/dropwizard
/**
* Parses command-line arguments and runs the application. Call this method from a {@code public
* static void main} entry point in your application.
*
* @param arguments the command-line arguments
* @throws Exception if something goes wrong
*/
public void run(String... arguments) throws Exception {
final Bootstrap<T> bootstrap = new Bootstrap<>(this);
addDefaultCommands(bootstrap);
initialize(bootstrap);
// Should be called after initialize to give an opportunity to set a custom metric registry
bootstrap.registerMetrics();
final Cli cli = new Cli(new JarLocation(getClass()), bootstrap, System.out, System.err);
if (!cli.run(arguments)) {
// only exit if there's an error running the command
onFatalError();
}
}
代码示例来源:origin: io.dropwizard/dropwizard-core
/**
* Parses command-line arguments and runs the application. Call this method from a {@code public
* static void main} entry point in your application.
*
* @param arguments the command-line arguments
* @throws Exception if something goes wrong
*/
public void run(String... arguments) throws Exception {
final Bootstrap<T> bootstrap = new Bootstrap<>(this);
addDefaultCommands(bootstrap);
initialize(bootstrap);
// Should be called after initialize to give an opportunity to set a custom metric registry
bootstrap.registerMetrics();
final Cli cli = new Cli(new JarLocation(getClass()), bootstrap, System.out, System.err);
if (!cli.run(arguments)) {
// only exit if there's an error running the command
onFatalError();
}
}
代码示例来源:origin: com.hubspot.dropwizard/dropwizard-guice
@BeforeClass
public static void setup() {
final GuiceBundle bundle = new GuiceBundle.Builder().addModule(new TestModule()).build();
bundle.initialize(new Bootstrap<Configuration>(new Application<Configuration>() {
@Override
public void run(Configuration configuration, Environment environment) throws Exception {
}
}));
injector = bundle.getInjector();
}
内容来源于网络,如有侵权,请联系作者删除!