|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.spring.SpringComponentLocator
This is the connection between Cocoon and Spring. We create an own web application context.
Field Summary | |
static String |
APPLICATION_CONTEXT_REQUEST_ATTRIBUTE
|
protected Core |
cocoon
|
protected String |
configLocation
|
protected Context |
context
|
protected String |
contextClassName
|
protected EnvironmentHelper |
environmentHelper
|
protected String |
locatorFactorySelector
|
protected ServiceManager |
manager
|
protected String |
parentContextKey
|
protected SourceResolver |
resolver
|
protected ServletContext |
servletContext
|
protected CocoonApplicationContext |
wac
|
Constructor Summary | |
SpringComponentLocator()
|
Method Summary | |
void |
configure(Configuration config)
|
void |
contextualize(Context context)
|
protected org.springframework.context.ApplicationContext |
createCocoonAppContext(org.springframework.context.ApplicationContext parent)
Create an application context that contains Cocoon specific beans. |
protected CocoonApplicationContext |
createWebApplicationContext(org.springframework.context.ApplicationContext parent)
Instantiate the web application context for this loader, either a default CocoonApplicationContext or a custom context class if specified. |
void |
dispose()
Close Spring's web application context. |
void |
enteredSitemap(EnterSitemapEvent event)
|
Object |
getComponent(String key)
|
protected org.springframework.context.ApplicationContext |
getParentContext()
Get the parent application context: this is either the context of a parent sitemap or an optional web application context set by the spring servlet (filter). |
boolean |
hasComponent(String key)
|
void |
initialize()
Initialize Spring's web application context. |
void |
leftSitemap(LeaveSitemapEvent event)
|
protected void |
registerDefaults(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory)
Register cocoon components that will be available for spring components. |
void |
release(Object component)
|
void |
service(ServiceManager aManager)
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String APPLICATION_CONTEXT_REQUEST_ATTRIBUTE
protected ServletContext servletContext
protected EnvironmentHelper environmentHelper
protected ServiceManager manager
protected SourceResolver resolver
protected Core cocoon
protected Context context
protected CocoonApplicationContext wac
protected String contextClassName
protected String configLocation
protected String locatorFactorySelector
protected String parentContextKey
Constructor Detail |
public SpringComponentLocator()
Method Detail |
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)
public void service(ServiceManager aManager) throws ServiceException
service
in interface Serviceable
ServiceException
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
public void configure(Configuration config) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)
public void initialize() throws Exception
initialize
in interface Initializable
org.springframework.beans.BeansException
- if the context couldn't be initialized
Exception
Initializable.initialize()
public void dispose()
dispose
in interface Disposable
Disposable.dispose()
public boolean hasComponent(String key)
hasComponent
in interface ComponentLocator
ComponentLocator.hasComponent(java.lang.String)
public Object getComponent(String key) throws ProcessingException
getComponent
in interface ComponentLocator
ProcessingException
ComponentLocator.getComponent(java.lang.String)
public void release(Object component)
release
in interface ComponentLocator
ComponentLocator.release(java.lang.Object)
protected CocoonApplicationContext createWebApplicationContext(org.springframework.context.ApplicationContext parent) throws org.springframework.beans.BeansException
This implementation expects custom contexts to be a subclass of CocoonApplicationContext.
parent
- the parent ApplicationContext to use, or null if none
org.springframework.beans.BeansException
- if the context couldn't be initializedprotected org.springframework.context.ApplicationContext createCocoonAppContext(org.springframework.context.ApplicationContext parent)
protected void registerDefaults(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory)
factory
- The factory to register with.protected org.springframework.context.ApplicationContext getParentContext()
public void enteredSitemap(EnterSitemapEvent event)
enteredSitemap
in interface EnterSitemapEventListener
EnterSitemapEventListener.enteredSitemap(org.apache.cocoon.sitemap.EnterSitemapEvent)
public void leftSitemap(LeaveSitemapEvent event)
leftSitemap
in interface LeaveSitemapEventListener
LeaveSitemapEventListener.leftSitemap(org.apache.cocoon.sitemap.LeaveSitemapEvent)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |