| 1 | |
package org.kuali.spring.util; |
| 2 | |
|
| 3 | |
import org.springframework.beans.BeansException; |
| 4 | |
import org.springframework.beans.factory.BeanFactory; |
| 5 | |
import org.springframework.beans.factory.BeanFactoryAware; |
| 6 | |
import org.springframework.beans.factory.BeanInitializationException; |
| 7 | |
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; |
| 8 | |
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; |
| 9 | |
import org.springframework.core.Ordered; |
| 10 | |
import org.springframework.core.PriorityOrdered; |
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | 4 | public abstract class PlaceholderConfigurer implements BeanFactoryAware, BeanFactoryPostProcessor, PriorityOrdered { |
| 16 | |
|
| 17 | 4 | private int order = Ordered.LOWEST_PRECEDENCE; |
| 18 | |
|
| 19 | |
private BeanFactory beanFactory; |
| 20 | |
|
| 21 | |
protected abstract void processPlaceholders(ConfigurableListableBeanFactory beanFactory); |
| 22 | |
|
| 23 | |
@Override |
| 24 | |
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { |
| 25 | |
try { |
| 26 | 4 | processPlaceholders(beanFactory); |
| 27 | 0 | } catch (Exception e) { |
| 28 | 0 | throw new BeanInitializationException("Could not complete placeholder configuration", e); |
| 29 | 4 | } |
| 30 | 4 | } |
| 31 | |
|
| 32 | |
public void setOrder(int order) { |
| 33 | 0 | this.order = order; |
| 34 | 0 | } |
| 35 | |
|
| 36 | |
public int getOrder() { |
| 37 | 2 | return this.order; |
| 38 | |
} |
| 39 | |
|
| 40 | |
public BeanFactory getBeanFactory() { |
| 41 | 0 | return beanFactory; |
| 42 | |
} |
| 43 | |
|
| 44 | |
public void setBeanFactory(BeanFactory beanFactory) { |
| 45 | 4 | this.beanFactory = beanFactory; |
| 46 | 4 | } |
| 47 | |
|
| 48 | |
} |