Class Overview
FactoryBean
implementation that takes a list of location Strings
and creates a sorted array of Resource
instances.
Summary
Public Methods |
Class<? extends Resource[]>
|
getObjectType()
This abstract method declaration mirrors the method in the FactoryBean
interface, for a consistent offering of abstract template methods.
|
void
|
setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in.
|
Protected Methods |
Resource[]
|
createInstance()
Template method that subclasses must override to construct
the object returned by this factory.
|
[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).
|
|
From interface
org.springframework.context.ResourceLoaderAware
|
Public Constructors
public
SortedResourcesFactoryBean
(List<String> locations)
Public Methods
public
Class<? extends Resource[]>
getObjectType
()
This abstract method declaration mirrors the method in the FactoryBean
interface, for a consistent offering of abstract template methods.
Returns
- the type of object that this FactoryBean creates,
or
null
if not known at the time of the call
public
void
setResourceLoader
(ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in.
This might be a ResourcePatternResolver, which can be checked
through instanceof ResourcePatternResolver
. See also the
ResourcePatternUtils.getResourcePatternResolver
method.
Invoked after population of normal bean properties but before an init callback
like InitializingBean's afterPropertiesSet
or a custom init-method.
Invoked before ApplicationContextAware's setApplicationContext
.
Parameters
resourceLoader
| ResourceLoader object to be used by this object |
Protected Methods
protected
Resource[]
createInstance
()
Template method that subclasses must override to construct
the object returned by this factory.
Invoked on initialization of this FactoryBean in case of
a singleton; else, on each getObject()
call.
Returns
- the object returned by this factory