Class BeanRemovalIdentifier


  • public final class BeanRemovalIdentifier
    extends Object
    Register an instance of this component in spring config to cause the bean identified by beanName to be removed from the spring BeanDefinitionRegistry. This effectively removes the influence of the targeted bean from the spring environment. Be aware that any beans that may be dependent on the removed bean could be impacted.

    This is most oft used to remove a bean from Broadleaf that implements a common interface and which is injected as part of a list into a managing component. In this case, the removal of the bean indicates that you do not want its influence to be felt in that managing component. Note, this really only matters if the managing component is guaranteed to call all members of the injected list. In many cases, Broadleaf will have an ordered list of members for this case and the first qualifying member is used. In such a case, the more desirable extension pattern is to create a custom component with a higher priority order to guarantee that your custom component wins over the lesser priority Broadleaf component.
    Author:
    Jeff Fischer
    • Constructor Detail

      • BeanRemovalIdentifier

        public BeanRemovalIdentifier​(String beanName)
    • Method Detail

      • getBeanName

        public String getBeanName()
        The name of the bean whose BeanDefinition should be removed
        Returns:
        The name of the bean whose BeanDefinition should be removed
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object