Known Direct Subclasses
|
Class Overview
Abstract base class for FactoryBeans operating on the
JDK 1.6 java.util.ServiceLoader facility.
Summary
[Expand]
Inherited Methods |
From class
org.springframework.beans.factory.config.AbstractFactoryBean
void
|
afterPropertiesSet()
Eagerly create the singleton instance, if necessary.
|
abstract
T
|
createInstance()
Template method that subclasses must override to construct
the object returned by this factory.
|
void
|
destroy()
Destroy the singleton instance, if any.
|
void
|
destroyInstance(T instance)
Callback for destroying a singleton instance.
|
BeanFactory
|
getBeanFactory()
Return the BeanFactory that this bean runs in.
|
TypeConverter
|
getBeanTypeConverter()
Obtain a bean type converter from the BeanFactory that this bean
runs in.
|
Class[]
|
getEarlySingletonInterfaces()
Return an array of interfaces that a singleton object exposed by this
FactoryBean is supposed to implement, for use with an 'early singleton
proxy' that will be exposed in case of a circular reference.
|
final
T
|
getObject()
Expose the singleton instance or create a new prototype instance.
|
abstract
Class<?>
|
getObjectType()
This abstract method declaration mirrors the method in the FactoryBean
interface, for a consistent offering of abstract template methods.
|
boolean
|
isSingleton()
Is the object managed by this factory a singleton? That is,
will getObject() always return the same object
(a reference that can be cached)?
NOTE: If a FactoryBean indicates to hold a singleton object,
the object returned from getObject() might get cached
by the owning BeanFactory.
|
void
|
setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to
a bean instance.
|
void
|
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
void
|
setSingleton(boolean singleton)
Set if a singleton should be created, or a new object on each request
otherwise.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.springframework.beans.factory.BeanClassLoaderAware
|
From interface
org.springframework.beans.factory.BeanFactoryAware
|
From interface
org.springframework.beans.factory.DisposableBean
abstract
void
|
destroy()
Invoked by a BeanFactory on destruction of a singleton.
|
|
From interface
org.springframework.beans.factory.FactoryBean
abstract
T
|
getObject()
Return an instance (possibly shared or independent) of the object
managed by this factory.
|
abstract
Class<?>
|
getObjectType()
Return the type of object that this FactoryBean creates,
or null if not known in advance.
|
abstract
boolean
|
isSingleton()
Is the object managed by this factory a singleton? That is,
will getObject() always return the same object
(a reference that can be cached)?
NOTE: If a FactoryBean indicates to hold a singleton object,
the object returned from getObject() might get cached
by the owning BeanFactory.
|
|
From interface
org.springframework.beans.factory.InitializingBean
abstract
void
|
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
|
Public Constructors
public
AbstractServiceLoaderBasedFactoryBean
()
Public Methods
public
Class
getServiceType
()
Return the desired service type.
public
void
setBeanClassLoader
(ClassLoader beanClassLoader)
Parameters
beanClassLoader
| the owning class loader; may be null in
which case a default ClassLoader must be used, for example
the ClassLoader obtained via
getDefaultClassLoader()
|
public
void
setServiceType
(Class serviceType)
Specify the desired service type (typically the service's public API).
Protected Methods
protected
Object
createInstance
()
protected
abstract
Object
getObjectToExpose
(ServiceLoader serviceLoader)
Determine the actual object to expose for the given ServiceLoader.
Left to concrete subclasses.
Parameters
serviceLoader
| the ServiceLoader for the configured service class |