io.dropwizard.Application.getName()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(78)

本文整理了Java中io.dropwizard.Application.getName()方法的一些代码示例,展示了Application.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.getName()方法的具体详情如下:
包路径:io.dropwizard.Application
类名称:Application
方法名:getName

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!");
}

相关文章