cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r381733 - in /cocoon/trunk: cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/container/ cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/ cocoon-blocks-fw/cocoon-blocks-fw-e...
Date Tue, 28 Feb 2006 18:38:38 GMT
Author: cziegeler
Date: Tue Feb 28 10:38:36 2006
New Revision: 381733

URL: http://svn.apache.org/viewcvs?rev=381733&view=rev
Log:
Remove Core object

Added:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/ProcessorUtil.java   (with props)
Removed:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/Core.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/sitemap/Sitemap.java
Modified:
    cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/container/ECMBlockServiceManager.java
    cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/ComponentFactory.java
    cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/handler/PoolableComponentHandler.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonBean.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/source/CocoonSourceResolver.java
    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/DefaultTreeBuilder.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/BaseSettings.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/DynamicSettings.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonEnvironment.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/servlet/CoreUtil.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalComponentManager.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/DefaultPortalComponentManager.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java

Modified: cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/container/ECMBlockServiceManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/container/ECMBlockServiceManager.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/container/ECMBlockServiceManager.java
(original)
+++ cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/container/ECMBlockServiceManager.java
Tue Feb 28 10:38:36 2006
@@ -35,7 +35,6 @@
 import org.apache.cocoon.components.LifecycleHelper;
 import org.apache.cocoon.components.container.CocoonServiceManager;
 import org.apache.cocoon.components.source.impl.ContextSourceFactory;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.Settings;
 import org.apache.cocoon.core.container.CoreServiceManager;
 import org.apache.cocoon.core.container.RoleManager;
@@ -100,10 +99,8 @@
                 null,
                 false);
         
-        // The Core object is needed for the Sitemap and various other Cocoon components
-        Core core = new Core(newContext);
+        // The settings object is needed for the Sitemap and various other Cocoon components
         coreServicemanager.addInstance(Settings.ROLE, settings);
-        coreServicemanager.addInstance(Core.ROLE, core);
         
         // For the first block that is setup, source factories need to be setup before
         // starting to configure service managers that includes other configuration files

Modified: cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/ComponentFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/ComponentFactory.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/ComponentFactory.java
(original)
+++ cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/ComponentFactory.java
Tue Feb 28 10:38:36 2006
@@ -20,12 +20,10 @@
 
 import org.apache.avalon.excalibur.pool.Recyclable;
 import org.apache.avalon.framework.container.ContainerUtil;
-import org.apache.avalon.framework.context.ContextException;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.parameters.Parameterizable;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.components.ComponentInfo;
-import org.apache.cocoon.core.Core;
 
 /**
  * Factory for Avalon based components.
@@ -53,8 +51,6 @@
     protected final Method destroyMethod;
     protected final Method poolInMethod;
     protected final Method poolOutMethod;
-    protected Method configureSettingsMethod;
-    protected Core core;
 
     /**
      * Construct a new component factory for the specified component.
@@ -66,14 +62,6 @@
     public ComponentFactory( final ComponentEnvironment environment,
                              final ComponentInfo info) 
     throws Exception {
-        // FIXME - we should ensure that the context is never null!
-        if ( environment.context != null ) {
-            try {
-                this.core = (Core)environment.context.get(Core.ROLE);
-            } catch (ContextException ignore) {
-                // this can never happen
-            }
-        }
         this.environment = environment;
         this.serviceInfo = info;
         
@@ -114,13 +102,6 @@
         } else {
             this.poolOutMethod = null;
         }
-        try {
-            this.configureSettingsMethod = this.serviceClass.getMethod("configure", new Class[]
{Core.class});
-        } catch (Throwable ignore) {
-            // we have to catch throwable here, as the above test can
-            // result in NoClassDefFound exceptions etc.
-            this.configureSettingsMethod = null;
-        }
     }
     
     /**
@@ -148,9 +129,6 @@
         ContainerUtil.enableLogging(component, this.componentLogger);
         ContainerUtil.contextualize( component, this.environment.context );
         ContainerUtil.service( component, this.environment.serviceManager );
-        if ( this.configureSettingsMethod != null && this.core != null) {
-            this.configureSettingsMethod.invoke( component, new Object[] {this.core});
-        }
         ContainerUtil.configure( component, this.serviceInfo.getConfiguration() );
 
         if( component instanceof Parameterizable ) {

Modified: cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/handler/PoolableComponentHandler.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/handler/PoolableComponentHandler.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/handler/PoolableComponentHandler.java
(original)
+++ cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-ecm-impl/src/main/java/org/apache/cocoon/core/container/handler/PoolableComponentHandler.java
Tue Feb 28 10:38:36 2006
@@ -25,8 +25,8 @@
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.logger.Logger;
+import org.apache.cocoon.ProcessorUtil;
 import org.apache.cocoon.components.ComponentInfo;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.container.ComponentFactory;
 
 /**
@@ -130,7 +130,7 @@
         return interfaces;
     }
 
-    protected static final class ProxyHandler implements InvocationHandler, Core.CleanupTask
{
+    protected static final class ProxyHandler implements InvocationHandler, ProcessorUtil.CleanupTask
{
         
         private final ThreadLocal componentHolder = new ThreadLocal();
         private final PoolableComponentHandler handler;
@@ -149,7 +149,7 @@
             }
             if ( this.componentHolder.get() == null ) {
                 this.componentHolder.set(this.handler.getFromPool());
-                Core.addCleanupTask(this);
+                ProcessorUtil.addCleanupTask(this);
             }
             try {
                 return method.invoke(this.componentHolder.get(), args);

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java Tue Feb 28 10:38:36
2006
@@ -25,7 +25,6 @@
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.components.ContextHelper;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
@@ -258,7 +257,7 @@
             if (this.logger.isDebugEnabled()) {
                 --activeRequestCount;
             }
-            Core.cleanup();
+            ProcessorUtil.cleanup();
 
             EnvironmentHelper.checkEnvironment(environmentDepth, this.logger);
         }

Added: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/ProcessorUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/ProcessorUtil.java?rev=381733&view=auto
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/ProcessorUtil.java (added)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/ProcessorUtil.java Tue Feb 28
10:38:36 2006
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is an utility class for processing Cocoon requests.
+ *
+ * $Id$
+ */
+public class ProcessorUtil {
+
+    /**
+     * Avoid construction.
+     */
+    private ProcessorUtil() {}
+
+    /**
+     * The cleanup threads that are invoked after the processing of a
+     * request is finished.
+     */
+    private static final ThreadLocal cleanup = new ThreadLocal();
+
+    /**
+     * Add a cleanup task.
+     * A cleanup task is run after a request is processed.
+     * @param task The task to run.
+     */
+    public static void addCleanupTask(CleanupTask task) {
+        List l = (List)cleanup.get();
+        if ( l == null ) {
+            l = new ArrayList();
+            cleanup.set(l);
+        }
+        l.add(task);
+    }
+
+    /**
+     * Invoke all registered cleanup tasks for the current process.
+     * This method should not be called directly!
+     */
+    public static void cleanup() {
+        List l = (List)cleanup.get();
+        if ( l != null ) {
+            final Iterator i = l.iterator();
+            while ( i.hasNext() ) {
+                final CleanupTask t = (CleanupTask)i.next();
+                t.invoke();
+            }
+            l.clear();
+            cleanup.set(null);
+        }
+    }
+
+    /**
+     * The interface for the cleanup task.
+     * A cleanup task can be run after a request has been processed.
+     */
+    public static interface CleanupTask {
+
+        /**
+         * Start the cleanup.
+         * This method should never raise any exception!
+         */
+        void invoke();
+    }
+
+}

Propchange: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/ProcessorUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/ProcessorUtil.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonBean.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonBean.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonBean.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonBean.java Tue Feb
28 10:38:36 2006
@@ -93,7 +93,7 @@
         if (this.initialized == false) {
             super.initialize();
 
-            this.sourceResolver = (SourceResolver)this.coreUtil.getCore().getCurrentSitemap().getComponentLocator().lookup(SourceResolver.ROLE);
+            this.sourceResolver = (SourceResolver)this.coreUtil.getContainer().getBean(SourceResolver.ROLE);
 
             initialized = true;
         }
@@ -320,7 +320,6 @@
      */
     public void dispose() {
         if (this.initialized) {
-            this.coreUtil.getCore().getCurrentSitemap().getComponentLocator().release(this.sourceResolver);
             this.sourceResolver = null;
             super.dispose();
         }

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/source/CocoonSourceResolver.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/source/CocoonSourceResolver.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/source/CocoonSourceResolver.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/source/CocoonSourceResolver.java
Tue Feb 28 10:38:36 2006
@@ -33,10 +33,8 @@
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.Processor;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.environment.internal.EnvironmentHelper;
-import org.apache.cocoon.sitemap.Sitemap;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceException;
 import org.apache.excalibur.source.SourceFactory;
@@ -63,9 +61,6 @@
     /** The base URL */
     protected URL baseURL;
 
-    /** The core */
-    protected Core core;
-
     /**
      * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
      */
@@ -197,7 +192,6 @@
             this.customResolver = (org.apache.excalibur.source.SourceResolver)
                      this.manager.lookup(org.apache.excalibur.source.SourceResolver.ROLE+"/Cocoon");
         }
-        this.core = (Core)this.manager.lookup(Core.ROLE);
     }
 
     /**
@@ -207,8 +201,6 @@
         if ( this.manager != null ) {
             this.manager.release( this.customResolver );
             this.customResolver = null;
-            this.manager.release(this.core);
-            this.core = null;
             this.manager = null;
         }
     }
@@ -217,11 +209,7 @@
      * Get the component locator.
      */
     protected ServiceManager getComponentLocator() {
-        ServiceManager l = null;
-        final Sitemap sitemap = this.core.getCurrentSitemap();
-        if ( sitemap != null ) {
-            l = sitemap.getComponentLocator();
-        }
+        ServiceManager l = EnvironmentHelper.getSitemapServiceManager();
         if ( l == null ) {
             l = this.manager;
         }

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=381733&r1=381732&r2=381733&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
Tue Feb 28 10:38:36 2006
@@ -18,7 +18,6 @@
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 
 /**

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java
Tue Feb 28 10:38:36 2006
@@ -27,7 +27,6 @@
 import org.apache.avalon.framework.configuration.AbstractConfiguration;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.ContextException;

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=381733&r1=381732&r2=381733&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
Tue Feb 28 10:38:36 2006
@@ -40,7 +40,6 @@
 import org.apache.cocoon.components.treeprocessor.CategoryNodeBuilder;
 import org.apache.cocoon.components.treeprocessor.DefaultTreeBuilder;
 import org.apache.cocoon.components.treeprocessor.TreeBuilder;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.Settings;
 import org.apache.cocoon.core.container.spring.BeanFactoryUtil;
 import org.apache.cocoon.core.container.spring.AvalonEnvironment;
@@ -135,7 +134,6 @@
 
         final AvalonEnvironment ae = new AvalonEnvironment();
         ae.context = context;
-        ae.core = (Core)this.beanFactory.getBean(Core.ROLE);
         ae.logger = this.getLogger();
         ae.servletContext = ((ServletConfig)context.get(CocoonServlet.CONTEXT_SERVLET_CONFIG)).getServletContext();
         ae.settings = (Settings)this.beanFactory.getBean(Settings.ROLE);

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java Tue Feb
28 10:38:36 2006
@@ -21,8 +21,7 @@
  * The settings (configuration) for the Cocoon core are described through the {@link BaseSettings}
  * interface and the {@link DynamicSettings} interface.
  * Whereas the settings of the {@link BaseSettings} object can't be changed at runtime,
- * the settings of the {@link DynamicSettings} object are mutable. Use the {@link Core} instance
- * to update the settings.
+ * the settings of the {@link DynamicSettings} object are mutable.
  *
  * @version $Id$
  * @since 2.2

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java Tue Feb 28
10:38:36 2006
@@ -91,9 +91,6 @@
 
     protected ClassLoader classloader;
 
-    /** The core object. */
-    protected Core core;
-
     /** The environment context. */
     protected final Context environmentContext;
 
@@ -282,9 +279,6 @@
         // dump system properties
         this.dumpSystemProperties();
 
-        // create the Core object
-        this.core = this.createCore();
-
         // settings can't be changed anymore
         settings.makeReadOnly();
 
@@ -292,28 +286,11 @@
         this.container = this.setupSpringContainer();
     }
 
-    /**
-     * Return the core object.
-     */
-    public Core getCore() {
-        return this.core;
-    }
-
     public Logger getRootLogger() {
         return this.log;
     }
 
     /**
-     * Create a new core instance.
-     * This method can be overwritten in sub classes.
-     * @return A new core object.
-     */
-    protected Core createCore() {
-        final Core c = new Core(this.appContext);
-        return c;
-    }
-
-    /**
      * Return the settings object.
      */
     public Settings getSettings() {
@@ -632,7 +609,6 @@
         }
         AvalonEnvironment env = new AvalonEnvironment();
         env.context = this.appContext;
-        env.core = this.core;
         env.logger = this.log;
         env.servletContext = this.environmentContext;
         env.settings = this.settings;

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/DynamicSettings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/DynamicSettings.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/DynamicSettings.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/DynamicSettings.java Tue
Feb 28 10:38:36 2006
@@ -19,8 +19,7 @@
  * The settings (configuration) for the Cocoon core are described through the {@link BaseSettings}
  * interface and the {@link DynamicSettings} interface.
  * Whereas the settings of the {@link BaseSettings} object can't be changed at runtime,
- * the settings of the {@link DynamicSettings} object are mutable. Use the {@link Core} instance
- * to update the settings.
+ * the settings of the {@link DynamicSettings} object are mutable.
  *
  * @version $Id$
  * @since 2.2

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonEnvironment.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonEnvironment.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonEnvironment.java
Tue Feb 28 10:38:36 2006
@@ -19,7 +19,6 @@
 
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.logger.Logger;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.Settings;
 
 /**
@@ -33,6 +32,5 @@
     public ServletContext servletContext;
     public Context  context;
     public Logger   logger;
-    public Core     core;
     public Settings settings;
 }

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
Tue Feb 28 10:38:36 2006
@@ -31,7 +31,6 @@
 import org.apache.cocoon.acting.Action;
 import org.apache.cocoon.components.pipeline.ProcessingPipeline;
 import org.apache.cocoon.components.treeprocessor.ProcessorComponentInfo;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.CoreInitializationException;
 import org.apache.cocoon.core.Settings;
 import org.apache.cocoon.core.container.util.ConfigurationBuilder;
@@ -108,7 +107,6 @@
         CocoonBeanFactory factory = new CocoonBeanFactory(parent);
         factory.registerSingleton(Context.class.getName(), env.context);
         factory.registerSingleton(Logger.class.getName(), env.logger);
-        factory.registerSingleton(Core.class.getName(), env.core);
         factory.registerSingleton(Settings.class.getName(), env.settings);
         return factory;
     }

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
Tue Feb 28 10:38:36 2006
@@ -26,7 +26,7 @@
 import java.util.Set;
 
 import org.apache.avalon.excalibur.pool.Recyclable;
-import org.apache.cocoon.core.Core;
+import org.apache.cocoon.ProcessorUtil;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.BeanFactoryAware;
@@ -314,7 +314,7 @@
         }
     }
 
-    protected static final class ProxyHandler implements InvocationHandler, Core.CleanupTask
{
+    protected static final class ProxyHandler implements InvocationHandler, ProcessorUtil.CleanupTask
{
         
         private final ThreadLocal componentHolder = new ThreadLocal();
         private final PoolableFactoryBean handler;
@@ -333,7 +333,7 @@
             }
             if ( this.componentHolder.get() == null ) {
                 this.componentHolder.set(this.handler.getFromPool());
-                Core.addCleanupTask(this);
+                ProcessorUtil.addCleanupTask(this);
             }
             try {
                 return method.invoke(this.componentHolder.get(), args);
@@ -344,7 +344,7 @@
         
         
         /**
-         * @see org.apache.cocoon.core.Core.CleanupTask#invoke()
+         * @see ProcessorUtil.CleanupTask#invoke()
          */
         public void invoke() {
             try {

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/servlet/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/servlet/CoreUtil.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/servlet/CoreUtil.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/servlet/CoreUtil.java Tue
Feb 28 10:38:36 2006
@@ -27,7 +27,6 @@
 import org.apache.avalon.framework.context.DefaultContext;
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.components.ContextHelper;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.MutableSettings;
 import org.apache.cocoon.core.Settings;
 import org.apache.cocoon.core.container.util.ComponentContext;
@@ -232,7 +231,6 @@
         DefaultContext appContext = new ComponentContext();
         CoreUtil.addSourceResolverContext(appContext, servletConfig, knownFile);
         CoreUtil.addSettingsContext(appContext, settings);
-        CoreUtil.addCoreContext(appContext, new Core(appContext));
         return appContext;
     }
 
@@ -332,11 +330,5 @@
         // looked up
         // by other components
         appContext.put(Constants.CONTEXT_CLASSPATH, "");        
-    }
-
-    private static void addCoreContext(DefaultContext appContext, Core core) {
-        // put the core into the context - this is for internal use only
-        // The Cocoon container fetches the Core object using the context.
-        appContext.put(Core.ROLE, core);
     }
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalComponentManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalComponentManager.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalComponentManager.java
(original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalComponentManager.java
Tue Feb 28 10:38:36 2006
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.portal;
 
-import org.apache.cocoon.core.Core;
 import org.apache.avalon.framework.context.Context;
 import org.apache.cocoon.portal.coplet.CopletFactory;
 import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
@@ -82,10 +81,4 @@
      * @deprecated Use the core object instead.
      */
     Context getComponentContext();
-
-    /**
-     * Get the Cocoon core object.
-     * @since 2.2
-     */
-    Core getCore();
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/DefaultPortalComponentManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/DefaultPortalComponentManager.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/DefaultPortalComponentManager.java
(original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/DefaultPortalComponentManager.java
Tue Feb 28 10:38:36 2006
@@ -26,8 +26,11 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.cocoon.core.Core;
-import org.apache.cocoon.portal.*;
+import org.apache.cocoon.portal.LinkService;
+import org.apache.cocoon.portal.PortalComponentManager;
+import org.apache.cocoon.portal.PortalManager;
+import org.apache.cocoon.portal.PortalRuntimeException;
+import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletFactory;
 import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
 import org.apache.cocoon.portal.event.EventManager;
@@ -68,9 +71,6 @@
 
     protected final Context context;
 
-    /** The Cocoon core. */
-    protected Core core;
-
     /**
      * Create a new portal component manager. Each portal has a own
      * component manager that manages all central components for this
@@ -89,7 +89,6 @@
      */
     public void service(ServiceManager manager) throws ServiceException {
         this.manager = manager;
-        this.core = (Core)this.manager.lookup(Core.ROLE);
     }
 
     /**
@@ -161,8 +160,6 @@
             this.eventManager = null;
             this.manager.release(this.portalManager);
             this.portalManager = null;
-            this.manager.release(this.core);
-            this.core = null;
             this.manager = null;
         }
     }
@@ -246,12 +243,5 @@
      */
     public Context getComponentContext() {
         return this.context;
-    }
-
-    /**
-     * @see org.apache.cocoon.portal.PortalComponentManager#getCore()
-     */
-    public Core getCore() {
-        return this.core;
     }
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java?rev=381733&r1=381732&r2=381733&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
(original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
Tue Feb 28 10:38:36 2006
@@ -38,7 +38,6 @@
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.components.ContextHelper;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.Session;
 import org.apache.cocoon.portal.LinkService;
@@ -380,13 +379,6 @@
      */
     public CopletFactory getCopletFactory() {
         return this.getComponentManager().getCopletFactory();
-    }
-
-    /**
-     * @see org.apache.cocoon.portal.PortalComponentManager#getCore()
-     */
-    public Core getCore() {
-        return this.getComponentManager().getCore();
     }
 
     /**



Mime
View raw message