cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r384299 - in /cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon: components/treeprocessor/TreeProcessor.java environment/internal/EnvironmentHelper.java
Date Wed, 08 Mar 2006 18:49:02 GMT
Author: cziegeler
Date: Wed Mar  8 10:48:59 2006
New Revision: 384299

URL: http://svn.apache.org/viewcvs?rev=384299&view=rev
Log:
Remove workaround

Modified:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java?rev=384299&r1=384298&r2=384299&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
Wed Mar  8 10:48:59 2006
@@ -49,6 +49,9 @@
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.regexp.RE;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.xml.sax.SAXException;
 
@@ -60,7 +63,7 @@
 public class TreeProcessor extends AbstractLogEnabled
                            implements ThreadSafe, Processor, Serviceable,
                                       Configurable, Contextualizable,
-                                      Disposable, Initializable {
+                                      Disposable, Initializable, BeanFactoryAware {
 
     /** The parent TreeProcessor, if any */
     protected TreeProcessor parent;
@@ -104,6 +107,9 @@
     /** The actual processor */
     protected ConcreteTreeProcessor concreteProcessor;
 
+    /** Our bean factory. */
+    protected ConfigurableListableBeanFactory beanFactory;
+
     /**
      * Create a TreeProcessor.
      */
@@ -500,10 +506,14 @@
         if ( this.concreteProcessor != null ) {
             return this.concreteProcessor.getBeanFactory();
         }
-        if ( parent != null ) {
-            return this.parent.getBeanFactory();
-        }
-        return null;
+        return this.beanFactory;
+    }
+
+    /**
+     * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
+     */
+    public void setBeanFactory(BeanFactory factory) throws BeansException {
+        this.beanFactory = (ConfigurableListableBeanFactory) factory;
     }
 
     /**

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java?rev=384299&r1=384298&r2=384299&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/internal/EnvironmentHelper.java
Wed Mar  8 10:48:59 2006
@@ -391,10 +391,6 @@
         final EnvironmentStack stack = (EnvironmentStack)environmentStack.get();
         if ( stack != null && !stack.isEmpty()) {
             EnvironmentInfo info = stack.getCurrentInfo();
-            // FIXME - Workaround!
-            if ( info.processor.getBeanFactory() == null ) {
-                info = (EnvironmentInfo)stack.get(stack.getOffset() - 1);
-            }
             return (ServiceManager) info.processor.getBeanFactory().getBean(ProcessingUtil.SERVICE_MANAGER_ROLE);
         }
         return null;



Mime
View raw message