abstract class BeanFactoryUtils
Convenience methods operating on bean factories, in particular on the ListableBeanFactory interface. Returns bean counts, bean names or bean instances, taking into account the nesting hierarchy of a bean factory (which the methods defined on the ListableBeanFactory interface don't, in contrast to the methods defined on the BeanFactory interface). |
|
interface NamedBean
Counterpart of BeanNameAware. Returns the bean name of an object. This interface can be introduced to avoid a brittle dependence on bean name in objects used with Spring IoC and Spring AOP. |
|
interface ObjectProvider<T : Any> : ObjectFactory<T>
A variant of ObjectFactory designed specifically for injection points, allowing for programmatic optionality and lenient not-unique handling. |
|
interface SmartFactoryBean<T : Any> : FactoryBean<T>
Extension of the FactoryBean interface. Implementations may indicate whether they always return independent instances, for the case where their Plain FactoryBean implementations which do not implement this extended interface are simply assumed to always return independent instances if their NOTE: This interface is a special purpose interface, mainly for internal use within the framework and within collaborating frameworks. In general, application-provided FactoryBeans should simply implement the plain FactoryBean interface. New methods might be added to this extended interface even in point releases. |
|
interface SmartInitializingSingleton
Callback interface triggered at the end of the singleton pre-instantiation phase during BeanFactory bootstrap. This interface can be implemented by singleton beans in order to perform some initialization after the regular singleton instantiation algorithm, avoiding side effects with accidental early initialization (e.g. from This callback variant is somewhat similar to org.springframework.context.event.ContextRefreshedEvent but doesn't require an implementation of org.springframework.context.ApplicationListener, with no need to filter context references across a context hierarchy etc. It also implies a more minimal dependency on just the NOTE: If you intend to start/manage asynchronous tasks, preferably implement org.springframework.context.Lifecycle instead which offers a richer model for runtime management and allows for phased startup/shutdown. |
open class BeanCreationNotAllowedException : BeanCreationException
Exception thrown in case of a bean being requested despite bean creation currently not being allowed (for example, during the shutdown phase of a bean factory). |
|
open class BeanCurrentlyInCreationException : BeanCreationException
Exception thrown in case of a reference to a bean that's currently in creation. Typically happens when constructor autowiring matches the currently constructed bean. |
|
open class BeanExpressionException : FatalBeanException
Exception that indicates an expression evaluation attempt having failed. |
|
open class BeanInitializationException : FatalBeanException
Exception that a bean implementation is suggested to throw if its own factory-aware initialization code fails. BeansExceptions thrown by bean factory methods themselves should simply be propagated as-is. Note that |
|
open class BeanIsAbstractException : BeanCreationException
Exception thrown when a bean instance has been requested for a bean definition which has been marked as abstract. |
|
open class BeanIsNotAFactoryException : BeanNotOfRequiredTypeException
Exception thrown when a bean is not a factory, but a user tries to get at the factory for the given bean name. Whether a bean is a factory is determined by whether it implements the FactoryBean interface. |
|
open class BeanNotOfRequiredTypeException : BeansException
Thrown when a bean doesn't match the expected type. |
|
open class CannotLoadBeanClassException : FatalBeanException
Exception thrown when the BeanFactory cannot load the specified class of a given bean. |
|
open class FactoryBeanNotInitializedException : FatalBeanException
Exception to be thrown from a FactoryBean's Note: A circular reference with a FactoryBean cannot be solved by eagerly caching singleton instances like with normal beans. The reason is that every FactoryBean needs to be fully initialized before it can return the created bean, while only specific normal beans need to be initialized - that is, if a collaborating bean actually invokes them on initialization instead of just storing the reference. |
|
open class NoUniqueBeanDefinitionException : NoSuchBeanDefinitionException
Exception thrown when a |
|
open class UnsatisfiedDependencyException : BeanCreationException
Exception thrown when a bean depends on other beans or simple properties that were not specified in the bean factory definition, although dependency checking was enabled. |
fun <T : Annotation> ListableBeanFactory.findAnnotationOnBean(beanName: String): Annotation?
Extension for ListableBeanFactory.findAnnotationOnBean providing a
|
|
fun <T : Any> BeanFactory.getBean(): T
Extension for BeanFactory.getBean providing a fun <T : Any> BeanFactory.getBean(name: String): T
Extension for BeanFactory.getBean providing a fun <T : Any> BeanFactory.getBean(vararg args: Any): T
Extension for BeanFactory.getBean providing a |
|
fun <T : Annotation> ListableBeanFactory.getBeanNamesForAnnotation(): Array<out String>
Extension for ListableBeanFactory.getBeanNamesForAnnotation providing a
|
|
fun <T : Any> ListableBeanFactory.getBeanNamesForType(includeNonSingletons: Boolean = true, allowEagerInit: Boolean = true): Array<out String>
Extension for ListableBeanFactory.getBeanNamesForType providing a
|
|
fun <T : Any> ListableBeanFactory.getBeansOfType(includeNonSingletons: Boolean = true, allowEagerInit: Boolean = true): Map<String, T>
Extension for ListableBeanFactory.getBeansOfType providing a |
|
fun <T : Annotation> ListableBeanFactory.getBeansWithAnnotation(): Map<String, Any>
Extension for ListableBeanFactory.getBeansWithAnnotation providing a
|