SourceForge.net Logo

de.mindmatters.faces.spring.context.support
Class DefaultFacesWebApplicationContext

java.lang.Object
  extended byorg.springframework.core.io.DefaultResourceLoader
      extended byorg.springframework.context.support.AbstractApplicationContext
          extended byorg.springframework.context.support.AbstractRefreshableApplicationContext
              extended byorg.springframework.web.context.support.AbstractRefreshableWebApplicationContext
                  extended byorg.springframework.web.context.support.XmlWebApplicationContext
                      extended byde.mindmatters.faces.spring.factory.support.AbstractFacesWebApplicationContext
                          extended byde.mindmatters.faces.spring.context.support.DefaultFacesWebApplicationContext
All Implemented Interfaces:
ApplicationContext, ApplicationEventPublisher, BeanFactory, ConfigurableApplicationContext, ConfigurableWebApplicationContext, DisposableBean, FacesWebApplicationContext, HierarchicalBeanFactory, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver, ThemeSource, WebApplicationContext

public class DefaultFacesWebApplicationContext
extends AbstractFacesWebApplicationContext
implements FacesWebApplicationContext

Default implementation of the FacesWebApplicationContext interface.

Uses the ManagedBeanDefinitionParser and the ScopedBeanDefinitionParser for loading the configured BeanDefinitions.

A ScopedBeanStorage may also be supplied as a bean in the context, with the name "scopedBeanStorage"; else, scope storage resolution is delegated to a default implementation.

Uses and enables DelegatingVariableResolver as JSF VariableResolver. The DelegatingVariableResolver cares about bean resolution from a view (e.g. a jsp resource).

Author:
Andreas Kuhrwahl
See Also:
ContextLoader, ContextLoaderListener, ContextLoaderServlet, ManagedBeanDefinitionParser, ScopedBeanDefinitionParser, ManagedBeanFactory

Field Summary
static java.lang.String SCOPED_BEAN_STORAGE_BEAN_NAME
          Name of the ScopedBeanStorage bean in the factory.
 
Fields inherited from class org.springframework.web.context.support.XmlWebApplicationContext
DEFAULT_CONFIG_LOCATION, DEFAULT_CONFIG_LOCATION_PREFIX, DEFAULT_CONFIG_LOCATION_SUFFIX
 
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
 
Fields inherited from interface de.mindmatters.faces.spring.context.FacesWebApplicationContext
ROOT_FACES_WEB_APPLICATION_CONTEXT_ATTRIBUTE
 
Fields inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
CONFIG_LOCATION_DELIMITERS
 
Fields inherited from interface org.springframework.web.context.WebApplicationContext
ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX, CLASSPATH_URL_PREFIX
 
Constructor Summary
DefaultFacesWebApplicationContext()
           
 
Method Summary
protected  DefaultConfigurableBeanFactory createConfigurableBeanFactory()
          Create the bean factory for this context.
protected  void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader)
          Sets the parser-class of the beanDefinitionReader to the ManagedBeanDefinitionParser class.
protected  void loadBeanDefinitions(XmlBeanDefinitionReader reader)
          
protected  void postProcessBeanFactory(ConfigurableBeanFactory beanFactory)
          Hook method for postprocessing the internal bean factory.
protected  void postProcessManagedBeanFactory(ManagedBeanFactory managedBeanFactory)
          Hook method for postprocessing the internal used ManagedBeanFactory.
 void setFacesSpringConfigLocations(java.lang.String[] facesSpringConfigLocations)
          Sets the config locations. Should be config files compatible with the "spring-beans.dtd" respectively "jsf-spring-beans.dtd".
 void setManagedBeanFactoryClass(java.lang.Class managedBeanFactoryClass)
          Sets the class for the internal used BeanFactory. The BeanFactory must implement ManagedBeanFactory. Usually the ManagedBeanFactory will be set by the ContextLoader.
 
Methods inherited from class de.mindmatters.faces.spring.factory.support.AbstractFacesWebApplicationContext
createBeanFactory, getConfigurableBeanFactory, postProcessBeanFactory
 
Methods inherited from class org.springframework.web.context.support.XmlWebApplicationContext
getDefaultConfigLocations, loadBeanDefinitions
 
Methods inherited from class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
getConfigLocations, getNamespace, getResourceByPath, getResourcePatternResolver, getServletContext, getTheme, onRefresh, refresh, setConfigLocations, setNamespace, setServletContext, toString
 
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
getBeanFactory, refreshBeanFactory
 
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, getAliases, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getDisplayName, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getType, isSingleton, publishEvent, setDisplayName, setParent
 
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
setConfigLocations, setNamespace, setServletContext
 
Methods inherited from interface org.springframework.web.context.WebApplicationContext
getServletContext
 
Methods inherited from interface org.springframework.context.ApplicationContext
getDisplayName, getParent, getStartupDate, publishEvent
 
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType
 
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getType, isSingleton
 
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
getParentBeanFactory
 
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
 
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
 
Methods inherited from interface org.springframework.core.io.ResourceLoader
getResource
 
Methods inherited from interface org.springframework.ui.context.ThemeSource
getTheme
 
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addBeanFactoryPostProcessor, close, getBeanFactory, refresh, setParent
 

Field Detail

SCOPED_BEAN_STORAGE_BEAN_NAME

public static final java.lang.String SCOPED_BEAN_STORAGE_BEAN_NAME
Name of the ScopedBeanStorage bean in the factory. If none is supplied, storage resolution is done by a default implementation.

See Also:
ScopedBeanStorage, Constant Field Values
Constructor Detail

DefaultFacesWebApplicationContext

public DefaultFacesWebApplicationContext()
Method Detail

createConfigurableBeanFactory

protected final DefaultConfigurableBeanFactory createConfigurableBeanFactory()
Create the bean factory for this context.

Specified by:
createConfigurableBeanFactory in class AbstractFacesWebApplicationContext
Returns:
the bean factory for this context
See Also:
DefaultConfigurableBeanFactory, AbstractApplicationContext.getInternalParentBeanFactory()

initBeanDefinitionReader

protected final void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader)
Sets the parser-class of the beanDefinitionReader to the ManagedBeanDefinitionParser class.

Parameters:
beanDefinitionReader - the reader to initialize
See Also:
#initBeanDefinitionReader(org.springframework.beans.factory.xml.XmlBeanDefinitionReader), ManagedBeanDefinitionParser

setFacesSpringConfigLocations

public final void setFacesSpringConfigLocations(java.lang.String[] facesSpringConfigLocations)
Sets the config locations. Should be config files compatible with the "spring-beans.dtd" respectively "jsf-spring-beans.dtd".

Specified by:
setFacesSpringConfigLocations in interface FacesWebApplicationContext
Parameters:
facesSpringConfigLocations - the config locations

loadBeanDefinitions

protected final void loadBeanDefinitions(XmlBeanDefinitionReader reader)
                                  throws java.io.IOException

Throws:
java.io.IOException

postProcessBeanFactory

protected final void postProcessBeanFactory(ConfigurableBeanFactory beanFactory)
Hook method for postprocessing the internal bean factory.

Overrides:
postProcessBeanFactory in class AbstractFacesWebApplicationContext
Parameters:
beanFactory - the bean factory used by this application context
See Also:
ConfigurableBeanFactory

postProcessManagedBeanFactory

protected void postProcessManagedBeanFactory(ManagedBeanFactory managedBeanFactory)
Hook method for postprocessing the internal used ManagedBeanFactory.

Parameters:
managedBeanFactory - internal BeanFactory

setManagedBeanFactoryClass

public final void setManagedBeanFactoryClass(java.lang.Class managedBeanFactoryClass)
Sets the class for the internal used BeanFactory. The BeanFactory must implement ManagedBeanFactory. Usually the ManagedBeanFactory will be set by the ContextLoader.

Specified by:
setManagedBeanFactoryClass in interface FacesWebApplicationContext
Parameters:
managedBeanFactoryClass - the class of the internal BeanFactory
See Also:
ContextLoader.createFacesConfigWebApplicationContext(javax.servlet.ServletContext, org.springframework.context.ApplicationContext)

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG