|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.mindmatters.faces.spring.config.ConfigLoader
Performs the actual initialization work for the jsf-spring-config root application context. Called by ConfigLoaderListener and ConfigLoaderServlet.
Looks for the context-param faces.spring.configClass
to
determine the context class type, falling back to the default implementation
of (ConfigWebApplicationContext
if not found. With the default
ConfigLoader implementation, any context class specified needs to implement
ConfigWebApplicationContext.
Passes the context-param faces.spring.CONFIG_FILES
to the
context instance, parsing it into potentially multiple file paths which can
be separated by any number of commas and spaces, like
"applicationContext1.xml, applicationContext2.xml". If not explicitly
specified, the context implementation is supposed to use a default location
("/WEB-INF/faces-spring-config.xml").
Above and beyond loading the faces root application context, this class tries
to obtain and hook up a shared parent context to the faces root application
context. See the loadParentContext(ServletContext)
method for more
information.
ContextLoaderListener
,
ContextLoaderServlet
,
DefaultFacesWebApplicationContext
Field Summary | |
static java.lang.String |
CONFIG_CLASS_PARAM
Config param for the JSF configuration application context implementation class ConfigWebApplicationContext to use:
faces.spring.configClass . |
static java.lang.String |
CONFIG_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-config configuration information: faces.spring.CONFIG_FILES . |
protected org.apache.commons.logging.Log |
logger
For logging. |
Constructor Summary | |
ConfigLoader()
|
Method Summary | |
void |
closeConfigWebApplicationContext(javax.servlet.ServletContext servletContext)
Closes the jsf-spring-config web application context for the given servlet context. |
protected void |
closeParentApplicationContext(javax.servlet.ServletContext servletContext,
ApplicationContext parent)
Closes the parent web application context of jsf-spring-config web application context for the given servlet context. |
protected ConfigWebApplicationContext |
createConfigWebApplicationContext(javax.servlet.ServletContext servletContext,
ApplicationContext parent)
Creates and returns a ConfigWebApplicationContext . |
protected java.lang.Class |
determineContextClass(javax.servlet.ServletContext servletContext)
Returns the WebApplicationContext implementation class to use, either the default ConfigWebApplicationContext or a custom context class if specified. |
ConfigWebApplicationContext |
initConfigWebApplicationContext(javax.servlet.ServletContext servletContext)
Initialize jsf-spring-config 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)
Loads and returns a root parent application context for the ConfigWebApplicationContext (usually an xml context based on the
"spring-beans" DTD). |
protected java.lang.String[] |
resolveConfigLocations(ResourceLoader resourceLoader,
javax.servlet.ServletContext servletContext)
Returns a list with Strings identifying the faces-spring-config configuration file resources. |
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 CONFIG_CLASS_PARAM
ConfigWebApplicationContext
to use:
faces.spring.configClass
.
public static final java.lang.String CONFIG_LOCATION_PARAM
faces.spring.CONFIG_FILES
.
Constructor Detail |
public ConfigLoader()
Method Detail |
public final ConfigWebApplicationContext initConfigWebApplicationContext(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 initializedCONFIG_CLASS_PARAM
,
CONFIG_LOCATION_PARAM
protected ApplicationContext loadParentContext(javax.servlet.ServletContext servletContext)
ConfigWebApplicationContext
(usually an xml context based on the
"spring-beans" DTD).
servletContext
- the servlet context
BeansException
- in cases of errorsContextLoader
protected ConfigWebApplicationContext createConfigWebApplicationContext(javax.servlet.ServletContext servletContext, ApplicationContext parent)
ConfigWebApplicationContext
.
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 loadedCONFIG_CLASS_PARAM
protected final java.lang.String[] resolveConfigLocations(ResourceLoader resourceLoader, javax.servlet.ServletContext servletContext)
resourceLoader
- the ResourceLoader to use for loading config locationsservletContext
- the servlet context
BeansException
- in cases of errorsCONFIG_LOCATION_PARAM
public final void closeConfigWebApplicationContext(javax.servlet.ServletContext servletContext)
servletContext
- the servlet contextprotected 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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |