Example usage for org.springframework.context.support GenericApplicationContext getBeanFactoryPostProcessors

List of usage examples for org.springframework.context.support GenericApplicationContext getBeanFactoryPostProcessors

Introduction

In this page you can find the example usage for org.springframework.context.support GenericApplicationContext getBeanFactoryPostProcessors.

Prototype

public List<BeanFactoryPostProcessor> getBeanFactoryPostProcessors() 

Source Link

Document

Return the list of BeanFactoryPostProcessors that will get applied to the internal BeanFactory.

Usage

From source file:org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.java

private void invokeOnChangeListener(Map event) {
    onChangeListener.setDelegate(this);
    onChangeListener.call(new Object[] { event });

    if (!(applicationContext instanceof GenericApplicationContext)) {
        return;/*from  w w w.j a  v a 2 s. c o  m*/
    }

    // Apply any factory post processors in case the change listener has changed any
    // bean definitions (GRAILS-5763)
    GenericApplicationContext ctx = (GenericApplicationContext) applicationContext;
    ConfigurableListableBeanFactory beanFactory = ctx.getBeanFactory();
    for (BeanFactoryPostProcessor postProcessor : ctx.getBeanFactoryPostProcessors()) {
        try {
            postProcessor.postProcessBeanFactory(beanFactory);
        } catch (IllegalStateException e) {
            // post processor doesn't allow running again, just continue
        }
    }
}

From source file:org.openadaptor.spring.SpringAdaptor.java

/**
 * Checks for the existence of a already defined property configurer in the given context.
 *///from   w w  w  .j  a v  a  2s. c om
private boolean isPropertyPlaceholderPresent(GenericApplicationContext context) {
    for (BeanFactoryPostProcessor bfpp : context.getBeanFactoryPostProcessors()) {
        if (bfpp instanceof PlaceholderConfigurerSupport) {
            return true;
        }
    }
    return false;
}