Interface ConfigurableListableBeanFactory

    • Method Detail

      • ignoreDependencyType

        void ignoreDependencyType(java.lang.Class<?> type)
        Ignore the given dependency type for autowiring: for example, String. Default is none.
        type - the dependency type to ignore
      • ignoreDependencyInterface

        void ignoreDependencyInterface(java.lang.Class<?> ifc)
        Ignore the given dependency interface for autowiring.

        This will typically be used by application contexts to register dependencies that are resolved in other ways, like BeanFactory through BeanFactoryAware or ApplicationContext through ApplicationContextAware.

        By default, only the BeanFactoryAware interface is ignored. For further types to ignore, invoke this method for each type.

        ifc - the dependency interface to ignore
        See Also:
        BeanFactoryAware, ApplicationContextAware
      • registerResolvableDependency

        void registerResolvableDependency(java.lang.Class<?> dependencyType,
                                          java.lang.Object autowiredValue)
        Register a special dependency type with corresponding autowired value.

        This is intended for factory/context references that are supposed to be autowirable but are not defined as beans in the factory: e.g. a dependency of type ApplicationContext resolved to the ApplicationContext instance that the bean is living in.

        Note: There are no such default types registered in a plain BeanFactory, not even for the BeanFactory interface itself.

        dependencyType - the dependency type to register. This will typically be a base interface such as BeanFactory, with extensions of it resolved as well if declared as an autowiring dependency (e.g. ListableBeanFactory), as long as the given value actually implements the extended interface.
        autowiredValue - the corresponding autowired value. This may also be an implementation of the ObjectFactory interface, which allows for lazy resolution of the actual target value.
      • isAutowireCandidate

        boolean isAutowireCandidate(java.lang.String beanName,
                                    DependencyDescriptor descriptor)
                             throws NoSuchBeanDefinitionException
        Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.

        This method checks ancestor factories as well.

        beanName - the name of the bean to check
        descriptor - the descriptor of the dependency to resolve
        whether the bean should be considered as autowire candidate
        NoSuchBeanDefinitionException - if there is no bean with the given name
      • getBeanDefinition

        BeanDefinition getBeanDefinition(java.lang.String beanName)
                                  throws NoSuchBeanDefinitionException
        Return the registered BeanDefinition for the specified bean, allowing access to its property values and constructor argument value (which can be modified during bean factory post-processing).

        A returned BeanDefinition object should not be a copy but the original definition object as registered in the factory. This means that it should be castable to a more specific implementation type, if necessary.

        NOTE: This method does not consider ancestor factories. It is only meant for accessing local bean definitions of this factory.

        beanName - the name of the bean
        the registered BeanDefinition
        NoSuchBeanDefinitionException - if there is no bean with the given name defined in this factory
      • freezeConfiguration

        void freezeConfiguration()
        Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.

        This allows the factory to aggressively cache bean definition metadata.

      • isConfigurationFrozen

        boolean isConfigurationFrozen()
        Return whether this factory's bean definitions are frozen, i.e. are not supposed to be modified or post-processed any further.
        true if the factory's configuration is considered frozen