You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/12/28 16:58:04 UTC
svn commit: r490747 - in
/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon:
components/modules/input/ components/treeprocessor/
components/treeprocessor/sitemap/ core/container/spring/
core/container/spring/avalon/ environment/ environment...
Author: cziegeler
Date: Thu Dec 28 07:58:03 2006
New Revision: 490747
URL: http://svn.apache.org/viewvc?view=rev&rev=490747
Log:
Simplify container handling - no instance of Container needed anymore
Modified:
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Container.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java Thu Dec 28 07:58:03 2006
@@ -68,8 +68,7 @@
*/
public Object getAttribute(String name, Configuration modeConf, Map objectModel)
throws ConfigurationException {
- final Container container = Container.getCurrentContainer();
- final Settings settings = (Settings)container.getBeanFactory().getBean(Settings.ROLE);
+ final Settings settings = (Settings)Container.getCurrentWebApplicationContext().getBean(Settings.ROLE);
return settings.getProperty(name);
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java Thu Dec 28 07:58:03 2006
@@ -38,7 +38,7 @@
*/
public void setBuilder(TreeBuilder treeBuilder) {
this.treeBuilder = treeBuilder;
- this.manager = (ServiceManager)treeBuilder.getContainer().getBeanFactory().getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
+ this.manager = (ServiceManager)treeBuilder.getWebApplicationContext().getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
}
/**
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java Thu Dec 28 07:58:03 2006
@@ -46,6 +46,7 @@
import org.apache.cocoon.sitemap.SitemapExecutor;
import org.apache.cocoon.util.location.Location;
import org.apache.cocoon.util.location.LocationImpl;
+import org.springframework.web.context.WebApplicationContext;
/**
* The concrete implementation of {@link Processor}, containing the evaluation tree and associated
@@ -89,7 +90,7 @@
protected Map processorAttributes = new HashMap();
/** Container for this sitemap. */
- protected Container container;
+ protected WebApplicationContext webAppContext;
/** Classloader for this sitemap. */
protected ClassLoader classLoader;
@@ -107,7 +108,7 @@
}
/** Set the processor data, result of the treebuilder job */
- public void setProcessorData(Container container,
+ public void setProcessorData(WebApplicationContext webAppContext,
ProcessingNode rootNode,
List disposableNodes,
List enterSitemapEventListeners,
@@ -115,9 +116,9 @@
if (this.rootNode != null) {
throw new IllegalStateException("setProcessorData() can only be called once");
}
- this.classLoader = container.getBeanFactory().getClassLoader();
- this.container = container;
- this.manager = (ServiceManager)this.container.getBeanFactory().getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
+ this.classLoader = webAppContext.getClassLoader();
+ this.webAppContext = webAppContext;
+ this.manager = (ServiceManager)this.webAppContext.getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
this.rootNode = rootNode;
this.disposableNodes = disposableNodes;
this.enterSitemapEventListeners = enterSitemapEventListeners;
@@ -209,7 +210,7 @@
Thread.currentThread().setContextClassLoader(this.classLoader);
Object handle = null;
try {
- handle = this.container.enteringContext();
+ handle = Container.enteringContext(this.webAppContext);
// invoke listeners
// only invoke if pipeline is not internally
if ( !context.isBuildingPipelineOnly() ) {
@@ -243,7 +244,7 @@
} finally {
this.sitemapExecutor.leaveSitemap(this, environment.getObjectModel());
- this.container.leavingContext(handle);
+ Container.leavingContext(this.webAppContext, handle);
// invoke listeners
// only invoke if pipeline is not internally
if ( !context.isBuildingPipelineOnly() ) {
@@ -339,10 +340,8 @@
// clear listeners
this.enterSitemapEventListeners.clear();
this.leaveSitemapEventListeners.clear();
- if ( this.container != null ) {
- this.container.shutdown();
- this.container = null;
- }
+ Container.shutdown(this.webAppContext);
+ this.webAppContext = null;
}
private class TreeProcessorRedirector extends ForwardRedirector {
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java Thu Dec 28 07:58:03 2006
@@ -20,7 +20,7 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.cocoon.core.container.spring.Container;
+import org.springframework.web.context.WebApplicationContext;
/**
*
@@ -30,7 +30,7 @@
String ROLE = TreeBuilder.class.getName();
- Container getContainer();
+ WebApplicationContext getWebApplicationContext();
ConcreteTreeProcessor getProcessor();
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java Thu Dec 28 07:58:03 2006
@@ -389,7 +389,7 @@
treeBuilder.setProcessor(newProcessor);
ProcessingNode root = treeBuilder.build(sitemapProgram, this.source.getURI());
newProcessor.setProcessorData(
- treeBuilder.getContainer(),
+ treeBuilder.getWebApplicationContext(),
root,
treeBuilder.getDisposableNodes(),
treeBuilder.getEnterSitemapEventListeners(),
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java Thu Dec 28 07:58:03 2006
@@ -54,7 +54,7 @@
// since 2.2 we add by default all flow scripts located in the ./flow directory
// The default location can be overwritten by specifying the location attribute.
- final BeanFactory beanFactory = this.treeBuilder.getContainer().getBeanFactory();
+ final BeanFactory beanFactory = this.treeBuilder.getWebApplicationContext();
if ( beanFactory instanceof ApplicationContext && node.getInterpreter().getScriptExtension() != null ) {
final ResourceLoader resourceLoader = (ApplicationContext)beanFactory;
final String scriptLocation = config.getAttribute("location", DEFAULT_FLOW_SCRIPT_LOCATION);
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java Thu Dec 28 07:58:03 2006
@@ -49,7 +49,7 @@
super.setBuilder(treeBuilder);
// check ssettings for ignoring of internal only pipeline flags
this.ignoreInternalOnly = false;
- final Settings settings = (Settings)treeBuilder.getContainer().getBeanFactory().getBean(Settings.ROLE);
+ final Settings settings = (Settings)treeBuilder.getWebApplicationContext().getBean(Settings.ROLE);
final String value = settings.getProperty(PipelineNodeBuilder.PROPERTY_SITEMAP_INTERNALONLY);
if ( value != null ) {
this.ignoreInternalOnly = Boolean.valueOf(value).booleanValue();
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java Thu Dec 28 07:58:03 2006
@@ -78,6 +78,7 @@
import org.apache.excalibur.source.SourceResolver;
import org.apache.regexp.RE;
import org.springframework.beans.factory.ListableBeanFactory;
+import org.springframework.web.context.WebApplicationContext;
/**
* The tree builder for the sitemap language.
@@ -124,7 +125,7 @@
*/
private ServiceManager itsManager;
- private Container itsContainer;
+ private WebApplicationContext itsContainer;
/**
* Helper object which sets up components in the context of the processor
@@ -222,10 +223,11 @@
return this.processor;
}
+
/**
- * @see org.apache.cocoon.components.treeprocessor.TreeBuilder#getContainer()
+ * @see org.apache.cocoon.components.treeprocessor.TreeBuilder#getWebApplicationContext()
*/
- public Container getContainer() {
+ public WebApplicationContext getWebApplicationContext() {
return this.itsContainer;
}
@@ -344,17 +346,17 @@
location,
fam,
(ServletContext)this.context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT));
- final Context itsContext = (Context)this.itsContainer.getBeanFactory().getBean(AvalonUtils.CONTEXT_ROLE);
+ final Context itsContext = (Context)this.itsContainer.getBean(AvalonUtils.CONTEXT_ROLE);
// The namespace used in the whole sitemap is the one of the root
// element
this.itsNamespace = tree.getNamespace();
// replace properties?
if ( tree.getChild("components").getAttributeAsBoolean("replace-properties", true) ) {
- tree = AvalonUtils.replaceProperties(tree, (Settings)this.itsContainer.getBeanFactory().getBean(Settings.ROLE));
+ tree = AvalonUtils.replaceProperties(tree, (Settings)this.itsContainer.getBean(Settings.ROLE));
}
- this.itsManager = (ServiceManager) this.itsContainer.getBeanFactory().getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
+ this.itsManager = (ServiceManager) this.itsContainer.getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
// register listeners
this.registerListeners();
@@ -553,7 +555,7 @@
}
final String beanName = role + '/' + type;
- if ( !this.itsContainer.getBeanFactory().containsBean(beanName) ) {
+ if ( !this.itsContainer.containsBean(beanName) ) {
throw new ConfigurationException("Type '" + type + "' does not exist for 'map:"
+ statement.getName() + "' at " + statement.getLocation());
}
@@ -605,8 +607,8 @@
* Register all registered sitemap listeners
*/
protected void registerListeners() {
- if ( this.itsContainer.getBeanFactory() instanceof ListableBeanFactory ) {
- final ListableBeanFactory listableFactory = (ListableBeanFactory)this.itsContainer.getBeanFactory();
+ if ( this.itsContainer instanceof ListableBeanFactory ) {
+ final ListableBeanFactory listableFactory = (ListableBeanFactory)this.itsContainer;
Map beans = listableFactory.getBeansOfType(EnterSitemapEventListener.class);
if ( beans != null ) {
final Iterator i = beans.values().iterator();
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Container.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Container.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Container.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Container.java Thu Dec 28 07:58:03 2006
@@ -31,24 +31,18 @@
/**
* @version $Id$
*/
-public class Container {
+public abstract class Container {
/** The name of the request attribute containing the current bean factory. */
public static final String CONTAINER_REQUEST_ATTRIBUTE = Container.class.getName();
protected static final String CONTAINER_STACK_REQUEST_ATTRIBUTE = Container.class.getName() + "/Stack";
- protected WebApplicationContext beanFactory;
+ protected static WebApplicationContext ROOT_CONTAINER;
- public Container(WebApplicationContext webAppContext) {
- this.beanFactory = webAppContext;
- }
-
- protected static Container ROOT_CONTAINER;
-
- public static Container getCurrentContainer() {
+ public static WebApplicationContext getCurrentWebApplicationContext() {
final RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
- return getCurrentContainer(attributes);
+ return getCurrentWebApplicationContext(attributes);
}
/**
@@ -56,17 +50,16 @@
* @param attributes The request attributes.
* @return The web application context.
*/
- public static Container getCurrentContainer(RequestAttributes attributes) {
+ protected static WebApplicationContext getCurrentWebApplicationContext(RequestAttributes attributes) {
if ( attributes != null ) {
if (attributes.getAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST) != null) {
- return (Container) attributes
- .getAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
+ return (WebApplicationContext) attributes.getAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
}
}
if ( ROOT_CONTAINER == null ) {
final ServletContext servletContext = ServletContextFactoryBean.getServletContext();
final WebApplicationContext parentContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
- ROOT_CONTAINER = new Container(parentContext);
+ ROOT_CONTAINER = parentContext;
}
return ROOT_CONTAINER;
}
@@ -75,7 +68,7 @@
* Notify about entering this context.
* @return A handle which should be passed to {@link #leavingContext(RequestAttributes, Object)}.
*/
- public Object enteringContext() {
+ public static Object enteringContext(WebApplicationContext webAppContext) {
final RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
final ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
final Object oldContext = attributes.getAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
@@ -87,8 +80,8 @@
}
stack.push(oldContext);
}
- attributes.setAttribute(CONTAINER_REQUEST_ATTRIBUTE, this, RequestAttributes.SCOPE_REQUEST);
- Thread.currentThread().setContextClassLoader(this.beanFactory.getClassLoader());
+ attributes.setAttribute(CONTAINER_REQUEST_ATTRIBUTE, webAppContext, RequestAttributes.SCOPE_REQUEST);
+ Thread.currentThread().setContextClassLoader(webAppContext.getClassLoader());
return oldClassLoader;
}
@@ -96,7 +89,7 @@
* Notify about leaving this context.
* @param handle The returned handle from {@link #enteringContext(RequestAttributes)}.
*/
- public void leavingContext(Object handle) {
+ public static void leavingContext(WebApplicationContext webAppContext, Object handle) {
final RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
Thread.currentThread().setContextClassLoader((ClassLoader)handle);
final Stack stack = (Stack)attributes.getAttribute(CONTAINER_STACK_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
@@ -111,15 +104,11 @@
}
}
- public WebApplicationContext getBeanFactory() {
- return this.beanFactory;
- }
-
- public void shutdown() {
- if ( this.beanFactory instanceof ConfigurableApplicationContext ) {
- ((ConfigurableApplicationContext)this.beanFactory).close();
- } else if ( this.beanFactory instanceof ConfigurableBeanFactory ) {
- ((ConfigurableBeanFactory)this.beanFactory).destroySingletons();
+ public static void shutdown(WebApplicationContext webAppContext) {
+ if ( webAppContext instanceof ConfigurableApplicationContext ) {
+ ((ConfigurableApplicationContext)webAppContext).close();
+ } else if ( webAppContext instanceof ConfigurableBeanFactory ) {
+ ((ConfigurableBeanFactory)webAppContext).destroySingletons();
}
}
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java Thu Dec 28 07:58:03 2006
@@ -138,10 +138,10 @@
buffer.append("</beans>\n");
}
- public static Container createContainer(Configuration config,
- String sitemapLocation,
- Monitor fam,
- ServletContext servletContext)
+ public static WebApplicationContext createContainer(Configuration config,
+ String sitemapLocation,
+ Monitor fam,
+ ServletContext servletContext)
throws Exception {
// let's get the root container first
final WebApplicationContext rootContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
@@ -154,12 +154,7 @@
}
final String contextUrl = sitemapLocation.substring(0, pos + 1);
- final Container container = Container.getCurrentContainer();
- // for now we require that the parent container is a web application context (FIXME)
- if ( !(container.getBeanFactory() instanceof WebApplicationContext) ) {
- throw new Exception("Parent container is not a web application context: " + container.getBeanFactory());
- }
- final WebApplicationContext parentContext = (WebApplicationContext)container.getBeanFactory();
+ final WebApplicationContext parentContext = Container.getCurrentWebApplicationContext();
// get classloader
// TODO rcl
@@ -176,7 +171,7 @@
parentContext,
contextUrl,
definition);
- return new Container(context);
+ return context;
} finally {
PARENT_CONTEXT.set(null);
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java Thu Dec 28 07:58:03 2006
@@ -129,8 +129,7 @@
cocoon.put("parameters", new ParametersMap(parameters));
}
- final Container container = Container.getCurrentContainer();
- cocoon.put("settings", (Settings)container.getBeanFactory().getBean(Settings.ROLE));
+ cocoon.put("settings", (Settings)Container.getCurrentWebApplicationContext().getBean(Settings.ROLE));
final Map map = new HashMap();
map.put("cocoon", cocoon);
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java?view=diff&rev=490747&r1=490746&r2=490747
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java Thu Dec 28 07:58:03 2006
@@ -392,8 +392,7 @@
static public ServiceManager getSitemapServiceManager() {
final EnvironmentStack stack = (EnvironmentStack)environmentStack.get();
if ( stack != null && !stack.isEmpty()) {
- final Container container = Container.getCurrentContainer();
- return (ServiceManager)container.getBeanFactory().getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
+ return (ServiceManager)Container.getCurrentWebApplicationContext().getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
}
return null;
}