ch.elca.el4j.web.context
Class ModuleWebApplicationContext
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.AbstractRefreshableApplicationContext
org.springframework.context.support.AbstractRefreshableConfigApplicationContext
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
org.springframework.web.context.support.XmlWebApplicationContext
ch.elca.el4j.web.context.ModuleWebApplicationContext
- All Implemented Interfaces:
- RefreshableModuleApplicationContext, BeanFactory, BeanNameAware, DisposableBean, HierarchicalBeanFactory, InitializingBean, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver, ThemeSource, ConfigurableWebApplicationContext, WebApplicationContext
public class ModuleWebApplicationContext
- extends XmlWebApplicationContext
- implements RefreshableModuleApplicationContext
This web application context behaves exactly the same way as Spring's
XmlWebApplicationContext
but
uses a ResourcePatternResolver
that preserves the order defined by the EL4J's module hierarchy. Further,
it allows to define configuration locations that have to be included and
those, that have to be excluded. This allows removing individual
configuration files that are included using using wildcard notation.
- Author:
- Andreas Bur (ABU), Martin Zeltner (MZE)
- See Also:
ModuleApplicationContext
- File-location:
- ModuleWebApplicationContext
- Last check-in date:
- 2010-11-02 11:44:37 +0100 (Di, 02. Nov 2010) by swisswheel for revision 4204
Field Summary |
protected static org.slf4j.Logger |
s_loggerEl4j
This logger is used to print out some global debugging info. |
Constructor Summary |
ModuleWebApplicationContext(String[] inclusiveConfigLocations,
String[] exclusiveConfigLocations,
boolean allowBeanDefinitionOverriding,
javax.servlet.ServletContext servletContext,
boolean mergeWithOuterResources)
There is no parent app context. |
ModuleWebApplicationContext(String[] inclusiveConfigLocations,
String[] exclusiveConfigLocations,
boolean allowBeanDefinitionOverriding,
javax.servlet.ServletContext servletContext,
boolean mergeWithOuterResources,
ApplicationContext parent)
Most specific resource last is set to false . |
ModuleWebApplicationContext(String[] inclusiveConfigLocations,
String[] exclusiveConfigLocations,
boolean allowBeanDefinitionOverriding,
javax.servlet.ServletContext servletContext,
boolean mergeWithOuterResources,
boolean mostSpecificResourceLast,
boolean mostSpecificBeanDefinitionCounts)
There is no parent app context. |
ModuleWebApplicationContext(String[] inclusiveConfigLocations,
String[] exclusiveConfigLocations,
boolean allowBeanDefinitionOverriding,
javax.servlet.ServletContext servletContext,
boolean mergeWithOuterResources,
boolean mostSpecificResourceLast,
boolean mostSpecificBeanDefinitionCounts,
ApplicationContext parent)
Create a new ModuleApplicationContext with the given parent, loading the
definitions from the given XML files in "inclusiveConfigLocations"
excluded the XML files defined in "exclusiveConfigLocations". |
Methods inherited from class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext |
getConfigLocations, getNamespace, getResourceByPath, getServletConfig, getServletContext, getTheme, onRefresh, postProcessBeanFactory, setNamespace, setServletConfig, setServletContext |
Methods inherited from class org.springframework.context.support.AbstractApplicationContext |
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, prepareBeanFactory, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent, start, stop, toString |
s_loggerEl4j
protected static final org.slf4j.Logger s_loggerEl4j
- This logger is used to print out some global debugging info. Consult it
for info what is going on.
ModuleWebApplicationContext
public ModuleWebApplicationContext(String[] inclusiveConfigLocations,
String[] exclusiveConfigLocations,
boolean allowBeanDefinitionOverriding,
javax.servlet.ServletContext servletContext,
boolean mergeWithOuterResources)
- There is no parent app context.
- See Also:
#ModuleWebApplicationContext(String[], String[], boolean,
ServletContext, boolean, ApplicationContext))
ModuleWebApplicationContext
public ModuleWebApplicationContext(String[] inclusiveConfigLocations,
String[] exclusiveConfigLocations,
boolean allowBeanDefinitionOverriding,
javax.servlet.ServletContext servletContext,
boolean mergeWithOuterResources,
ApplicationContext parent)
- Most specific resource last is set to
false
.
- Most specific bean definition counts is set to
true
.
- See Also:
#ModuleWebApplicationContext(String[], String[], boolean,
ServletContext, boolean, boolean, boolean))
ModuleWebApplicationContext
public ModuleWebApplicationContext(String[] inclusiveConfigLocations,
String[] exclusiveConfigLocations,
boolean allowBeanDefinitionOverriding,
javax.servlet.ServletContext servletContext,
boolean mergeWithOuterResources,
boolean mostSpecificResourceLast,
boolean mostSpecificBeanDefinitionCounts)
- There is no parent app context.
- See Also:
#ModuleWebApplicationContext(String[], String[], boolean,
ServletContext, boolean, boolean, boolean))
ModuleWebApplicationContext
public ModuleWebApplicationContext(String[] inclusiveConfigLocations,
String[] exclusiveConfigLocations,
boolean allowBeanDefinitionOverriding,
javax.servlet.ServletContext servletContext,
boolean mergeWithOuterResources,
boolean mostSpecificResourceLast,
boolean mostSpecificBeanDefinitionCounts,
ApplicationContext parent)
- Create a new ModuleApplicationContext with the given parent, loading the
definitions from the given XML files in "inclusiveConfigLocations"
excluded the XML files defined in "exclusiveConfigLocations". If the
parameter "allowBeanDefinitionOverriding" is set to true then the
BeanFactory is allowed to override a bean if there is another one with
the same name.
- Parameters:
inclusiveConfigLocations
- array of file pathsexclusiveConfigLocations
- array of file paths which are excludedallowBeanDefinitionOverriding
- a boolean which defines if overriding of bean definitions is
allowedservletContext
- the servlet context where this application context is usedmergeWithOuterResources
- a boolean which defines if the resources retrieved by the
configuration files section of the manifest files should be
merged with resources found by searching in the file system.mostSpecificResourceLast
- Indicates if the most specific resource should be the last
resource in the fetched resource array. If its value is set to
true
and only one resource is requested the
least specific resource will be returned.mostSpecificBeanDefinitionCounts
- Indicates that the most specific bean definition is used.parent
- Is the parent application context.
getExclusiveConfigLocations
public String[] getExclusiveConfigLocations()
- Returns:
- Returns the exclusiveConfigLocations.
getInclusiveConfigLocations
public String[] getInclusiveConfigLocations()
- Returns:
- Returns the inclusiveConfigLocations.
isAllowBeanDefinitionOverriding
public boolean isAllowBeanDefinitionOverriding()
- Returns:
- Returns the allowBeanDefinitionOverriding.
isMergeWithOuterResources
public boolean isMergeWithOuterResources()
- Returns:
- Returns the mergeWithOuterResources.
isMostSpecificResourceLast
public boolean isMostSpecificResourceLast()
- Returns:
- Returns the mostSpecificResourceLast.
isMostSpecificBeanDefinitionCounts
public boolean isMostSpecificBeanDefinitionCounts()
- Returns:
- Returns the mostSpecificBeanDefinitionCounts.
getResource
public Resource getResource(String location)
-
- Specified by:
getResource
in interface ResourceLoader
- Overrides:
getResource
in class DefaultResourceLoader
getResources
public Resource[] getResources(String locationPattern)
throws IOException
-
- Specified by:
getResources
in interface ResourcePatternResolver
- Overrides:
getResources
in class AbstractApplicationContext
- Throws:
IOException
createBeanFactory
protected DefaultListableBeanFactory createBeanFactory()
- Override method createBeanFactory() in class
AbstractRefreshableApplicationContext. The property
m_allowBeanDefinitionOverriding can be set and is handed over to the
DefaultListableBeanFactory which creates the BeanFactory.
- Overrides:
createBeanFactory
in class AbstractRefreshableApplicationContext
- Returns:
- the DefaultListableBeanFactory
getResourcePatternResolver
protected ResourcePatternResolver getResourcePatternResolver()
-
- Overrides:
getResourcePatternResolver
in class AbstractRefreshableWebApplicationContext
invokeBeanFactoryPostProcessors
protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory)
- Not just method
BeanFactoryPostProcessor.postProcessBeanFactory(
ConfigurableListableBeanFactory)
is invoked ordered but also the
creation of the factory post processor beans!
- Overrides:
invokeBeanFactoryPostProcessors
in class AbstractApplicationContext
prepareRefresh
protected void prepareRefresh()
-
- Overrides:
prepareRefresh
in class AbstractApplicationContext
finishRefresh
protected void finishRefresh()
- Notify all
ModuleApplicationListener
s that context has been refreshed.
- Overrides:
finishRefresh
in class AbstractApplicationContext
isRefreshed
public boolean isRefreshed()
-
- Specified by:
isRefreshed
in interface RefreshableModuleApplicationContext
- Returns:
true
if context is refreshed i.e. fully initialized
Copyright © 2005-2011 ELCA. All Rights Reserved.