/** * 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(); }
@Override public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; if (applicationContext.getDisplayName().contains("listener")) { applicationContext.getBean("listener"); } }
@Override public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; if (applicationContext.getDisplayName().contains("listener")) { applicationContext.getBean("listener"); } }
/** * 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(); }
public void onApplicationEvent(ContextRefreshedEvent event) { ApplicationContext context = event.getApplicationContext(); System.out.println(context.getDisplayName()); }
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { if (_name == null) { _name = applicationContext.getDisplayName(); } }
@Override public String getDisplayName() { return applicationContext.getDisplayName(); }
/** * @return * @see org.springframework.context.ApplicationContext#getDisplayName() */ public String getDisplayName() { return target.getDisplayName(); }
/** * Delegates to internal ApplicationContext supplied by constructor */ public final String getDisplayName() { return context.getDisplayName(); }
public static String forContext( ApplicationContext applicationContext ) { if ( StringUtils.equals( "Root WebApplicationContext", applicationContext.getDisplayName() ) ) { return PREFIX + SUFFIX + "# " + applicationContext.getDisplayName(); } else { return PREFIX + SUFFIX + applicationContext.getDisplayName(); } } }
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { System.out.println("The application context has been initialized: " + applicationContext.getDisplayName()); _applicationContext = applicationContext; } }
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); } }
@Override public String getDisplayName() { return applicationContext.getDisplayName(); }
@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)); } }
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()); }
@EventListener private void contextStarted(ContextStartedEvent event) { ApplicationContext context = event.getApplicationContext(); if (log.isInfoEnabled()) { log.info("Spring context '" + context.getId() +"' started: " + context.getDisplayName()); } }
@Override public void onApplicationEvent(ContextClosedEvent e) { LOG.info("Context '" + e.getApplicationContext().getDisplayName() + "' closed, shutting down URLMonitor scheduler"); dictionaryUrlMonitor.shutdownScheduler(); } });
private static ContextDebugInfo createForApplicationContext( ApplicationContext applicationContext ) { ContextDebugInfo debugInfo = new ContextDebugInfo( applicationContext.getDisplayName(), applicationContext ); debugInfo.setEnabled( true ); return debugInfo; } }
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.")); } }
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; }