org.figure8.join.core
Class ContainerContextLoader

java.lang.Object
  extended by org.springframework.web.context.ContextLoader
      extended by org.figure8.join.core.ContainerContextLoader

public class ContainerContextLoader
extends org.springframework.web.context.ContextLoader

An extension of Spring ContextLoader that always load the Join bootstrap context as parent context.

Version:
$Revision: 1.4 $
Author:
Laurent Broudoux

Field Summary
static java.lang.String EXTRA_CONFIG_LOCATION_PARAM
          Name of servlet context parameter that can specify the extra config location for the root context.
 
Fields inherited from class org.springframework.web.context.ContextLoader
BEAN_FACTORY_LOCATOR_FACTORY_KEY_PARAM, beanFactoryRef, CONFIG_LOCATION_PARAM, CONTEXT_CLASS_PARAM, DEFAULT_CONTEXT_CLASS, LOCATOR_FACTORY_SELECTOR_PARAM
 
Constructor Summary
ContainerContextLoader()
          Creates a new instance of ContainerContextLoader
 
Method Summary
protected  boolean addingExtraConfigLocationAllowed()
          Check if some extra configuration files locations should be added to the default one.
protected  org.springframework.web.context.WebApplicationContext createWebApplicationContext(javax.servlet.ServletContext servletContext, org.springframework.context.ApplicationContext parent)
          Instantiate the root WebApplicationContext for this loader, ie a XmlWebApplicationContext.
protected  org.springframework.context.ApplicationContext loadParentContext(javax.servlet.ServletContext servletContext)
          Load the parent context for the given servlet context.
 
Methods inherited from class org.springframework.web.context.ContextLoader
closeWebApplicationContext, initWebApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTRA_CONFIG_LOCATION_PARAM

public static final java.lang.String EXTRA_CONFIG_LOCATION_PARAM
Name of servlet context parameter that can specify the extra config location for the root context. This locations may be added to those present in default config location depending on the result of addingExtraConfigLocationAllowed()

See Also:
Constant Field Values
Constructor Detail

ContainerContextLoader

public ContainerContextLoader()
Creates a new instance of ContainerContextLoader

Method Detail

loadParentContext

protected org.springframework.context.ApplicationContext loadParentContext(javax.servlet.ServletContext servletContext)
                                                                    throws org.springframework.beans.BeansException
Load the parent context for the given servlet context. Always use the Join bootstrap context in this case.

Overrides:
loadParentContext in class org.springframework.web.context.ContextLoader
Parameters:
servletContext - Servlet context for whom load parent context
Returns:
The Join bootstrap context.
Throws:
org.springframework.beans.BeansException

createWebApplicationContext

protected org.springframework.web.context.WebApplicationContext createWebApplicationContext(javax.servlet.ServletContext servletContext,
                                                                                            org.springframework.context.ApplicationContext parent)
                                                                                     throws org.springframework.beans.BeansException
Instantiate the root WebApplicationContext for this loader, ie a XmlWebApplicationContext.

This implementation expects custom contexts to implement ConfigurableWebApplicationContext. Can be overridden in subclasses.

Overrides:
createWebApplicationContext in class org.springframework.web.context.ContextLoader
Parameters:
servletContext - current servlet context
parent - the parent ApplicationContext to use, or null if none
Returns:
The newly created Join web application context
Throws:
org.springframework.beans.BeansException - if the context couldn't be initialized

addingExtraConfigLocationAllowed

protected boolean addingExtraConfigLocationAllowed()
Check if some extra configuration files locations should be added to the default one. This is a hook for subclasses to specifiy their adding criteria. This implementation return true if this context is one the asynchronous side of the application (so that asynchronous applicative services may be started)

Returns:
True if we are on asynchronous side of the application, false otherwise.


Copyright © 2005-2008 Join. All Rights Reserved.