de.mindmatters.faces.spring.context.support
Class DefaultFacesWebApplicationContext
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.AbstractRefreshableApplicationContext
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
org.springframework.web.context.support.XmlWebApplicationContext
de.mindmatters.faces.spring.context.support.DefaultFacesWebApplicationContext
- All Implemented Interfaces:
- FacesWebApplicationContext, BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver, ThemeSource, ConfigurableWebApplicationContext, WebApplicationContext
public class DefaultFacesWebApplicationContext
- extends XmlWebApplicationContext
- implements FacesWebApplicationContext
Default implementation of the FacesWebApplicationContext interface.
Uses the
ManagedBeanDefinitionDocumentReader
for loading the configured BeanDefinitions.
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
,
ManagedBeanDefinitionDocumentReader
,
ManagedBeanFactory
Methods inherited from class org.springframework.web.context.support.AbstractRefreshableWebApplicationContext |
getConfigLocations, getNamespace, getResourceByPath, getResourcePatternResolver, getServletConfig, getServletContext, getTheme, onRefresh, resolvePath, setConfigLocations, setNamespace, setServletConfig, setServletContext, toString |
Methods inherited from class org.springframework.context.support.AbstractApplicationContext |
addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroy, doClose, getAliases, getAutowireCapableBeanFactory, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getDisplayName, getInternalParentBeanFactory, getInternalParentMessageSource, getLifecycleBeans, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResources, getStartupDate, getType, isActive, isRunning, isSingleton, onClose, publishEvent, registerShutdownHook, setDisplayName, setParent, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DefaultFacesWebApplicationContext
public DefaultFacesWebApplicationContext()
- Standard constructor in JavaBeans-style.
createBeanFactory
protected final DefaultListableBeanFactory createBeanFactory()
- Create an internal bean factory for this context.
Called for each refresh attempt.
The default implementation creates a DefaultListableBeanFactory with the
internal bean factory of this context's parent as parent bean factory.
Can be overridden in subclasses.
- Overrides:
createBeanFactory
in class AbstractRefreshableApplicationContext
- Returns:
- the bean factory for this context
- See Also:
DefaultListableBeanFactory
,
AbstractApplicationContext.refresh()
,
AbstractApplicationContext.getInternalParentBeanFactory()
createManagedBeanFactory
protected ManagedBeanFactory createManagedBeanFactory()
- Create an internal managed bean factory for this context.
The default implementation creates a ManagedBeanFactory
with the
internal bean factory of this context's parent as parent bean factory.
Can be overridden in subclasses.
- Returns:
- the bean factory for this context
initBeanDefinitionReader
protected final void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader)
- Sets the document-reader class of the
beanDefinitionReader
to the ManagedBeanDefinitionDocumentReader
class.
- Overrides:
initBeanDefinitionReader
in class XmlWebApplicationContext
- Parameters:
beanDefinitionReader
- the reader to initialize- See Also:
#initBeanDefinitionReader(org.springframework.beans.factory.xml.XmlBeanDefinitionReader)
,
ManagedBeanDefinitionDocumentReader
setFacesSpringConfigLocations
public final void setFacesSpringConfigLocations(java.lang.String[] locations)
- Sets the config locations. Should be config files compatible with the
"spring-beans.dtd", "spring-beans-2.0.dtd" respectively the schema
"spring-beans-2.0.xsd".
- Specified by:
setFacesSpringConfigLocations
in interface FacesWebApplicationContext
- Parameters:
locations
- the config locations
getFacesSpringConfigLocations
protected final java.lang.String[] getFacesSpringConfigLocations()
- Returns the locations of the jsf-spring configuration files.
- Returns:
- The locations of the jsf-spring configuration files
loadBeanDefinitions
protected final void loadBeanDefinitions(XmlBeanDefinitionReader reader)
throws java.io.IOException
- Load the bean definitions with the given XmlBeanDefinitionReader.
The lifecycle of the bean factory is handled by the refreshBeanFactory method;
therefore this method is just supposed to load and/or register bean definitions.
Delegates to a ResourcePatternResolver for resolving location patterns
into Resource instances.
- Overrides:
loadBeanDefinitions
in class XmlWebApplicationContext
- Throws:
java.io.IOException
- if the required XML document isn't found- See Also:
AbstractRefreshableApplicationContext.refreshBeanFactory()
,
AbstractRefreshableWebApplicationContext.getConfigLocations()
,
AbstractApplicationContext.getResources(java.lang.String)
,
AbstractRefreshableWebApplicationContext.getResourcePatternResolver()
postProcessBeanFactory
protected final void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
- Register ServletContextAwareProcessor.
- Overrides:
postProcessBeanFactory
in class AbstractRefreshableWebApplicationContext
- Parameters:
beanFactory
- the bean factory used by the application context- See Also:
ServletContextAwareProcessor
onPostProcessBeanFactory
protected void onPostProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
- Hook method for postprocessing the internal bean factory.
- Parameters:
beanFactory
- the bean factory used by this application context
- Throws:
BeansException
- in case of errors
getDefaultConfigLocations
protected final java.lang.String[] getDefaultConfigLocations()
- The default location for the root context is "/WEB-INF/applicationContext.xml",
and "/WEB-INF/test-servlet.xml" for a context with the namespace "test-servlet"
(like for a DispatcherServlet instance with the servlet-name "test").
- Overrides:
getDefaultConfigLocations
in class XmlWebApplicationContext
- See Also:
AbstractRefreshableWebApplicationContext.setConfigLocations(java.lang.String[])
getDefaultFacesSpringConfigLocations
protected final java.lang.String[] getDefaultFacesSpringConfigLocations()
- The default location for jsf-spring config files is
"/WEB-INF/faces-spring-context.xml", and all
"/META-INF/faces-spring-context.xml".
- Returns:
- The locations.
refresh
public void refresh()
- Sets a default config location if no explicit config location specified.
- Specified by:
refresh
in interface ConfigurableApplicationContext
- Overrides:
refresh
in class AbstractRefreshableWebApplicationContext
- See Also:
AbstractRefreshableWebApplicationContext.getDefaultConfigLocations()
,
AbstractRefreshableWebApplicationContext.setConfigLocations(java.lang.String[])
Copyright © 2006 mindmatters GmbH & Co. KG