Top Description Interfaces Classes
module spring.beans

Package org.springframework.beans.factory

Annotations
@NonNullApi
@NonNullFields
Imports
org.springframework.lang.NonNullApi, .NonNullFields

The core package implementing Spring's lightweight Inversion of Control (IoC) container.

Provides an alternative to the Singleton and Prototype design patterns, including a consistent approach to configuration management. Builds on the org.springframework.beans package.

This package and related packages are discussed in Chapter 11 of Expert One-On-One J2EE Design and Development by Rod Johnson (Wrox, 2002).

Interface Summary

Modifier and TypeInterface and Description
public interface
Aware

A marker superinterface indicating that a bean is eligible to be notified by the Spring container of a particular framework object through a callback-style method.

public interface
BeanClassLoaderAware

Callback that allows a bean to be aware of the bean class loader; that is, the class loader used by the present bean factory to load bean classes.

public interface
BeanFactory

The root interface for accessing a Spring bean container.

public interface
BeanFactoryAware

Interface to be implemented by beans that wish to be aware of their owning BeanFactory.

public interface
BeanNameAware

Interface to be implemented by beans that want to be aware of their bean name in a bean factory.

public interface
DisposableBean

Interface to be implemented by beans that want to release resources on destruction.

public interface
FactoryBean<
the bean type
T
>

Interface to be implemented by objects used within a BeanFactory which are themselves factories for individual objects.

public interface
HierarchicalBeanFactory

Sub-interface implemented by bean factories that can be part of a hierarchy.

public interface
InitializingBean

Interface to be implemented by beans that need to react once all their properties have been set by a BeanFactory: e.g. to perform custom initialization, or merely to check that all mandatory properties have been set.

public interface
ListableBeanFactory

Extension of the BeanFactory interface to be implemented by bean factories that can enumerate all their bean instances, rather than attempting bean lookup by name one by one as requested by clients.

public interface
NamedBean

Counterpart of BeanNameAware.

public interface
ObjectFactory<
the object type
T
>

Defines a factory which can return an Object instance (possibly shared or independent) when invoked.

public interface
ObjectProvider<
the object type
T
>

A variant of ObjectFactory designed specifically for injection points, allowing for programmatic optionality and lenient not-unique handling.

public interface
SmartFactoryBean<
the bean type
T
>

Extension of the FactoryBean interface.

public interface
SmartInitializingSingleton

Callback interface triggered at the end of the singleton pre-instantiation phase during BeanFactory bootstrap.

Class Summary

Modifier and TypeClass and Description
public class
BeanCreationException

Exception thrown when a BeanFactory encounters an error when attempting to create a bean from a bean definition.

public class
BeanCreationNotAllowedException

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).

public class
BeanCurrentlyInCreationException

Exception thrown in case of a reference to a bean that's currently in creation.

public class
BeanDefinitionStoreException

Exception thrown when a BeanFactory encounters an invalid bean definition: e.g. in case of incomplete or contradictory bean metadata.

public class
BeanExpressionException

Exception that indicates an expression evaluation attempt having failed.

public abstract class
BeanFactoryUtils

Convenience methods operating on bean factories, in particular on the ListableBeanFactory interface.

public class
BeanInitializationException

Exception that a bean implementation is suggested to throw if its own factory-aware initialization code fails.

public class
BeanIsAbstractException

Exception thrown when a bean instance has been requested for a bean definition which has been marked as abstract.

public class
BeanIsNotAFactoryException

Exception thrown when a bean is not a factory, but a user tries to get at the factory for the given bean name.

public class
BeanNotOfRequiredTypeException

Thrown when a bean doesn't match the expected type.

public class
CannotLoadBeanClassException

Exception thrown when the BeanFactory cannot load the specified class of a given bean.

public class
FactoryBeanNotInitializedException

Exception to be thrown from a FactoryBean's getObject() method if the bean is not fully initialized yet, for example because it is involved in a circular reference.

public class
InjectionPoint

A simple descriptor for an injection point, pointing to a method/constructor parameter or a field.

public class
NoSuchBeanDefinitionException

Exception thrown when a BeanFactory is asked for a bean instance for which it cannot find a definition.

public class
NoUniqueBeanDefinitionException

Exception thrown when a BeanFactory is asked for a bean instance for which multiple matching candidates have been found when only one matching bean was expected.

public class
UnsatisfiedDependencyException

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.