|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.web.context.ContextLoader
org.broadleafcommerce.profile.web.extensibility.MergeContextLoader
public class MergeContextLoader
Performs the actual initialization work for the rootId application context.
Called by MergeContextLoaderListener.
Processes a "contextConfigLocation"
context-param and passes its value to the context instance, parsing it into
potentially multiple file paths which can be separated by any number of
commas and spaces, e.g. "WEB-INF/applicationContext1.xml,
WEB-INF/applicationContext2.xml". Ant-style path patterns are supported as well,
e.g. "WEB-INF/*Context.xml,WEB-INF/spring*.xml" or "WEB-INF/**/*Context.xml".
If not explicitly specified, the context implementation is supposed to use a
default location (with XmlWebApplicationContext: "/WEB-INF/applicationContext.xml").
Note: In case of multiple config locations, later bean definitions will override ones defined in previously loaded files, at least when using one of Spring's default ApplicationContext implementations. This can be leveraged to deliberately override certain bean definitions via an extra XML file.
Above and beyond loading the rootId application context, this class
can optionally load or obtain and hook up a shared parent context to
the rootId application context. See the
ContextLoader.loadParentContext(ServletContext) method for more information.
Additionally, Processes a "patchConfigLocation"
context-param and passes its value to the context instance, parsing it into
potentially multiple file paths which can be separated by any number of
commas and spaces, e.g. "WEB-INF/patch1.xml,
WEB-INF/patch2.xml". Ant-style path patterns are supported as well,
e.g. "WEB-INF/*Patch.xml,WEB-INF/spring*.xml" or "WEB-INF/**/*Patch.xml".
The patch configuration files are merged into the above config
org.broadleafcommerce.profile.extensibility.MergeXmlConfigResourceFactory.
| Field Summary | |
|---|---|
static String |
PATCH_LOCATION_PARAM
Name of servlet context parameter (i.e., " patchConfigLocation")
that can specify the config location for the rootId context. |
static String |
SHUTDOWN_HOOK_BEAN
Name of a bean to hook before Spring shutdown for this context commences. |
static String |
SHUTDOWN_HOOK_METHOD
Name of method to call on the shutdown hook bean before Spring shutdown for this context commences |
| Fields inherited from class org.springframework.web.context.ContextLoader |
|---|
CONFIG_LOCATION_PARAM, CONTEXT_CLASS_PARAM, LOCATOR_FACTORY_KEY_PARAM, LOCATOR_FACTORY_SELECTOR_PARAM |
| Constructor Summary | |
|---|---|
MergeContextLoader()
|
|
| Method Summary | |
|---|---|
protected org.springframework.web.context.WebApplicationContext |
createWebApplicationContext(javax.servlet.ServletContext servletContext,
org.springframework.context.ApplicationContext parent)
Instantiate the rootId WebApplicationContext for this loader, either the default context class or a custom context class if specified. |
| Methods inherited from class org.springframework.web.context.ContextLoader |
|---|
closeWebApplicationContext, customizeContext, determineContextClass, getCurrentWebApplicationContext, initWebApplicationContext, loadParentContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PATCH_LOCATION_PARAM
patchConfigLocation")
that can specify the config location for the rootId context.
public static final String SHUTDOWN_HOOK_BEAN
public static final String SHUTDOWN_HOOK_METHOD
| Constructor Detail |
|---|
public MergeContextLoader()
| Method Detail |
|---|
protected org.springframework.web.context.WebApplicationContext createWebApplicationContext(javax.servlet.ServletContext servletContext,
org.springframework.context.ApplicationContext parent)
throws org.springframework.beans.BeansException
This implementation expects custom contexts to implement the
ConfigurableWebApplicationContext interface.
Can be overridden in subclasses.
In addition, ContextLoader.customizeContext(javax.servlet.ServletContext, org.springframework.web.context.ConfigurableWebApplicationContext) gets called prior to refreshing the
context, allowing subclasses to perform custom modifications to the context.
createWebApplicationContext in class org.springframework.web.context.ContextLoaderservletContext - current servlet contextparent - the parent ApplicationContext to use, or null if none
org.springframework.beans.BeansException - if the context couldn't be initializedConfigurableWebApplicationContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||