Interface to be implemented by objects used within a BeanFactory
that are themselves factories. If a bean implements this interface,
it is used as a factory, not directly as a bean.
NB: A bean that implements this interface cannot be used
as a normal bean. A FactoryBean is defined in a bean style,
but the object exposed for bean references is always the object
that it creates.
FactoryBeans can support singletons and prototypes, and can
either create objects lazily on demand or eagerly on startup.
This interface is heavily used within the framework, for
example for the AOP ProxyFactoryBean or JndiObjectFactoryBean.
It can be used for application components, but this is not common
outside of infrastructure code.
NB: A bean that implements this interface cannot be used as a normal bean. A FactoryBean is defined in a bean style, but the object exposed for bean references is always the object that it creates.
FactoryBeans can support singletons and prototypes, and can either create objects lazily on demand or eagerly on startup.
This interface is heavily used within the framework, for example for the AOP ProxyFactoryBean or JndiObjectFactoryBean. It can be used for application components, but this is not common outside of infrastructure code.