Spring Framework ApplicationContextEvent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ApplicationContextEvent class.

This code example shows how to use the following methods:getApplicationContext
            throws BeansException {
        this.ctx = applicationContext;
    } 
 
    public void onApplicationEvent(ContextRefreshedEvent event) {
        if (event.getApplicationContext() != ctx && !handleOthers) {
            if (log.isDebugEnabled()) { 
                log.debug("Ignoring other application context refresh: " + ctx);
            } 
            return; 
        } 
 
        int current = count.incrementAndGet();
        if (current > limit) {
            if (log.isDebugEnabled()) { 
                log.debug("Ignoring refresh beyond limit: " + current);
            } 
            return; 
        } 
        handleContextRefreshedEvent(event);
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getApplicationContext
			beanFactory.setBeanExpressionResolver(new PostProcessorAwareStandardBeanExpressionResolver()); 
		} 
	} 
 
	public void onApplicationEvent(ContextRefreshedEvent event) { 
		ApplicationContext ctx = event.getApplicationContext(); 
		this.postProcessors = BeanFactoryUtils.beansOfTypeIncludingAncestors(ctx, 
				StandardEvaluationContextPostProcessor.class).values(); 
	} 
 
	/** 
	 * Strategy method used to determine of a {@link BeanExpressionResolver} can be replaced with a 
	 * {@link StandardEvaluationContextPostProcessor} aware variant. By default only 
	 * {@link StandardBeanExpressionResolver}s can be replaced. 
	 * @param beanExpressionResolver the bean expression resolver being considered 
	 * @return <tt>true</tt> if the resolver can be replaced 
	 */ 
	protected boolean isReplaceable(BeanExpressionResolver beanExpressionResolver) { 
		return beanExpressionResolver.getClass().equals(StandardBeanExpressionResolver.class); 
	} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getApplicationContext
			Object handler, Exception ex) throws Exception { 
		return this.delegate.processHandlerException(request, response, handler, ex); 
	} 
 
	public void onApplicationEvent(ContextRefreshedEvent event) { 
		this.delegate.onRefresh(event.getApplicationContext()); 
	} 
 
	/** 
	 * See {@link DispatcherServlet#setDetectAllHandlerMappings(boolean)} for details. 
	 * @param detectAllHandlerMappings 
	 * @see DispatcherServlet#setDetectAllHandlerMappings(boolean) 
	 */ 
	public void setDetectAllHandlerMappings(boolean detectAllHandlerMappings) { 
		this.delegate.setDetectAllHandlerMappings(detectAllHandlerMappings); 
	} 
 
	/** 
	 * See {@link DispatcherServlet#setDetectAllHandlerAdapters(boolean)} for details. 
	 * @param detectAllHandlerAdapters 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getApplicationContext
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	} 
 
	public void onApplicationEvent(ContextRefreshedEvent event) {
		ApplicationContext applicationContext = event.getApplicationContext();
		if (applicationContext == this.applicationContext) {
			collectConverterBeans(); 
		} 
	} 
 
	/** 
	 * Collects all relevant spring beans to the converters map. 
	 */ 
	private void collectConverterBeans() { 
		this.converters = new HashMap<String, Object>();
		this.converters.putAll(beansOfType(this.applicationContext, FACES_CONVERTER_TYPE));
		this.converters.putAll(beansOfType(this.applicationContext, CONVERTER_TYPE));
	} 
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getApplicationContext
        super(concurrentStatsCollector, Retention.YEARLY, FILE_BASENAME);
        this.taskScheduler = taskScheduler;
    } 
     
    public void onApplicationEvent(ContextRefreshedEvent event) {
        if (event.getApplicationContext() != this.applicationContext) {
            return; 
        } 
        startWriter(); 
    } 
 
    @Override 
    protected ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Date startTime, long delay) {
        return taskScheduler.scheduleWithFixedDelay(task, startTime, delay);
    } 
 
    @Override 
    protected String getAndSetupBasedir() {
    	final char fs = File.separatorChar;
    	String basedir = null;
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getApplicationContext
	 * @param event the incoming ApplicationContext event 
	 */ 
	@Override 
	public void onApplicationEvent(ContextRefreshedEvent event) {
		this.refreshEventReceived = true;
		onRefresh(event.getApplicationContext());
	} 
 
	/** 
	 * Template method which can be overridden to add portlet-specific refresh work. 
	 * Called after successful context refresh. 
	 * <p>This implementation is empty. 
	 * @param context the current Portlet ApplicationContext 
	 * @see #refresh() 
	 */ 
	protected void onRefresh(ApplicationContext context) {
		// For subclasses: do nothing by default. 
	} 
 
 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getApplicationContext
	private IActivityInstRepository actInstRep;
	private IWorkItemRepository workItemRep;
	 
	public AbstractFlowEvent(ApplicationContext source) {
		super(source);
		this.procInstRep = this.getApplicationContext().getBean(IProcessInstanceRepository.class);
		this.actInstRep = this.getApplicationContext().getBean(IActivityInstRepository.class);
		this.workItemRep = this.getApplicationContext().getBean(IWorkItemRepository.class);
	} 
 
	public ProcessEngine getProcessEngine() { 
		return processEngine;
	} 
 
	public void setProcessEngine(ProcessEngine processEngine) {
		this.processEngine = processEngine;
	} 
 
	public ProcessInstance getProcessInstance() { 
		return processInstance;
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Spring Framework ApplicationContextEvent Methods: