java.lang.Object | ||
↳ | org.springframework.beans.factory.access.SingletonBeanFactoryLocator | |
↳ | org.springframework.context.access.ContextSingletonBeanFactoryLocator |
Variant of SingletonBeanFactoryLocator
which creates its internal bean factory reference as an
ApplicationContext
instead of
SingletonBeanFactoryLocator's simple BeanFactory. For almost all usage scenarios,
this will not make a difference, since within that ApplicationContext or BeanFactory
you are still free to define either BeanFactory or ApplicationContext instances.
The main reason one would need to use this class is if bean post-processing
(or other ApplicationContext specific features are needed in the bean reference
definition itself).
Note: This class uses classpath*:beanRefContext.xml as the default resource location for the bean factory reference definition files. It is not possible nor legal to share definitions with SingletonBeanFactoryLocator at the same time.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.beans.factory.access.SingletonBeanFactoryLocator
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor which uses the the specified name as the resource name
of the definition file(s).
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an instance which uses the default "classpath*:beanRefContext.xml", as
the name of the definition file(s).
| |||||||||||
Returns an instance which uses the the specified selector, as the name of the
definition file(s).
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Overrides the default method to create definition object as an ApplicationContext
instead of the default BeanFactory.
| |||||||||||
Overrides the default method to operate on an ApplicationContext, invoking
ConfigurableApplicationContext.close() . | |||||||||||
Overrides the default method to refresh the ApplicationContext, invoking
ConfigurableApplicationContext.refresh() . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.beans.factory.access.SingletonBeanFactoryLocator
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.access.BeanFactoryLocator
|
Constructor which uses the the specified name as the resource name of the definition file(s).
resourceLocation | the Spring resource location to use (either a URL or a "classpath:" / "classpath*:" pseudo URL) |
---|
Returns an instance which uses the default "classpath*:beanRefContext.xml", as
the name of the definition file(s). All resources returned by the current
thread's context class loader's getResources
method with this
name will be combined to create a definition, which is just a BeanFactory.
BeansException | in case of factory loading failure |
---|
Returns an instance which uses the the specified selector, as the name of the
definition file(s). In the case of a name with a Spring "classpath*:" prefix,
or with no prefix, which is treated the same, the current thread's context class
loader's getResources
method will be called with this value to get
all resources having that name. These resources will then be combined to form a
definition. In the case where the name uses a Spring "classpath:" prefix, or
a standard URL prefix, then only one resource file will be loaded as the
definition.
selector | the location of the resource(s) which will be read and combined to form the definition for the BeanFactoryLocator instance. Any such files must form a valid ApplicationContext definition. |
---|
BeansException | in case of factory loading failure |
---|
Overrides the default method to create definition object as an ApplicationContext instead of the default BeanFactory. This does not affect what can actually be loaded by that definition.
The default implementation simply builds a
ClassPathXmlApplicationContext
.
resourceLocation | the resource location for this factory group |
---|---|
factoryKey | the bean name of the factory to obtain |
Overrides the default method to operate on an ApplicationContext, invoking
ConfigurableApplicationContext.close()
.
groupDef | the factory returned by createDefinition() |
---|---|
selector | the resource location for this factory group |
Overrides the default method to refresh the ApplicationContext, invoking
ConfigurableApplicationContext.refresh()
.
groupDef | the factory returned by createDefinition()
|
---|