Class AbstractRemoveBeanPostProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.config.BeanPostProcessor,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
EarlyStageRemoveBeanPostProcessor,LateStageRemoveBeanPostProcessor
Contains useful processing code for merge bean post processors. The BeanPostProcessor instances can be used to remove collection members from collections declared elsewhere. In effect, this allows an implementer to remove a bean that was declared in a collection (list, set or map) or previously merged via LateStageMergeBeanPostProcessor or EarlyStageMergeBeanPostProcessor.
This code demonstrates using one of the concrete implementations, LateStageRemoveBeanPostProcessor. The
basic usage pattern is to specify the id of the member you want to remove (beanRef) and the id
of the pre-existing, target collection (targetRef) that should receive the removal. The collection
can be represented using ListFactoryBean, SetFactoryBean or MapFactoryBean. For MapFactoryBeans, use either the
mapKey or mapKeyRef property instead to reference the map item to remove.
<bean class="org.broadleafcommerce.common.extensibility.context.merge.LateStageRemoveBeanPostProcessor">
<property name="beanRef" value="myBean"/>
<property name="targetRef" value="targetCollection"/>
</bean>
- Author:
- Jeff Fischer
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionpostProcessAfterInitialization(Object bean, String beanName) postProcessBeforeInitialization(Object bean, String beanName) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetBeanRef(String beanRef) voidvoidsetMapKeyRef(String mapKeyRef) voidsetTargetRef(String targetRef)
-
Field Details
-
beanRef
-
targetRef
-
mapKey
-
mapKeyRef
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
AbstractRemoveBeanPostProcessor
public AbstractRemoveBeanPostProcessor()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
postProcessAfterInitialization
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException - Specified by:
postProcessAfterInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor- Throws:
org.springframework.beans.BeansException
-
postProcessBeforeInitialization
public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException - Specified by:
postProcessBeforeInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor- Throws:
org.springframework.beans.BeansException
-
getBeanRef
-
setBeanRef
-
getTargetRef
-
setTargetRef
-
getMapKey
-
setMapKey
-
getMapKeyRef
-
setMapKeyRef
-