本文整理了Java中org.springframework.context.ApplicationContext.getDisplayName()
方法的一些代码示例,展示了ApplicationContext.getDisplayName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationContext.getDisplayName()
方法的具体详情如下:
包路径:org.springframework.context.ApplicationContext
类名称:ApplicationContext
方法名:getDisplayName
[英]Return a friendly name for this context.
[中]返回此上下文的友好名称。
代码示例来源:origin: spring-projects/spring-framework
/**
* Return information about this context.
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder(getDisplayName());
sb.append(", started on ").append(new Date(getStartupDate()));
ApplicationContext parent = getParent();
if (parent != null) {
sb.append(", parent: ").append(parent.getDisplayName());
}
return sb.toString();
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
if (applicationContext.getDisplayName().contains("listener")) {
applicationContext.getBean("listener");
}
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
if (applicationContext.getDisplayName().contains("listener")) {
applicationContext.getBean("listener");
}
}
代码示例来源:origin: org.springframework/spring-context
/**
* Return information about this context.
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder(getDisplayName());
sb.append(", started on ").append(new Date(getStartupDate()));
ApplicationContext parent = getParent();
if (parent != null) {
sb.append(", parent: ").append(parent.getDisplayName());
}
return sb.toString();
}
代码示例来源:origin: stackoverflow.com
public void onApplicationEvent(ContextRefreshedEvent event) {
ApplicationContext context = event.getApplicationContext();
System.out.println(context.getDisplayName());
}
代码示例来源:origin: org.echocat.jomon.spring/common
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
if (_name == null) {
_name = applicationContext.getDisplayName();
}
}
代码示例来源:origin: org.kuali.student.core/ks-common-util
@Override
public String getDisplayName() {
return applicationContext.getDisplayName();
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-common
/**
* @return
* @see org.springframework.context.ApplicationContext#getDisplayName()
*/
public String getDisplayName() {
return target.getDisplayName();
}
代码示例来源:origin: net.sf.taverna.t2.infrastructure/platform-spring
/**
* Delegates to internal ApplicationContext supplied by constructor
*/
public final String getDisplayName() {
return context.getDisplayName();
}
代码示例来源:origin: com.foreach.across/across-core
public static String forContext( ApplicationContext applicationContext ) {
if ( StringUtils.equals( "Root WebApplicationContext", applicationContext.getDisplayName() ) ) {
return PREFIX + SUFFIX + "# " + applicationContext.getDisplayName();
}
else {
return PREFIX + SUFFIX + applicationContext.getDisplayName();
}
}
}
代码示例来源:origin: org.eobjects.datacleaner/DataCleaner-monitor-services
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
System.out.println("The application context has been initialized: " + applicationContext.getDisplayName());
_applicationContext = applicationContext;
}
}
代码示例来源:origin: org.apache.xbean/xbean-server
public void run() {
try {
String name = "";
if (applicationContext != null) {
name = applicationContext.getDisplayName();
}
processDirectory(name, classLoader, applicationContext, baseDir);
}
catch (Exception e) {
log.error("Failed to deploy services: " + e, e);
}
}
代码示例来源:origin: apache/archiva
@Override
public String getDisplayName()
{
return applicationContext.getDisplayName();
}
代码示例来源:origin: OpenWiseSolutions/openhub-framework
@Override
public void onApplicationEvent(ApplicationContextEvent event) {
Assert.notNull(event, "event must not be null");
ApplicationContext applicationContext = event.getApplicationContext();
//remove context from created registry
applicationContextsRegistry.remove(applicationContext);
//add new found contexts
if (event instanceof ContextRefreshedEvent || event instanceof ContextStartedEvent) {
LOG.info("Create new registry for context '{}.'", applicationContext.getDisplayName());
applicationContextsRegistry.put(applicationContext, new ApplicationContextRegistry(applicationContext));
}
}
代码示例来源:origin: org.motechproject/motech-platform-web-security
public void processAnnotations(ApplicationContext applicationContext) {
LOGGER.info("Searching for security annotations in: {}", applicationContext.getDisplayName());
currentBundleName = getBundleName(applicationContext);
for (String beanName : applicationContext.getBeanDefinitionNames()) {
Object bean = applicationContext.getBean(beanName);
postProcessAfterInitialization(bean, beanName);
}
LOGGER.info("Searched for security annotations in: {}", applicationContext.getDisplayName());
}
代码示例来源:origin: infiniteautomation/ma-core-public
@EventListener
private void contextStarted(ContextStartedEvent event) {
ApplicationContext context = event.getApplicationContext();
if (log.isInfoEnabled()) {
log.info("Spring context '" + context.getId() +"' started: " + context.getDisplayName());
}
}
代码示例来源:origin: org.kuali.rice/rice-krad-development-tools
@Override
public void onApplicationEvent(ContextClosedEvent e) {
LOG.info("Context '" + e.getApplicationContext().getDisplayName() +
"' closed, shutting down URLMonitor scheduler");
dictionaryUrlMonitor.shutdownScheduler();
}
});
代码示例来源:origin: com.foreach.across.modules/debug-web-module
private static ContextDebugInfo createForApplicationContext( ApplicationContext applicationContext ) {
ContextDebugInfo debugInfo = new ContextDebugInfo( applicationContext.getDisplayName(), applicationContext );
debugInfo.setEnabled( true );
return debugInfo;
}
}
代码示例来源:origin: com.liferay/com.liferay.portal.spring.extender
private void _refreshBeanFactory(ApplicationContext applicationContext) {
try {
BeanReferenceRefreshUtil.refresh(
applicationContext.getAutowireCapableBeanFactory());
}
catch (Exception e) {
_log.error(
StringBundler.concat(
"Unable to refresh ", applicationContext.getDisplayName(),
". This may result in memory leaks on multiple ",
"redeployments."));
}
}
代码示例来源:origin: com.foreach.across.modules/debug-web-module
private static ContextDebugInfo createForContext( AcrossContextInfo context ) {
ApplicationContext applicationContext = context.getApplicationContext();
ContextDebugInfo debugInfo = new ContextDebugInfo( applicationContext.getDisplayName(),
context.getApplicationContext() );
debugInfo.setEnabled( true );
debugInfo.setContextInfo( context );
return debugInfo;
}
内容来源于网络,如有侵权,请联系作者删除!