Class LateDependentInitialisationRegistry


  • public class LateDependentInitialisationRegistry
    extends java.lang.Object
    Registry to store the bean pairs that make up an initialisation dependency.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.springframework.util.MultiValueMap<java.lang.Class,​DependingBeanDef> registry  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDependentBean​(java.lang.Class bean, java.lang.Class dependsOn)
      Add a new dependency by defining that dependsOn should be initiated after bean is instantiated.
      void addDependentBean​(java.lang.String beanName, java.lang.Class dependsOn)
      Add a new dependency by defining that dependsOn should be initiated after bean is instantiated.
      java.util.List<DependingBeanDef> getDependentBeanClasses​(java.lang.Class bean)
      Retrieve a list of all dependent bean classes for bean.
      boolean hasDependentBeans​(java.lang.Class bean)
      Check if there are any beans defined that depend on bean
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • registry

        private final org.springframework.util.MultiValueMap<java.lang.Class,​DependingBeanDef> registry
    • Constructor Detail

      • LateDependentInitialisationRegistry

        public LateDependentInitialisationRegistry()
    • Method Detail

      • addDependentBean

        public void addDependentBean​(java.lang.Class bean,
                                     java.lang.Class dependsOn)
        Add a new dependency by defining that dependsOn should be initiated after bean is instantiated.
        Parameters:
        bean - depending bean.
        dependsOn - the bean that the othe ben depends on
      • addDependentBean

        public void addDependentBean​(java.lang.String beanName,
                                     java.lang.Class dependsOn)
        Add a new dependency by defining that dependsOn should be initiated after bean is instantiated.
        Parameters:
        beanName - depending bean.
        dependsOn - the bean that the othe ben depends on
      • hasDependentBeans

        public boolean hasDependentBeans​(java.lang.Class bean)
        Check if there are any beans defined that depend on bean
        Parameters:
        bean - the bean class to be check for dependencies.
        Returns:
        true if there are dependent beans.
      • getDependentBeanClasses

        public java.util.List<DependingBeanDef> getDependentBeanClasses​(java.lang.Class bean)
        Retrieve a list of all dependent bean classes for bean. The retrevial consumes the data, meaning the second call with the same parameters will always result in an empty list.
        Returns:
        List of bean classes that should be initiated upon the instantiation of bean