本文整理了Java中org.springframework.context.ApplicationContext.getApplicationName()
方法的一些代码示例,展示了ApplicationContext.getApplicationName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationContext.getApplicationName()
方法的具体详情如下:
包路径:org.springframework.context.ApplicationContext
类名称:ApplicationContext
方法名:getApplicationName
[英]Return a name for the deployed application that this context belongs to.
[中]返回此上下文所属的已部署应用程序的名称。
代码示例来源:origin: com.consol.citrus/citrus-ws
public String getApplicationName() {
return applicationContext.getApplicationName();
}
public String getDisplayName() {
代码示例来源:origin: unic/neba
@Override
public String getApplicationName() {
return wrapped.getApplicationName();
}
代码示例来源:origin: com.github.drtrang/spring-boot-autoconfigure
public static String getApplicationName() {
return context.getApplicationName();
}
代码示例来源:origin: com.intoverflow.base/intoverflow-util
public static String getApplicationName() {
return appContext.getApplicationName();
}
代码示例来源:origin: org.openl/org.openl.spring
private String getAppName(ApplicationContext appContext) {
String appName = appContext.getApplicationName();
if (appName == null || appName.isEmpty()) {
return "";
}
return appName.replace('/', ' ').replace('\\', ' ').trim().replace(' ', '-');
}
代码示例来源:origin: openl-tablets/openl-tablets
private String getAppName(ApplicationContext appContext) {
String appName = appContext.getApplicationName();
if (appName == null || appName.isEmpty()) {
return "";
}
return appName.replace('/', ' ').replace('\\', ' ').trim().replace(' ', '-');
}
代码示例来源:origin: apache/archiva
@Override
public String getApplicationName()
{
return applicationContext.getApplicationName();
}
代码示例来源:origin: com.intoverflow.booster/booster-core
public static String getApplicationName() {
return getApplicationContext().getApplicationName();
}
代码示例来源:origin: Yirendai/cicada
public static String getAppName(final String defaultValue) {
String retValue = null;
final ApplicationConfig application = getBean(ApplicationConfig.class, null);
if (application != null) {
retValue = application.getName();
}
if (StringUtils.isBlank(retValue) && applicationContext != null) {
retValue = applicationContext.getApplicationName();
}
if (StringUtils.isBlank(retValue)) {
retValue = defaultValue;
}
return retValue;
}
}
代码示例来源:origin: org.kuali.common/kuali-util
public static void debug(ApplicationContext ctx) {
logger.debug("------------------------ Spring Context ------------------------------");
logger.debug("Id: [{}]", ctx.getId());
logger.debug("Display Name: [{}]", ctx.getDisplayName());
logger.debug("Application Name: [{}]", ctx.getApplicationName());
logger.debug("----------------------------------------------------------------------");
List<String> names = Arrays.asList(BeanFactoryUtils.beanNamesIncludingAncestors(ctx));
List<String> columns = Arrays.asList("Name", "Type", "Hashcode");
List<Object[]> rows = new ArrayList<Object[]>();
Collections.sort(names);
for (String name : names) {
Object bean = ctx.getBean(name);
String instance = (bean == null) ? NullUtils.NULL : bean.getClass().getSimpleName();
String hashcode = (bean == null) ? NullUtils.NULL : Integer.toHexString(bean.hashCode());
Object[] row = { name, instance, hashcode };
rows.add(row);
}
LoggerUtils.logTable(columns, rows, LoggerLevel.DEBUG, logger, true);
logger.debug("----------------------------------------------------------------------");
}
代码示例来源:origin: org.springframework.boot/spring-boot-test
@Override
public String toString() {
if (this.startupFailure != null) {
return "Unstarted application context "
+ this.applicationContextType.getName() + "[startupFailure="
+ this.startupFailure.getClass().getName() + "]";
}
ToStringCreator builder = new ToStringCreator(this.applicationContext)
.append("id", this.applicationContext.getId())
.append("applicationName", this.applicationContext.getApplicationName())
.append("beanDefinitionCount",
this.applicationContext.getBeanDefinitionCount());
return "Started application " + builder;
}
代码示例来源:origin: net.shibboleth.idp/idp-profile-impl
while (current != null) {
log.debug("Spring Context: {}", current.toString());
log.debug("Spring Context Name: {}", current.getApplicationName());
log.debug("Spring Context Parent: {}", current.getParent());
log.debug("");
代码示例来源:origin: org.ikasan/ikasan-module
String context = platformContext.getApplicationName();
String serverName = "http://" + host + ":" + port + "/" + context;
String serverUrl = "http://" + host;
代码示例来源:origin: org.openbaton/vim-int
pluginTimeout);
} else {
log.trace("Using context: " + context.getApplicationName());
try {
client =
代码示例来源:origin: openbaton/NFVO
pluginTimeout);
} else {
log.trace("Using context: " + context.getApplicationName());
try {
client =
代码示例来源:origin: org.ikasan/ikasan-module
existingModule = new org.ikasan.topology.model.Module(module.getName(), platformContext.getApplicationName(),
module.getDescription(), module.getVersion(), null, null);
if (existingServer.isPresent())
内容来源于网络,如有侵权,请联系作者删除!