|
||||||||||
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.web.context.support.AbstractRefreshableWebApplicationContext
org.springframework.web.context.support.XmlWebApplicationContext
es.mcu.yingo.context.ContextLocation
public class ContextLocation
Se extiende de la clase XmlWebApplicationContext
para
personalizar desde donde se lee el contexto de Spring desde la
parte web.
Carga el contexto desde un ClassPathResource
lo que permite que
el archivo de configuración o los import de este estén dentro de
un jar.
Añade también un BeanProcesadorIdAplicacion
como un
post procesador de la configuración de spring para poder añadir el id de
aplicación de manera aútomática a todos los beans que implementen
IdAplicacionAware
Ejemplo de configuración en el xml:
contextClass es.mcu.yingo.context.ContextLocation xmlConfiguracion /es/mcu/springConfig/spring-config.xml
BeanProcesadorIdAplicacion
,
IdAplicacionAware
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
|
Fields inherited from class org.springframework.web.context.support.XmlWebApplicationContext |
---|
DEFAULT_CONFIG_LOCATION, DEFAULT_CONFIG_LOCATION_PREFIX, DEFAULT_CONFIG_LOCATION_SUFFIX |
Fields inherited from class org.springframework.context.support.AbstractApplicationContext |
---|
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, MESSAGE_SOURCE_BEAN_NAME |
Fields inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext |
---|
CONFIG_LOCATION_DELIMITERS |
Fields inherited from interface org.springframework.web.context.WebApplicationContext |
---|
ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE |
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, CLASSPATH_URL_PREFIX |
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, CLASSPATH_URL_PREFIX |
Constructor Summary | |
---|---|
ContextLocation()
|
Method Summary | |
---|---|
protected void |
loadBeanDefinitions(org.springframework.beans.factory.xml.XmlBeanDefinitionReader miXmlBeanDefinitionReader)
Para la parte web se carga el mismo contexto de Spring que el de la que se utiliza en la clase SpringContext |
protected void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory conListableBeanFactory)
|
Methods inherited from class org.springframework.web.context.support.XmlWebApplicationContext |
---|
getDefaultConfigLocations, initBeanDefinitionReader, loadBeanDefinitions |
Methods inherited from class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext |
---|
getConfigLocations, getNamespace, getResourceByPath, getResourcePatternResolver, getServletContext, getTheme, onRefresh, refresh, resolvePath, setConfigLocations, setNamespace, setServletContext, toString |
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext |
---|
createBeanFactory, getBeanFactory, refreshBeanFactory |
Methods inherited from class org.springframework.context.support.AbstractApplicationContext |
---|
addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, getAliases, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getDisplayName, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getType, isSingleton, publishEvent, setDisplayName, setParent |
Methods inherited from class org.springframework.core.io.DefaultResourceLoader |
---|
getClassLoader, getResource, setClassLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.context.ApplicationContext |
---|
getDisplayName, getParent, getStartupDate, publishEvent |
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory |
---|
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType |
Methods inherited from interface org.springframework.beans.factory.BeanFactory |
---|
containsBean, getAliases, getBean, getBean, getType, isSingleton |
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory |
---|
containsLocalBean, getParentBeanFactory |
Methods inherited from interface org.springframework.beans.factory.BeanFactory |
---|
containsBean, getAliases, getBean, getBean, getType, isSingleton |
Methods inherited from interface org.springframework.context.MessageSource |
---|
getMessage, getMessage, getMessage |
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver |
---|
getResources |
Methods inherited from interface org.springframework.core.io.ResourceLoader |
---|
getResource |
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext |
---|
addBeanFactoryPostProcessor, close, getBeanFactory, setParent |
Methods inherited from interface org.springframework.context.ApplicationContext |
---|
getDisplayName, getParent, getStartupDate, publishEvent |
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory |
---|
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType |
Methods inherited from interface org.springframework.beans.factory.BeanFactory |
---|
containsBean, getAliases, getBean, getBean, getType, isSingleton |
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory |
---|
containsLocalBean, getParentBeanFactory |
Methods inherited from interface org.springframework.beans.factory.BeanFactory |
---|
containsBean, getAliases, getBean, getBean, getType, isSingleton |
Methods inherited from interface org.springframework.context.MessageSource |
---|
getMessage, getMessage, getMessage |
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver |
---|
getResources |
Methods inherited from interface org.springframework.core.io.ResourceLoader |
---|
getResource |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public ContextLocation()
Method Detail |
---|
protected void loadBeanDefinitions(org.springframework.beans.factory.xml.XmlBeanDefinitionReader miXmlBeanDefinitionReader) throws org.springframework.beans.BeansException, java.io.IOException
loadBeanDefinitions
in class org.springframework.web.context.support.XmlWebApplicationContext
org.springframework.beans.BeansException
java.io.IOException
protected void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory conListableBeanFactory)
postProcessBeanFactory
in class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |