|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.AbstractRefreshableApplicationContext
org.springframework.config.java.context.AbstractAnnotationApplicationContext
org.springframework.config.java.context.AnnotationApplicationContext
public class AnnotationApplicationContext
Annotation-aware application context. This class extends
AbstractAnnotationApplicationContext
and adds support for reading an
application context definition/metadata directly from a class.
Field Summary |
---|
Fields inherited from class org.springframework.context.support.AbstractApplicationContext |
---|
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME |
Fields inherited from interface org.springframework.beans.factory.BeanFactory |
---|
FACTORY_BEAN_PREFIX |
Fields inherited from interface org.springframework.beans.factory.BeanFactory |
---|
FACTORY_BEAN_PREFIX |
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver |
---|
CLASSPATH_ALL_URL_PREFIX |
Fields inherited from interface org.springframework.core.io.ResourceLoader |
---|
CLASSPATH_URL_PREFIX |
Constructor Summary | |
---|---|
AnnotationApplicationContext()
Create a new AnnotationApplicationContext w/o any settings. |
|
AnnotationApplicationContext(org.springframework.context.ApplicationContext parent)
Create a new AnnotationApplicationContext with the given parent. |
|
AnnotationApplicationContext(java.lang.Class... classes)
Create a new AnnotationApplicationContext from the given classes ( AbstractApplicationContext.refresh()
is being called). |
|
AnnotationApplicationContext(java.lang.String... locations)
Create a new AnnotationApplicationContext from the given locations ( AbstractApplicationContext.refresh()
is being called). |
Method Summary | |
---|---|
protected java.lang.Class[] |
getConfigClasses()
Return an array of Class objects which act as definition files for a spring context. |
protected java.lang.String[] |
getConfigLocations()
Return an array of resource locations, referring to the class bean definition files that this context should be built with. |
protected org.springframework.core.io.Resource[] |
getConfigResources()
Return an array of Resource objects, referring to the class bean definition files that this context should be built with. |
void |
setConfigClasses(java.lang.Class... classes)
Indicate the Class es that hold annotations suitable for
configuring the current application context. |
void |
setConfigLocations(java.lang.String... locations)
Set the configuration locations from Strings. |
void |
setConfigResources(org.springframework.core.io.Resource... resources)
Indicate the configuration locations as Resource s. |
Methods inherited from class org.springframework.config.java.context.AbstractAnnotationApplicationContext |
---|
containsConfiguration, createAnnotationBeanDefinitionReader, loadBeanDefinitions, loadBeanDefinitions, loadBeanDefinitions, registerDefaultPostProcessors |
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext |
---|
closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, refreshBeanFactory |
Methods inherited from class org.springframework.context.support.AbstractApplicationContext |
---|
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getDisplayName, getInternalParentBeanFactory, getInternalParentMessageSource, getLifecycleBeans, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, onClose, onRefresh, postProcessBeanFactory, publishEvent, refresh, registerShutdownHook, setDisplayName, setParent, start, stop, toString |
Methods inherited from class org.springframework.core.io.DefaultResourceLoader |
---|
getClassLoader, getResource, getResourceByPath, setClassLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.core.io.ResourceLoader |
---|
getClassLoader, getResource |
Constructor Detail |
---|
public AnnotationApplicationContext()
DefaultResourceLoader.setClassLoader(ClassLoader)
,
setConfigClasses(Class[])
,
setConfigLocations(String[])
,
setConfigResources(Resource[])
public AnnotationApplicationContext(org.springframework.context.ApplicationContext parent)
AbstractApplicationContext.refresh()
.
parent
- the parent application contextDefaultResourceLoader.setClassLoader(ClassLoader)
,
setConfigClasses(Class[])
,
setConfigLocations(String[])
,
setConfigResources(Resource[])
public AnnotationApplicationContext(java.lang.String... locations)
AbstractApplicationContext.refresh()
is being called).
locations
- the metadata locationspublic AnnotationApplicationContext(java.lang.Class... classes)
AbstractApplicationContext.refresh()
is being called).
classes
- Method Detail |
---|
protected java.lang.String[] getConfigLocations()
AbstractAnnotationApplicationContext
Default implementation returns null
. Subclasses can
override this to provide a set of resource locations to load bean
definitions from.
getConfigLocations
in class AbstractAnnotationApplicationContext
null
if noneAbstractApplicationContext.getResources(java.lang.String)
,
AbstractApplicationContext.getResourcePatternResolver()
protected org.springframework.core.io.Resource[] getConfigResources()
AbstractAnnotationApplicationContext
Default implementation returns null
. Subclasses can
override this to provide pre-built Resource objects rather than location
Strings.
getConfigResources
in class AbstractAnnotationApplicationContext
null
if noneAbstractAnnotationApplicationContext.getConfigLocations()
protected java.lang.Class[] getConfigClasses()
AbstractAnnotationApplicationContext
Default implementation returns null
. Subclasses can
override this to provide pre-built Class objects rather than location
Strings or Resources. This class should be mainly use when runtime
generating classes are used (runtime compiled Groovy scripts or ASM
'synthetic' classes).
getConfigClasses
in class AbstractAnnotationApplicationContext
null
if noneAbstractAnnotationApplicationContext.getConfigLocations()
public void setConfigLocations(java.lang.String... locations)
Resource
using the current $ResourceLoader
.
locations
- public void setConfigResources(org.springframework.core.io.Resource... resources)
Resource
s.
resources
- public void setConfigClasses(java.lang.Class... classes)
Class
es that hold annotations suitable for
configuring the current application context.
classes
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |