List of usage examples for org.springframework.beans.factory.config BeanFactoryPostProcessor getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.mtgi.analytics.aop.config.ChainingBeanFactoryPostProcessor.java
/** * Filter out excluded post-processors from the chain. Certain post-processors (like spring security) * depend on finding beans in the target factory, so they should be excluded. *///from w ww.jav a2s . c o m protected boolean isAllowed(BeanFactoryPostProcessor proc) { if (proc == this) return false; for (String pkg : excludes) for (Class<?> type = proc.getClass(); type != Object.class; type = type.getSuperclass()) if (type.getName().startsWith(pkg)) return false; return true; }
From source file:org.cloudfoundry.reconfiguration.spring.CloudAutoReconfigurationApplicationContextInitializer.java
private boolean hasBeanFactoryPostProcessor(ConfigurableApplicationContext applicationContext, BeanFactoryPostProcessor beanFactoryPostProcessor) { for (BeanFactoryPostProcessor candidate : ((AbstractApplicationContext) applicationContext) .getBeanFactoryPostProcessors()) { if (candidate.getClass().equals(beanFactoryPostProcessor.getClass())) { return true; }/*from w ww .j av a2 s . co m*/ } return false; }
From source file:org.cloudfoundry.reconfiguration.spring.CloudAutoReconfigurationApplicationContextInitializer.java
private void addBeanFactoryPostProcessor(ConfigurableApplicationContext applicationContext, BeanFactoryPostProcessor beanFactoryPostProcessor) { if (hasBeanFactoryPostProcessor(applicationContext, beanFactoryPostProcessor)) { this.logger.fine(String.format("'%s' already in list of BeanFactoryPostProcessors", beanFactoryPostProcessor.getClass())); } else {//w w w . j a va 2 s.co m this.logger.fine(String.format("Adding '%s' to the list of BeanFactoryPostProcessors", beanFactoryPostProcessor.getClass())); applicationContext.addBeanFactoryPostProcessor(beanFactoryPostProcessor); } }