cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r387309 - in /cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon: components/treeprocessor/ components/treeprocessor/sitemap/ core/container/spring/
Date Mon, 20 Mar 2006 20:57:03 GMT
Author: cziegeler
Date: Mon Mar 20 12:57:01 2006
New Revision: 387309

URL: http://svn.apache.org/viewcvs?rev=387309&view=rev
Log:
Fix core reload bug and improve factory creation
Use console logger for now

Modified:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java?rev=387309&r1=387308&r2=387309&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
Mon Mar 20 12:57:01 2006
@@ -19,6 +19,7 @@
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.ProcessingUtil;
 
 /**
  *
@@ -36,7 +37,7 @@
      */
     public void setBuilder(TreeBuilder treeBuilder) {
         this.treeBuilder = treeBuilder;
-        this.manager = treeBuilder.getServiceManager();
+        this.manager = (ServiceManager)treeBuilder.getBeanFactory().getBean(ProcessingUtil.SERVICE_MANAGER_ROLE);
     }
 
     /**

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java?rev=387309&r1=387308&r2=387309&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
Mon Mar 20 12:57:01 2006
@@ -28,6 +28,7 @@
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.ProcessingUtil;
 import org.apache.cocoon.Processor;
 import org.apache.cocoon.components.ChainedConfiguration;
 import org.apache.cocoon.components.source.impl.SitemapSourceInfo;
@@ -114,7 +115,6 @@
 
     /** Set the processor data, result of the treebuilder job */
     public void setProcessorData(ConfigurableListableBeanFactory beanFactory,
-                                 ServiceManager manager,
                                  ProcessingNode rootNode,
                                  List disposableNodes,
                                  List enterSitemapEventListeners,
@@ -124,7 +124,7 @@
         }
 
         this.beanFactory = beanFactory;
-        this.manager = manager;
+        this.manager = (ServiceManager)this.beanFactory.getBean(ProcessingUtil.SERVICE_MANAGER_ROLE);
         this.rootNode = rootNode;
         this.disposableNodes = disposableNodes;
         this.enterSitemapEventListeners = enterSitemapEventListeners;

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java?rev=387309&r1=387308&r2=387309&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java
Mon Mar 20 12:57:01 2006
@@ -19,7 +19,6 @@
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.service.ServiceManager;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 
 /**
@@ -31,8 +30,6 @@
     String ROLE = TreeBuilder.class.getName();
 
     ConfigurableListableBeanFactory getBeanFactory();
-
-    ServiceManager getServiceManager();
 
     ConcreteTreeProcessor getProcessor();
 

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=387309&r1=387308&r2=387309&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
Mon Mar 20 12:57:01 2006
@@ -413,7 +413,6 @@
                 this.beanFactory = treeBuilder.getBeanFactory();
                 newProcessor.setProcessorData(
                         this.beanFactory,
-                        treeBuilder.getServiceManager(),
                         root,
                         treeBuilder.getDisposableNodes(),
                         treeBuilder.getEnterSitemapEventListeners(),

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java?rev=387309&r1=387308&r2=387309&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
Mon Mar 20 12:57:01 2006
@@ -45,6 +45,7 @@
 import org.apache.avalon.framework.service.ServiceSelector;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.cocoon.Constants;
+import org.apache.cocoon.ProcessingUtil;
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.components.LifecycleHelper;
 import org.apache.cocoon.components.source.SourceUtil;
@@ -253,10 +254,6 @@
         return this.itsBeanFactory;
     }
 
-    public ServiceManager getServiceManager() {
-        return this.itsManager;
-    }
-
     /**
      * @see org.apache.cocoon.components.treeprocessor.TreeBuilder#getEnterSitemapEventListeners()
      */
@@ -389,7 +386,7 @@
         // FIXME: Internal configurations doesn't work in a non bean factory
         // environment
         this.itsBeanFactory = this.createBeanFactory(this.itsContext, componentConfig);
-        this.itsManager = (ServiceManager) this.itsBeanFactory.getBean(ServiceManager.class.getName());
+        this.itsManager = (ServiceManager) this.itsBeanFactory.getBean(ProcessingUtil.SERVICE_MANAGER_ROLE);
         if (componentConfig != null) {
             // only register listeners if a new bean factory is created
             this.registerListeners();
@@ -586,21 +583,11 @@
                     + statement.getName() + "' at " + statement.getLocation());
         }
 
-        // Check that this type actually exists
-        ServiceSelector selector = null;
-        try {
-            selector = (ServiceSelector) this.itsManager.lookup(role + "Selector");
-        } catch (ServiceException e) {
-            throw new ConfigurationException("Cannot get service selector for 'map:"
-                    + statement.getName() + "' at " + statement.getLocation(), e);
-        }
-
-        if (!selector.isSelectable(type)) {
+        final String beanName = role + '/' + type;
+        if ( !this.itsBeanFactory.containsBean(beanName) ) {
             throw new ConfigurationException("Type '" + type + "' does not exist for 'map:"
                     + statement.getName() + "' at " + statement.getLocation());
         }
-
-        this.itsManager.release(selector);
 
         return type;
     }

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java?rev=387309&r1=387308&r2=387309&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java
Mon Mar 20 12:57:01 2006
@@ -72,4 +72,11 @@
     public void release(Object component) {
         // nothing to do
     }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return "AvalonServiceSelector[" + super.toString() + "]: role=" + this.role + ",
factory=" + this.beanFactory;
+    }
 }



Mime
View raw message