ch.elca.el4j.web.context
Class ModuleContextLoader

java.lang.Object
  extended by org.springframework.web.context.ContextLoader
      extended by ch.elca.el4j.web.context.ModuleContextLoader

public class ModuleContextLoader
extends ContextLoader

This class extends Spring's ContextLoader. It inherits its complete behaviour but replaces the web application context with a ModuleWebApplicationContext which can be configured with inclusive configuration locations, exclusive configuration locations, and booleans indicating whether bean overriding is allowed and whether the resources retrieved by the configuration files section of the manifest files should be merged with resources found by searching in the file system.

Author:
Alex Mathey (AMA)
See Also:
ContextLoader, ModuleContextLoaderListener
File-location:
ModuleContextLoader
Last check-in date:
2010-11-02 11:44:37 +0100 (Di, 02. Nov 2010) by swisswheel for revision 4204

Field Summary
static String BEAN_OVERRIDING_PARAM
          Name of servlet context parameter indicating whether bean definition overriding is allowed in the application context.
static String EXCLUSIVE_LOCATIONS_PARAM
          Name of servlet context parameter that can specify the exclusive configuration locations for the application context.
static String INCLUSIVE_LOCATIONS_PARAM
          Name of servlet context parameter that can specify the inclusive configuration locations for the application context.
static String MERGE_RESOURCES_PARAM
          Name of servlet context parameter indicating whether the resources retrieved by the configuration files section of the manifest files should be merged with resources found by searching in the file system.
 
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
ModuleContextLoader()
           
 
Method Summary
protected  WebApplicationContext createWebApplicationContext(javax.servlet.ServletContext servletContext, ApplicationContext parent)
          
protected  Class<?> determineContextClass(javax.servlet.ServletContext servletContext)
          
protected  String[] getExclusiveConfigLocations(javax.servlet.ServletContext servletContext)
          Returns the exclusive configuration locations.
protected  String[] getInclusiveConfigLocations(javax.servlet.ServletContext servletContext)
          Returns the inclusive configuration locations.
protected  boolean isBeanDefinitionOverridingAllowed(javax.servlet.ServletContext servletContext)
          Returns whether bean definition overriding is allowed.
protected  boolean isMergingWithOuterResourcesAllowed(javax.servlet.ServletContext servletContext)
          Returns whether the resources retrieved by the configuration files section of the manifest files should be merged ith resources found by searching in the file system.
 
Methods inherited from class org.springframework.web.context.ContextLoader
closeWebApplicationContext, customizeContext, getCurrentWebApplicationContext, initWebApplicationContext, loadParentContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INCLUSIVE_LOCATIONS_PARAM

public static final String INCLUSIVE_LOCATIONS_PARAM
Name of servlet context parameter that can specify the inclusive configuration locations for the application context.

See Also:
Constant Field Values

EXCLUSIVE_LOCATIONS_PARAM

public static final String EXCLUSIVE_LOCATIONS_PARAM
Name of servlet context parameter that can specify the exclusive configuration locations for the application context.

See Also:
Constant Field Values

BEAN_OVERRIDING_PARAM

public static final String BEAN_OVERRIDING_PARAM
Name of servlet context parameter indicating whether bean definition overriding is allowed in the application context.

See Also:
Constant Field Values

MERGE_RESOURCES_PARAM

public static final String MERGE_RESOURCES_PARAM
Name of servlet context parameter indicating whether the resources retrieved by the configuration files section of the manifest files should be merged with resources found by searching in the file system.

See Also:
Constant Field Values
Constructor Detail

ModuleContextLoader

public ModuleContextLoader()
Method Detail

createWebApplicationContext

protected WebApplicationContext createWebApplicationContext(javax.servlet.ServletContext servletContext,
                                                            ApplicationContext parent)
                                                     throws BeansException

Overrides:
createWebApplicationContext in class ContextLoader
Throws:
BeansException

determineContextClass

protected Class<?> determineContextClass(javax.servlet.ServletContext servletContext)
                                  throws ApplicationContextException

Overrides:
determineContextClass in class ContextLoader
Throws:
ApplicationContextException

getInclusiveConfigLocations

protected String[] getInclusiveConfigLocations(javax.servlet.ServletContext servletContext)
Returns the inclusive configuration locations.

Parameters:
servletContext - current servlet context
Returns:
array containing the inclusive configuration locations

getExclusiveConfigLocations

protected String[] getExclusiveConfigLocations(javax.servlet.ServletContext servletContext)
Returns the exclusive configuration locations.

Parameters:
servletContext - current servlet context
Returns:
array containing the inclusive configuration locations

isBeanDefinitionOverridingAllowed

protected boolean isBeanDefinitionOverridingAllowed(javax.servlet.ServletContext servletContext)
Returns whether bean definition overriding is allowed.

Parameters:
servletContext - current servlet context
Returns:
boolean indicating whether bean overriding is allowed

isMergingWithOuterResourcesAllowed

protected boolean isMergingWithOuterResourcesAllowed(javax.servlet.ServletContext servletContext)
Returns whether the resources retrieved by the configuration files section of the manifest files should be merged ith resources found by searching in the file system.

Parameters:
servletContext - current servlet context
Returns:
boolean indicating whether resource merging is allowed


Copyright © 2005-2011 ELCA. All Rights Reserved.