本文整理了Java中io.dropwizard.Application.getName()
方法的一些代码示例,展示了Application.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.getName()
方法的具体详情如下:
包路径:io.dropwizard.Application
类名称:Application
方法名:getName
[英]Returns the name of the application.
[中]返回应用程序的名称。
代码示例来源:origin: dropwizard/dropwizard
@Override
@SuppressWarnings("unchecked")
public void run(Bootstrap<?> wildcardBootstrap, Namespace namespace) throws Exception {
final Bootstrap<T> bootstrap = (Bootstrap<T>) wildcardBootstrap;
configuration = parseConfiguration(bootstrap.getConfigurationFactoryFactory(),
bootstrap.getConfigurationSourceProvider(),
bootstrap.getValidatorFactory().getValidator(),
namespace.getString("file"),
getConfigurationClass(),
bootstrap.getObjectMapper());
try {
if (configuration != null) {
configuration.getLoggingFactory().configure(bootstrap.getMetricRegistry(),
bootstrap.getApplication().getName());
}
run(bootstrap, namespace, configuration);
} finally {
if (!asynchronous) {
cleanup();
}
}
}
代码示例来源:origin: dropwizard/dropwizard
@Override
protected void run(Bootstrap<T> bootstrap, Namespace namespace, T configuration) throws Exception {
final Environment environment = new Environment(bootstrap.getApplication().getName(),
bootstrap.getObjectMapper(),
bootstrap.getValidatorFactory(),
bootstrap.getMetricRegistry(),
bootstrap.getClassLoader(),
bootstrap.getHealthCheckRegistry());
configuration.getMetricsFactory().configure(environment.lifecycle(),
bootstrap.getMetricRegistry());
configuration.getServerFactory().configure(environment);
bootstrap.run(configuration, environment);
application.run(configuration, environment);
run(environment, namespace, configuration);
}
代码示例来源:origin: rvs-fluid-it/wizard-in-a-box
@Override
public String getName() {
return dropwizardApplication.getName() + "-war";
}
代码示例来源:origin: io.dropwizard/dropwizard-core
@Override
@SuppressWarnings("unchecked")
public void run(Bootstrap<?> wildcardBootstrap, Namespace namespace) throws Exception {
final Bootstrap<T> bootstrap = (Bootstrap<T>) wildcardBootstrap;
configuration = parseConfiguration(bootstrap.getConfigurationFactoryFactory(),
bootstrap.getConfigurationSourceProvider(),
bootstrap.getValidatorFactory().getValidator(),
namespace.getString("file"),
getConfigurationClass(),
bootstrap.getObjectMapper());
try {
if (configuration != null) {
configuration.getLoggingFactory().configure(bootstrap.getMetricRegistry(),
bootstrap.getApplication().getName());
}
run(bootstrap, namespace, configuration);
} finally {
if (!asynchronous) {
cleanup();
}
}
}
代码示例来源:origin: io.dropwizard/dropwizard-core
@Override
protected void run(Bootstrap<T> bootstrap, Namespace namespace, T configuration) throws Exception {
final Environment environment = new Environment(bootstrap.getApplication().getName(),
bootstrap.getObjectMapper(),
bootstrap.getValidatorFactory().getValidator(),
bootstrap.getMetricRegistry(),
bootstrap.getClassLoader(),
bootstrap.getHealthCheckRegistry());
configuration.getMetricsFactory().configure(environment.lifecycle(),
bootstrap.getMetricRegistry());
configuration.getServerFactory().configure(environment);
bootstrap.run(configuration, environment);
application.run(configuration, environment);
run(environment, namespace, configuration);
}
代码示例来源:origin: org.lwapp/lwapp-dropwizard-core
@Override
public String getName() {
return StringUtils.defaultString(applicationServerConfig.getCoreConfiguration().getApplicationName(), super.getName());
}
代码示例来源:origin: trellis-ldp/trellis
@Test
public void testGetName() {
final Application<AppConfiguration> app = new TrellisApplication();
assertEquals("Trellis LDP", app.getName(), "Incorrect application name!");
}
代码示例来源:origin: trellis-ldp/trellis
@Test
public void testGetName() {
final Application<TrellisConfiguration> app = new SimpleTrellisApp();
assertEquals("Trellis LDP", app.getName(), "Incorrect application name!");
}
内容来源于网络,如有侵权,请联系作者删除!