|
JSF-Spring | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mindmatters.faces.spring.context.ContextLoader
public class ContextLoader
Performs the actual initialization work for the root application context. Called by ContextLoaderListener and ContextLoaderServlet.
For further informtion please have a look at the documentation of
ContextLoader.
| Field Summary | |
|---|---|
static java.lang.String |
CONTEXT_CLASS_PARAM
Config param for root faces application context implementation class FacesWebApplicationContext to use:
faces.spring.contextClass. |
static java.lang.String |
CONTEXT_LOCATION_PARAM
Context initialization parameter name for a comma delimited list of context-relative resource paths (which is loaded automatically if it exists) containing faces-spring-context configuration information: faces.spring.CONTEXT_FILES. |
static java.lang.String |
LOCATOR_FACTORY_KEY_PARAM
Optional servlet context parameter used only when obtaining a parent context using the default implementation of loadParentContext(ServletContext servletContext). |
static java.lang.String |
LOCATOR_FACTORY_SELECTOR_PARAM
Optional servlet context parameter used only when obtaining a parent context using the default implementation of loadParentContext(ServletContext servletContext). |
protected org.apache.commons.logging.Log |
logger
For logging. |
| Constructor Summary | |
|---|---|
ContextLoader()
|
|
| Method Summary | |
|---|---|
protected void |
closeParentApplicationContext(javax.servlet.ServletContext servletContext,
ApplicationContext parent)
Closes the parent web application context of jsf-spring web application context for the given servlet context. |
void |
closeWebApplicationContext(javax.servlet.ServletContext servletContext)
Closes the web application context for the given servlet context. |
protected WebApplicationContext |
createWebApplicationContext(javax.servlet.ServletContext servletContext,
ApplicationContext parent)
Creates and returns a WebApplicationContext. |
protected java.lang.Class |
determineContextClass(javax.servlet.ServletContext servletContext)
Returns the WebApplicationContext implementation class to use, either the default FacesWebApplicationContext or a custom context class if specified. |
WebApplicationContext |
initWebApplicationContext(javax.servlet.ServletContext servletContext)
Initialize web application context for the given servlet context, regarding the faces.spring.configClass and
faces.spring.CONFIG_FILES context-params. |
protected ApplicationContext |
loadParentContext(javax.servlet.ServletContext servletContext)
Template method with default implementation (which may be overridden by a subclass), to load or obtain an ApplicationContext instance which will be used as the parent context of the root WebApplicationContext. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
public static final java.lang.String CONTEXT_CLASS_PARAM
FacesWebApplicationContext to use:
faces.spring.contextClass.
public static final java.lang.String CONTEXT_LOCATION_PARAM
faces.spring.CONTEXT_FILES.
public static final java.lang.String LOCATOR_FACTORY_SELECTOR_PARAM
loadParentContext(ServletContext servletContext). Specifies the
'selector' used in the
ContextSingletonBeanFactoryLocator.getInstance(String selector)
method call used to obtain the BeanFactoryLocator instance from which the
parent context is obtained.
This will normally be set to classpath*:beanRefContext.xml
to match the default applied for the
ContextSingletonBeanFactoryLocator.getInstance()
method.
public static final java.lang.String LOCATOR_FACTORY_KEY_PARAM
loadParentContext(ServletContext servletContext). Specifies the
'factoryKey' used in the
#useBeanFactory(String factoryKey) method call used to obtain the parent
application context from the BeanFactoryLocator instance.
| Constructor Detail |
|---|
public ContextLoader()
| Method Detail |
|---|
public final WebApplicationContext initWebApplicationContext(javax.servlet.ServletContext servletContext)
faces.spring.configClass and
faces.spring.CONFIG_FILES context-params.
servletContext - current servlet context
BeansException - if the context couldn't be initializedCONTEXT_CLASS_PARAM,
CONTEXT_LOCATION_PARAMprotected ApplicationContext loadParentContext(javax.servlet.ServletContext servletContext)
The default implementation uses ContextSingletonBeanFactoryLocator,
configured via LOCATOR_FACTORY_SELECTOR_PARAM and
LOCATOR_FACTORY_KEY_PARAM, to load a parent context which will
be shared by all other users of ContextsingletonBeanFactoryLocator which
also use the same configuration parameters, or if
LOCATOR_FACTORY_KEY_PARAM is not set a parent context obtained
by
WebApplicationContextUtils.getWebApplicationContext(javax.servlet.ServletContext).
servletContext - current servlet context
null if none
BeansException - if the context couldn't be initializedBeanFactoryLocator,
ContextSingletonBeanFactoryLocator
protected WebApplicationContext createWebApplicationContext(javax.servlet.ServletContext servletContext,
ApplicationContext parent)
WebApplicationContext.
servletContext - the servlet contextparent - parent application context
BeansException - in cases of errorsprotected final java.lang.Class determineContextClass(javax.servlet.ServletContext servletContext)
servletContext - current servlet context
ApplicationContextException - if the context class couldn't be loadedCONTEXT_CLASS_PARAM,
XmlWebApplicationContextpublic final void closeWebApplicationContext(javax.servlet.ServletContext servletContext)
servletContext - the servlet context
protected void closeParentApplicationContext(javax.servlet.ServletContext servletContext,
ApplicationContext parent)
loadParentContext(ServletContext), you may have to override
this method as well.
servletContext - the servlet contextparent - parent ApplicationContext
|
JSF-Spring | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||