cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r436902 [1/2] - in /cocoon/trunk: blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/ blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/event/impl/ blocks/cocoon-python/cocoon-python-...
Date Fri, 25 Aug 2006 18:46:08 GMT
Author: cziegeler
Date: Fri Aug 25 11:46:03 2006
New Revision: 436902

URL: http://svn.apache.org/viewvc?rev=436902&view=rev
Log:
Finish first step of spring namespace handlers: cocoon can now simply be setup in any spring web application context.

Added:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonEnvironment.java
      - copied, changed from r434410, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonEnvironment.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonNamespaceHandler.java   (with props)
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonServiceManager.java
      - copied, changed from r434510, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceManager.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonServiceSelector.java
      - copied, changed from r434410, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ComponentInfo.java
      - copied, changed from r434410, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ComponentInfo.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationInfo.java
      - copied, changed from r434410, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigurationInfo.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/PoolableFactoryBean.java
      - copied, changed from r434410, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/avalon/
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/avalon/avalon.xsd
Removed:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonEnvironment.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceManager.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ComponentInfo.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigurationInfo.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/CocoonServletListener.java
Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/AbstractPortalTestCase.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/event/impl/DefaultEventManagerTestCase.java
    cocoon/trunk/blocks/cocoon-python/cocoon-python-impl/src/main/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractComponentHandler.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractFactoryHandler.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ComponentFactory.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/NonThreadSafePoolableComponentHandler.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/SingleThreadedComponentHandler.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ThreadSafeComponentHandler.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/Constants.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/ProcessingUtil.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/SettingsHelper.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonBeanFactory.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonContextFactoryBean.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonElementParser.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigReader.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationInfoFactoryBean.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringECMFactory.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
    cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/spring.handlers
    cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/spring.schemas
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/cocoon.xsd
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/CocoonTestCase.java
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/SitemapComponentTestCase.java
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/SitemapTestCase.java
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/core/TestPropertyProvider.java
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/core/container/ContainerTestCase.java
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/applicationContext.xml
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/core.properties
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/web.xml

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/AbstractPortalTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/AbstractPortalTestCase.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/AbstractPortalTestCase.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/AbstractPortalTestCase.java Fri Aug 25 11:46:03 2006
@@ -24,8 +24,8 @@
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.cocoon.CocoonTestCase;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
-import org.apache.cocoon.core.container.spring.ConfigurationInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
 import org.apache.cocoon.environment.mock.MockContext;
 import org.apache.cocoon.portal.impl.PortalServiceImpl;
 
@@ -70,7 +70,7 @@
     }
 
     /**
-     * @see org.apache.cocoon.CocoonTestCase#addComponents(org.apache.cocoon.core.container.spring.ConfigurationInfo)
+     * @see org.apache.cocoon.CocoonTestCase#addComponents(org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo)
      */
     protected void addComponents(ConfigurationInfo info) throws Exception {
         super.addComponents(info);

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/event/impl/DefaultEventManagerTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/event/impl/DefaultEventManagerTestCase.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/event/impl/DefaultEventManagerTestCase.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/test/java/org/apache/cocoon/portal/event/impl/DefaultEventManagerTestCase.java Fri Aug 25 11:46:03 2006
@@ -16,8 +16,8 @@
 package org.apache.cocoon.portal.event.impl;
 
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
-import org.apache.cocoon.core.container.spring.ConfigurationInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
 import org.apache.cocoon.portal.AbstractPortalTestCase;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.Event;
@@ -40,7 +40,7 @@
     }
 
     /**
-     * @see org.apache.cocoon.CocoonTestCase#addComponents(org.apache.cocoon.core.container.spring.ConfigurationInfo)
+     * @see org.apache.cocoon.CocoonTestCase#addComponents(org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo)
      */
     protected void addComponents(ConfigurationInfo info) throws Exception {
         super.addComponents(info);

Modified: cocoon/trunk/blocks/cocoon-python/cocoon-python-impl/src/main/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-python/cocoon-python-impl/src/main/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-python/cocoon-python-impl/src/main/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java (original)
+++ cocoon/trunk/blocks/cocoon-python/cocoon-python-impl/src/main/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java Fri Aug 25 11:46:03 2006
@@ -23,7 +23,7 @@
 
 import org.apache.cocoon.components.language.programming.Program;
 import org.apache.cocoon.components.language.generator.CompiledComponent;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 import org.apache.cocoon.xsp.handler.AbstractComponentHandler;
 import org.apache.cocoon.xsp.handler.ComponentHandler;
 

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java (original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java Fri Aug 25 11:46:03 2006
@@ -22,7 +22,7 @@
 
 import org.apache.cocoon.components.language.generator.CompiledComponent;
 import org.apache.cocoon.components.language.programming.Program;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 import org.apache.cocoon.xsp.handler.AbstractComponentHandler;
 import org.apache.cocoon.xsp.handler.ComponentHandler;
 

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java (original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java Fri Aug 25 11:46:03 2006
@@ -23,7 +23,7 @@
 
 import org.apache.cocoon.components.language.generator.CompiledComponent;
 import org.apache.cocoon.components.language.programming.Program;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 import org.apache.cocoon.xsp.handler.AbstractComponentHandler;
 import org.apache.cocoon.xsp.handler.ComponentHandler;
 

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractComponentHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractComponentHandler.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractComponentHandler.java (original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractComponentHandler.java Fri Aug 25 11:46:03 2006
@@ -24,7 +24,7 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.thread.SingleThreaded;
 import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 
 /**
  * This class acts like a Factory to instantiate the correct version

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractFactoryHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractFactoryHandler.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractFactoryHandler.java (original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/AbstractFactoryHandler.java Fri Aug 25 11:46:03 2006
@@ -17,7 +17,7 @@
 package org.apache.cocoon.xsp.handler;
 
 import org.apache.avalon.framework.logger.Logger;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 
 /**
  * This class acts like a Factory to instantiate the correct version

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ComponentFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ComponentFactory.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ComponentFactory.java (original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ComponentFactory.java Fri Aug 25 11:46:03 2006
@@ -21,7 +21,7 @@
 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.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 
 /**
  * Factory for Avalon based components.

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/NonThreadSafePoolableComponentHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/NonThreadSafePoolableComponentHandler.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/NonThreadSafePoolableComponentHandler.java (original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/NonThreadSafePoolableComponentHandler.java Fri Aug 25 11:46:03 2006
@@ -21,7 +21,7 @@
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.logger.Logger;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 
 /**
  * The PoolableComponentHandler to make sure that poolable components are initialized

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/SingleThreadedComponentHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/SingleThreadedComponentHandler.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/SingleThreadedComponentHandler.java (original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/SingleThreadedComponentHandler.java Fri Aug 25 11:46:03 2006
@@ -17,7 +17,7 @@
 package org.apache.cocoon.xsp.handler;
 
 import org.apache.avalon.framework.logger.Logger;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 
 /**
  * The DefaultComponentHandler to make sure components are initialized

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ThreadSafeComponentHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ThreadSafeComponentHandler.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ThreadSafeComponentHandler.java (original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/xsp/handler/ThreadSafeComponentHandler.java Fri Aug 25 11:46:03 2006
@@ -17,7 +17,7 @@
 package org.apache.cocoon.xsp.handler;
 
 import org.apache.avalon.framework.logger.Logger;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
 
 /**
  * The ThreadSafeComponentHandler to make sure components are initialized

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/Constants.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/Constants.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/Constants.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/Constants.java Fri Aug 25 11:46:03 2006
@@ -212,13 +212,6 @@
     public static final String BLOCK_META_DIR = "COB-INF";
 
     /**
-     * Application <code>Context</code> Key for the URL to the configuration file
-     * (usually named cocoon.xconf)
-     * @deprecated Use {@link org.apache.cocoon.configuration.Settings#getConfiguration()}.
-     */
-    public static final String CONTEXT_CONFIG_URL = "config-url";
-
-    /**
      * Application <code>Context</code> Key for the default encoding.
      * @deprecated Use {@link org.apache.cocoon.configuration.Settings#getFormEncoding()}.
      */

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/ProcessingUtil.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/ProcessingUtil.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/ProcessingUtil.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/ProcessingUtil.java Fri Aug 25 11:46:03 2006
@@ -23,8 +23,8 @@
 
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.environment.internal.EnvironmentHelper;
-import org.apache.excalibur.source.SourceResolver;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.web.context.WebApplicationContext;
 
 /**
  * This is an utility class for processing Cocoon requests.
@@ -34,7 +34,7 @@
 public class ProcessingUtil {
 
     /** Servlet context attribute name for getting the root container. */
-    public static final String CONTAINER_CONTEXT_ATTR_NAME = "org.apache.cocoon.Cocoon";
+    public static final String CONTAINER_CONTEXT_ATTR_NAME = WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE;
 
     /** Bean name for the Avalon context. */
     public static final String CONTEXT_ROLE = "org.apache.avalon.framework.context.Context";
@@ -44,9 +44,6 @@
 
     /** Bean name for the service manager. */
     public static final String SERVICE_MANAGER_ROLE = "org.apache.avalon.framework.service.ServiceManager";
-
-    /** Bean name for local source resolver. (TODO) */
-    public static final String LOCAL_SOURCE_RESOLVER_ROLE = SourceResolver.ROLE + "/local";
 
     /**
      * Avoid construction.

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java Fri Aug 25 11:46:03 2006
@@ -35,18 +35,6 @@
     String PROPERTY_RUNNING_MODE = "org.apache.cocoon.mode";
 
     /**
-     * This parameter points to the main configuration file for Cocoon.
-     * Note that the path is specified in absolute notation but it will be
-     * resolved relative to the application context path.
-     */
-    String KEY_CONFIGURATION = "org.apache.cocoon.configuration";
-
-    /**
-     * This parameter indicates the configuration file of the LogKit management
-     */
-    String KEY_LOGGING_CONFIGURATION = "org.apache.cocoon.logging.configuration";
-
-    /**
      * This parameter indicates the log level to use throughout startup of the
      * system. As soon as the logging system is setup the setting of the log4j.xconf
      * configuration is used instead! Only for startup this log level is of importance.
@@ -212,22 +200,10 @@
     List getPropertyNames();
 
     /**
-     * @return Returns the configuration.
-     * @see #KEY_CONFIGURATION
-     */
-    String getConfiguration();
-
-    /**
      * @return Returns the loadClasses.
      * @see #KEY_LOAD_CLASSES
      */
     List getLoadClasses();
-
-    /**
-     * @return Returns the loggingConfiguration.
-     * @see #KEY_LOGGING_CONFIGURATION
-     */
-    String getLoggingConfiguration();
 
     /**
      * @return Returns the logLevel.

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java Fri Aug 25 11:46:03 2006
@@ -32,12 +32,6 @@
     /** This is the list of predefined running modes. */
     // public static final String[] RUNNING_MODES = {"prod", "dev", "test"};
 
-    /** The default configuration location. */
-    public static final String DEFAULT_CONFIGURATION = "/WEB-INF/cocoon/cocoon.xconf";
-
-    /** The default logging configuration location. */
-    public static final String DEFAULT_LOGGING_CONFIGURATION = "/WEB-INF/cocoon/log4j.xconf";
-
     /**
      * Default value for {@link Settings#isReloadingEnabled(String)} parameter (false).
      */

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java Fri Aug 25 11:46:03 2006
@@ -44,18 +44,6 @@
     protected final Properties properties = new Properties();
 
     /**
-     * This parameter points to the main configuration file for Cocoon.
-     * Note that the path is specified in absolute notation but it will be
-     * resolved relative to the application context path.
-     */
-    protected String configuration;
-
-    /**
-     * This parameter indicates the configuration file of the LogKit management
-     */
-    protected String loggingConfiguration;
-
-    /**
      * This parameter indicates the category id of the logger from the LogKit
      * configuration used by the environment.
      */
@@ -208,8 +196,6 @@
         this.manageExceptions = SettingsDefaults.MANAGE_EXCEPTIONS;
         this.configurationReloadDelay = SettingsDefaults.DEFAULT_CONFIGURATION_RELOAD_DELAY;
         this.containerEncoding = SettingsDefaults.DEFAULT_CONTAINER_ENCODING;
-        this.loggingConfiguration = SettingsDefaults.DEFAULT_LOGGING_CONFIGURATION;
-        this.configuration = SettingsDefaults.DEFAULT_CONFIGURATION;
         this.runningMode = mode;
     }
 
@@ -231,12 +217,8 @@
                 if ( key.startsWith(KEYPREFIX) ) {
                     final String value = current.getValue().toString();
 
-                    if ( key.equals(KEY_CONFIGURATION) ) {
-                        this.setConfiguration(value);
-                    } else if ( key.equals(KEY_RELOAD_DELAY) ) {
+                    if ( key.equals(KEY_RELOAD_DELAY) ) {
                         this.setConfigurationReloadDelay(Long.valueOf(value).longValue());
-                    } else if ( key.equals(KEY_LOGGING_CONFIGURATION) ) {
-                        this.setLoggingConfiguration(value);
                     } else if ( key.equals(KEY_LOGGING_ENVIRONMENT_LOGGER) ) {
                         this.setEnvironmentLogger(value);
                     } else if ( key.equals(KEY_LOGGING_COCOON_LOGGER) ) {
@@ -343,16 +325,6 @@
     }
 
     /**
-     * @see org.apache.cocoon.core.BaseSettings#getConfiguration()
-     */
-    public String getConfiguration() {
-        if ( this.parent != null ) {
-            return this.parent.getConfiguration();
-        }
-        return this.configuration;
-    }
-
-    /**
      * @see org.apache.cocoon.core.DynamicSettings#isEnableUploads()
      */
     public boolean isEnableUploads() {
@@ -401,16 +373,6 @@
     }
 
     /**
-     * @see org.apache.cocoon.core.BaseSettings#getLoggingConfiguration()
-     */
-    public String getLoggingConfiguration() {
-        if ( this.parent != null ) {
-            return this.parent.getLoggingConfiguration();
-        }
-        return this.loggingConfiguration;
-    }
-
-    /**
      * @see org.apache.cocoon.core.BaseSettings#getBootstrapLogLevel()
      */
     public String getBootstrapLogLevel() {
@@ -576,12 +538,8 @@
         }
         String value = null;
         if ( key.startsWith(KEYPREFIX) ) {
-            if ( key.equals(KEY_CONFIGURATION) ) {
-                value = this.getConfiguration();
-            } else if ( key.equals(KEY_RELOAD_DELAY) ) {
+            if ( key.equals(KEY_RELOAD_DELAY) ) {
                 value = String.valueOf(this.getReloadDelay(null));
-            } else if ( key.equals(KEY_LOGGING_CONFIGURATION) ) {
-                value = this.getLoggingConfiguration();
             } else if ( key.equals(KEY_LOGGING_ENVIRONMENT_LOGGER) ) {
                 value = this.getEnvironmentLogger();
             } else if ( key.equals(KEY_LOGGING_COCOON_LOGGER) ) {
@@ -639,11 +597,9 @@
     public String toString() {
         return "Settings:\n" +
           "Running mode : " + this.getRunningMode()+ '\n' +
-          KEY_CONFIGURATION + " : " + this.getConfiguration() + '\n' +
           KEY_RELOAD_DELAY + " : " + this.getReloadDelay(null) + '\n' +
           KEY_RELOADING + " : " + this.isReloadingEnabled(null) + '\n' +
           KEY_LOAD_CLASSES + " : " + this.toString(this.getLoadClasses()) + '\n' +
-          KEY_LOGGING_CONFIGURATION + " : " + this.getLoggingConfiguration() + '\n' +
           KEY_LOGGING_ENVIRONMENT_LOGGER + " : " + this.getEnvironmentLogger() + '\n' +
           KEY_LOGGING_BOOTSTRAP_LOGLEVEL + " : " + this.getBootstrapLogLevel() + '\n' +
           KEY_LOGGING_COCOON_LOGGER + " : " + this.getCocoonLogger() + '\n' +
@@ -727,15 +683,6 @@
     }
 
     /**
-     * @param configuration The configuration to set.
-     */
-    public void setConfiguration(String configuration) {
-        this.checkWriteable();
-        this.checkSubSetting();
-        this.configuration = configuration;
-    }
-
-    /**
      * @param enableUploads The enableUploads to set.
      */
     public void setEnableUploads(boolean enableUploads) {
@@ -759,15 +706,6 @@
     public void addToLoadClasses(String className) {
         this.checkWriteable();
         this.loadClasses.add(className);
-    }
-
-    /**
-     * @param loggingConfiguration The loggingConfiguration to set.
-     */
-    public void setLoggingConfiguration(String loggingConfiguration) {
-        this.checkWriteable();
-        this.checkSubSetting();
-        this.loggingConfiguration = loggingConfiguration;
     }
 
     /**

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/SettingsHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/SettingsHelper.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/SettingsHelper.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/SettingsHelper.java Fri Aug 25 11:46:03 2006
@@ -21,7 +21,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java Fri Aug 25 11:46:03 2006
@@ -18,40 +18,17 @@
 
 import java.io.File;
 import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Iterator;
 
 import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.context.Context;
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.context.DefaultContext;
-import org.apache.avalon.framework.logger.Logger;
-import org.apache.cocoon.Constants;
-import org.apache.cocoon.components.ContextHelper;
-import org.apache.cocoon.configuration.PropertyProvider;
-import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.configuration.impl.MutableSettings;
-import org.apache.cocoon.configuration.impl.SettingsHelper;
-import org.apache.cocoon.core.container.spring.AvalonEnvironment;
-import org.apache.cocoon.core.container.spring.BeanFactoryUtil;
-import org.apache.cocoon.core.container.spring.ConfigReader;
-import org.apache.cocoon.core.container.spring.ConfigurationInfo;
-import org.apache.cocoon.core.container.util.ComponentContext;
-import org.apache.cocoon.core.container.util.SimpleSourceResolver;
-import org.apache.cocoon.util.ClassUtils;
 import org.apache.cocoon.util.location.Location;
 import org.apache.cocoon.util.location.LocationImpl;
 import org.apache.cocoon.util.location.LocationUtils;
-import org.apache.excalibur.source.SourceResolver;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
 
 /**
- * This is an utility class to create a new Cocoon instance.
+ * This is an utility class.
  * 
  * @version $Id$
  * @since 2.2
@@ -60,6 +37,7 @@
 
     // Register the location finder for Avalon configuration objects and exceptions
     // and keep a strong reference to it.
+    // TODO - we should move the avalon specific part to the spring.avalon package!
     private static final LocationUtils.LocationFinder confLocFinder = new LocationUtils.LocationFinder() {
         public Location getLocation(Object obj, String description) {
             if (obj instanceof Configuration) {
@@ -107,318 +85,14 @@
         LocationUtils.addFinder(confLocFinder);
     }
     
-    public static ConfigurableBeanFactory createRootContainer(ServletContext context)
-    throws Exception {
-        return createRootContainer(context, null);
-    }
-
-    public static ConfigurableBeanFactory createRootContainer(ServletContext   servletContext,
-                                                              PropertyProvider externalPropertyProvider)
-    throws Exception {
-        // first let's set up the appContext with some values to make
-        // the simple source resolver work
-        // "legacy" support: create an avalon context.
-        final DefaultContext appContext = new ComponentContext();
-
-        // add root url
-        String contextUrl = CoreUtil.getContextUrl(servletContext, "/WEB-INF/web.xml");
-        CoreUtil.addSourceResolverContext(appContext, servletContext, contextUrl);
-
-        // create settings
-        final MutableSettings settings = CoreUtil.createSettings(servletContext, appContext, externalPropertyProvider);
-
-        // Create bootstrap logger
-        Logger log = BeanFactoryUtil.createBootstrapLogger(servletContext, settings.getBootstrapLogLevel());
-
-        if (log.isDebugEnabled()) {
-            log.debug("Context URL: " + contextUrl);
-        }
-        // initialize some directories
-        CoreUtil.initSettingsFiles(settings, log);
-
-        // update configuration
-        final URL u = CoreUtil.getConfigFile(settings.getConfiguration(), servletContext, log);
-        settings.setConfiguration(u.toExternalForm());
-
-        // dump system properties
-        CoreUtil.dumpSystemProperties(log);
-
-        // settings can't be changed anymore
-        settings.makeReadOnly();
-
-        // Init logger
-        log = BeanFactoryUtil.createRootLogger(servletContext,
-                                               settings);
-
-        // add the Avalon context attributes that are contained in the settings
-        CoreUtil.addSettingsContext(appContext, settings);
-
-        // force load classes
-        CoreUtil.forceLoad(settings, log);
-
-        // setup of the spring based container
-        return CoreUtil.setupSpringContainer(settings, servletContext, appContext, log);
-    }
-
-    /**
-     * Init work, upload and cache directory
-     * @param settings 
-     * @param log 
-     */
-    public static void initSettingsFiles(MutableSettings settings, Logger log) {
-        // first init the work-directory for the logger.
-        // this is required if we are running inside a war file!
-        final String workDirParam = settings.getWorkDirectory();
-        File workDir;
-        if (workDirParam != null) {
-            // No context path : consider work-directory as absolute
-            workDir = new File(workDirParam);
-        } else {
-            workDir = new File("cocoon-files");
-        }
-        workDir.mkdirs();
-        settings.setWorkDirectory(workDir.getAbsolutePath());
-
-        // Output some debug info
-        if (log.isDebugEnabled()) {
-            if (workDirParam != null) {
-                log.debug("Using work-directory " + workDir);
-            } else {
-                log.debug("Using default work-directory " + workDir);
-            }
-        }
-
-        final String uploadDirParam = settings.getUploadDirectory();
-        File uploadDir;
-        if (uploadDirParam != null) {
-            uploadDir = new File(uploadDirParam);
-            if (log.isDebugEnabled()) {
-                log.debug("Using upload-directory " + uploadDir);
-            }
-        } else {
-            uploadDir = new File(workDir, "upload-dir" + File.separator);
-            if (log.isDebugEnabled()) {
-                log.debug("Using default upload-directory " + uploadDir);
-            }
-        }
-        uploadDir.mkdirs();
-        settings.setUploadDirectory(uploadDir.getAbsolutePath());
-
-        String cacheDirParam = settings.getCacheDirectory();
-        File cacheDir;
-        if (cacheDirParam != null) {
-            cacheDir = new File(cacheDirParam);
-            if (log.isDebugEnabled()) {
-                log.debug("Using cache-directory " + cacheDir);
-            }
-        } else {
-            cacheDir = new File(workDir, "cache-dir" + File.separator);
-            File parent = cacheDir.getParentFile();
-            if (parent != null) {
-                parent.mkdirs();
-            }
-            if (log.isDebugEnabled()) {
-                log.debug("cache-directory was not set - defaulting to " + cacheDir);
-            }
-        }
-        cacheDir.mkdirs();
-        settings.setCacheDirectory(cacheDir.getAbsolutePath());
-    }
-
-    public static DefaultContext createContext(Settings       settings,
-                                               ServletContext servletContext,
-                                               String         contextUrl)
-        throws ServletException, MalformedURLException {
-        DefaultContext appContext = new ComponentContext();
-        CoreUtil.addSourceResolverContext(appContext, servletContext, contextUrl);
-        CoreUtil.addSettingsContext(appContext, settings);
-        return appContext;
-    }
-
     /**
-     * Adding the Avalon context content needed for setting up the <code>SimpleSourceResolver</code>
-     * @param appContext the Avalon context
-     * @param servletContext the Cocoon context
-     * @param contextUrl URL for the context
-     */
-    public static void addSourceResolverContext(DefaultContext appContext,
-                                                 ServletContext servletContext,
-                                                 String         contextUrl) {
-        try {
-            appContext.put(ContextHelper.CONTEXT_ROOT_URL, new URL(contextUrl));
-        } catch (MalformedURLException ignore) {
-            // we simply ignore this
-        }
-    
-        // add environment context and config
-        appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, servletContext);
-    }
-
-    /**
-     * Add the Avalon context attributes that are contained in the settings
-     * @param appContext 
-     * @param settings
-     * @param classloader 
-     * @throws MalformedURLException
-     */
-    public static void addSettingsContext(DefaultContext appContext, Settings settings)
-    throws MalformedURLException {
-        appContext.put(Constants.CONTEXT_WORK_DIR, new File(settings.getWorkDirectory()));
-        appContext.put(Constants.CONTEXT_UPLOAD_DIR, new File(settings.getUploadDirectory()));
-        appContext.put(Constants.CONTEXT_CACHE_DIR, new File(settings.getCacheDirectory()));
-        if(settings.getConfiguration() != null) {
-        	appContext.put(Constants.CONTEXT_CONFIG_URL, new URL(settings.getConfiguration()));
-        }
-        appContext.put(Constants.CONTEXT_DEFAULT_ENCODING, settings.getFormEncoding());
-    }
-
-    /**
-     * Get the settings for Cocoon.
-     * This method reads several property files and merges the result. If there
-     * is more than one definition for a property, the last one wins.
-     * The property files are read in the following order:
-     * 1) context://WEB-INF/properties/*.properties
-     *    Default values for the core and each block - the order in which the files are read is not guaranteed.
-     * 2) context://WEB-INF/properties/[RUNNING_MODE]/*.properties
-     *    Default values for the running mode - the order in which the files are read is not guaranteed.
-     * 3) Property providers (ToBeDocumented)
-     * 4) The environment (CLI, Servlet etc.) adds own properties (e.g. from web.xml)
-     * 5) Additional property file specified by the "org.apache.cocoon.settings" system property or
-     *    if the property is not found, the file ".cocoon/settings.properties" is tried to be read from
-     *    the user directory.
-     * 6) System properties
-     *
-     * @return A new Settings object
-     */
-    protected static MutableSettings createSettings(ServletContext   servletContext,
-                                                    Context          appContext,
-                                                    PropertyProvider externalPropertyProvider) {
-        // we need a logger for the settings util which will log info messages
-        final Logger logger = new LoggerWrapper(servletContext, true);
-        // we need our own resolver (with own logger which just logs errors)
-        final SourceResolver resolver = CoreUtil.createSourceResolver(appContext, new LoggerWrapper(servletContext));
-        return SettingsHelper.createSettings(servletContext, resolver, logger, externalPropertyProvider);
-    }
-
-    /**
-     * Dump System Properties.
-     */
-    protected static void dumpSystemProperties(Logger log) {
-        if (log.isDebugEnabled()) {
-            try {
-                Enumeration e = System.getProperties().propertyNames();
-                log.debug("===== System Properties Start =====");
-                while (e.hasMoreElements()) {
-                    String key = (String) e.nextElement();
-                    log.debug(key + "=" + System.getProperty(key));
-                }
-                log.debug("===== System Properties End =====");
-            } catch (SecurityException se) {
-                // Ignore Exceptions.
-            }
-        }
-    }
-
-    /**
-     * Create a simple source resolver.
-     */
-    protected static SourceResolver createSourceResolver(Context appContext,
-                                                         Logger  logger) {
-        // Create our own resolver
-        final SimpleSourceResolver resolver = new SimpleSourceResolver();
-        resolver.enableLogging(logger);
-        try {
-            resolver.contextualize(appContext);
-        } catch (ContextException ce) {
-            throw new CoreInitializationException(
-                    "Cannot setup source resolver.", ce);
-        }
-        return resolver;        
-    }
-
-    protected static ConfigurableBeanFactory setupSpringContainer(MutableSettings settings,
-                                                                  ServletContext  servletContext,
-                                                                  Context         appContext,
-                                                                  Logger          log)
-    throws Exception {
-        if (log.isInfoEnabled()) {
-            log.info("Reading root configuration: " + settings.getConfiguration());
-        }
-
-        if (log.isInfoEnabled()) {
-            log.info("Setting up root Spring container.");
-        }
-        final AvalonEnvironment avalonEnv = new AvalonEnvironment();
-        avalonEnv.context = appContext;
-        avalonEnv.logger = log;
-        avalonEnv.settings = settings;
-        ConfigurationInfo result = ConfigReader.readConfiguration(settings.getConfiguration(), avalonEnv);
-        ConfigurableBeanFactory mainContext = BeanFactoryUtil.createBeanFactory(avalonEnv, result, null, BeanFactoryUtil.getWebApplicationContext(servletContext));
-
-        settings.setCreationTime(System.currentTimeMillis());
-        return mainContext;
-    }
-
-    /**
-     * Get the URL of the main Cocoon configuration file.
-     */
-    protected static URL getConfigFile(final String         configFileName,
-                                       final ServletContext servletContext,
-                                       final Logger         log)
-    throws Exception {
-        if (log.isDebugEnabled()) {
-            log.debug("Using configuration file: " + configFileName);
-        }
-
-        URL result;
-        try {
-            // test if this is a qualified url
-            if (configFileName.indexOf(':') == -1) {
-                result = servletContext.getResource(configFileName);
-            } else {
-                result = new URL(configFileName);
-            }
-        } catch (Exception mue) {
-            String msg = "Setting for 'configuration' is invalid : " + configFileName;
-            log.error(msg, mue);
-            throw new CoreInitializationException(msg, mue);
-        }
-
-        if (result == null) {
-            File resultFile = new File(configFileName);
-            if (resultFile.isFile()) {
-                try {
-                    result = resultFile.getCanonicalFile().toURL();
-                } catch (Exception e) {
-                    String msg = "Setting for 'configuration' is invalid : " + configFileName;
-                    log.error(msg, e);
-                    throw new CoreInitializationException(msg, e);
-                }
-            }
-        }
-
-        if (result == null) {
-            String msg = "Setting for 'configuration' doesn't name an existing resource : " + configFileName;
-            log.error(msg);
-            throw new CoreInitializationException(msg);
-        }
-        return result;
-    }
-
-    /**
-     * @param environmentContext
-     */
-    public static String getWritableContextPath(ServletContext servletContext) {
-        return servletContext.getRealPath("/");
-    }
-
-    /**
-     * @param environmentContext 
-     * @param knownFile 
+     * Get the location of the webapp context as a url.
+     * @param servletContext The servlet context 
+     * @param knownFile      A known file in the webapp
      */
     public static String getContextUrl(ServletContext servletContext, String knownFile) {
         String servletContextURL;
-        String servletContextPath = CoreUtil.getWritableContextPath(servletContext);
+        String servletContextPath = servletContext.getRealPath("/");
         String path = servletContextPath;
 
         if (path == null) {
@@ -447,180 +121,5 @@
             }
         }
         return servletContextURL;
-    }
-
-    /**
-     * Handle the <code>load-class</code> settings. This overcomes
-     * limits in many classpath issues. One of the more notorious
-     * ones is a bug in WebSphere that does not load the URL handler
-     * for the <code>classloader://</code> protocol. In order to
-     * overcome that bug, set <code>org.apache.cocoon.classloader.load.classes.XY</code> property to
-     * the <code>com.ibm.servlet.classloader.Handler</code> value.
-     *
-     * <p>If you need to load more than one class, then add several
-     * properties, all starting with <cod>org.apache.cocoon.classloader.load.classes.</code>
-     * followed by a self defined identifier.</p>
-     */
-    protected static void forceLoad(final Settings settings, final Logger log) {
-        final Iterator i = settings.getLoadClasses().iterator();
-        while (i.hasNext()) {
-            final String fqcn = (String)i.next();
-            try {
-                if (log.isDebugEnabled()) {
-                    log.debug("Loading class: " + fqcn);
-                }
-                ClassUtils.loadClass(fqcn).newInstance();
-            } catch (Exception e) {
-                if (log.isWarnEnabled()) {
-                    log.warn("Could not load class: " + fqcn + ". Continuing initialization.", e);
-                }
-                // Do not throw an exception, because it is not a fatal error.
-            }
-        }
-    }
-
-    protected static final class LoggerWrapper implements Logger {
-
-        private final ServletContext servletContext;
-
-        private final boolean displayInfoAndWarn;
-
-        public LoggerWrapper(ServletContext servletContext) {
-            this.servletContext = servletContext;
-            this.displayInfoAndWarn = false;
-        }
-
-        public LoggerWrapper(ServletContext servletContext, boolean displayInfoAndWarn) {
-            this.servletContext = servletContext;
-            this.displayInfoAndWarn = displayInfoAndWarn;
-        }
-
-        protected void text(String arg0, Throwable arg1) {
-            if ( arg1 != null ) {
-                this.servletContext.log(arg0, arg1);
-            } else {
-                this.servletContext.log(arg0);
-            }
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#debug(java.lang.String, java.lang.Throwable)
-         */
-        public void debug(String arg0, Throwable arg1) {
-            // we ignore debug
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#debug(java.lang.String)
-         */
-        public void debug(String arg0) {
-            // we ignore debug
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#error(java.lang.String, java.lang.Throwable)
-         */
-        public void error(String arg0, Throwable arg1) {
-            this.text(arg0, arg1);
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#error(java.lang.String)
-         */
-        public void error(String arg0) {
-            this.text(arg0, null);
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#fatalError(java.lang.String, java.lang.Throwable)
-         */
-        public void fatalError(String arg0, Throwable arg1) {
-            this.text(arg0, arg1);
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#fatalError(java.lang.String)
-         */
-        public void fatalError(String arg0) {
-            this.text(arg0, null);
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#getChildLogger(java.lang.String)
-         */
-        public Logger getChildLogger(String arg0) {
-            return this;
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#info(java.lang.String, java.lang.Throwable)
-         */
-        public void info(String arg0, Throwable arg1) {
-            if ( this.displayInfoAndWarn ) {
-                this.text(arg0, arg1);
-            }
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#info(java.lang.String)
-         */
-        public void info(String arg0) {
-            if ( this.displayInfoAndWarn ) {
-                this.text(arg0, null);
-            }
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#isDebugEnabled()
-         */
-        public boolean isDebugEnabled() {
-            return false;
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#isErrorEnabled()
-         */
-        public boolean isErrorEnabled() {
-            return true;
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#isFatalErrorEnabled()
-         */
-        public boolean isFatalErrorEnabled() {
-            return true;
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#isInfoEnabled()
-         */
-        public boolean isInfoEnabled() {
-            return this.displayInfoAndWarn;
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#isWarnEnabled()
-         */
-        public boolean isWarnEnabled() {
-            return this.displayInfoAndWarn;
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#warn(java.lang.String, java.lang.Throwable)
-         */
-        public void warn(String arg0, Throwable arg1) {
-            if ( this.displayInfoAndWarn ) {
-                this.text(arg0, arg1);
-            }
-        }
-
-        /**
-         * @see org.apache.avalon.framework.logger.Logger#warn(java.lang.String)
-         */
-        public void warn(String arg0) {
-            if ( this.displayInfoAndWarn ) {
-                this.text(arg0, null);
-            }
-        }
     }
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java Fri Aug 25 11:46:03 2006
@@ -24,6 +24,8 @@
 import org.apache.cocoon.classloader.ClassLoaderFactory;
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.core.container.spring.avalon.AvalonEnvironment;
+import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
 import org.apache.cocoon.core.container.util.ClassLoaderUtils;
 import org.apache.cocoon.environment.Request;
 import org.apache.excalibur.source.SourceResolver;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java Fri Aug 25 11:46:03 2006
@@ -15,26 +15,19 @@
  */
 package org.apache.cocoon.core.container.spring;
 
-import java.io.File;
-import java.net.URL;
 import java.util.Iterator;
 
 import javax.servlet.ServletContext;
 
-import org.apache.avalon.excalibur.logger.Log4JConfLoggerManager;
-import org.apache.avalon.excalibur.logger.ServletLogger;
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.DefaultConfiguration;
-import org.apache.avalon.framework.context.DefaultContext;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.cocoon.ProcessingUtil;
 import org.apache.cocoon.acting.Action;
 import org.apache.cocoon.components.pipeline.ProcessingPipeline;
 import org.apache.cocoon.components.treeprocessor.ProcessorComponentInfo;
 import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.core.CoreInitializationException;
-import org.apache.cocoon.core.container.util.ConfigurationBuilder;
-import org.apache.cocoon.core.container.util.SettingsContext;
+import org.apache.cocoon.core.container.spring.avalon.AvalonEnvironment;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
 import org.apache.cocoon.generation.Generator;
 import org.apache.cocoon.matching.Matcher;
 import org.apache.cocoon.reading.Reader;
@@ -139,8 +132,8 @@
             final String xmlConfig = (new XmlConfigCreator(env.logger)).createConfig(info);
             Resource rsc = new ByteArrayResource(xmlConfig.getBytes("utf-8"));
             Logger logger = env.logger;
-            if ( info.rootLogger != null ) {
-                logger = env.logger.getChildLogger(info.rootLogger);
+            if ( info.getRootLogger() != null ) {
+                logger = env.logger.getChildLogger(info.getRootLogger());
             }
             // Spring uses the context classloader to create new beans
             CocoonBeanFactory factory;
@@ -156,10 +149,6 @@
             if ( env.context != null ) {
                 factory.registerSingleton(ProcessingUtil.CONTEXT_ROLE, env.context);
             }
-            // add local resolver 
-            if ( resolver != null ) {
-                factory.registerSingleton(SourceResolver.ROLE + "/Local", resolver);
-            }
             // add local settings
             factory.registerSingleton(Settings.ROLE, env.settings);
             prepareBeanFactory(factory, info);
@@ -178,120 +167,10 @@
     public static ApplicationContext getWebApplicationContext(ServletContext servletContext) {
         ApplicationContext parent = null;
         if( servletContext != null) {
-            parent = WebApplicationContextUtils.getWebApplicationContext(servletContext);            parent = (ApplicationContext)servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
+            parent = WebApplicationContextUtils.getWebApplicationContext(servletContext);            
+            parent = (ApplicationContext)servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
         }
         return parent;
-    }
-
-    /**
-     * Create the root logger for Cocoon.
-     * If the root spring application context is setup (using the spring listener) and
-     * if it contains a Logger bean (a bean with the name of the Logger class), then
-     * that bean is used as the root logger.
-     * If either the context is not available or the Logger bean is not defined, we setup
-     * our own Logger based on Log4j.
-     *
-     * @param context The servlet context.
-     * @param settings The core settings.
-     * @return The root logger for Cocoon.
-     */
-    public static Logger createRootLogger(ServletContext context,
-                                          Settings       settings) {
-        final ApplicationContext parent = (ApplicationContext)context.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
-        // test for a logger in the parent context
-        if ( parent != null && parent.containsBean(Logger.class.getName()) ) {
-            if ( settings.getEnvironmentLogger() == null || settings.getEnvironmentLogger().length() == 0 ) {
-                return (Logger)parent.getBean(Logger.class.getName());
-            }
-            return ((Logger)parent.getBean(Logger.class.getName())).getChildLogger(settings.getEnvironmentLogger());
-        }
-        // create a new log4j logger
-        try {
-            return initLogger(context, settings);
-        } catch (Exception ce) {
-            throw new CoreInitializationException("Cannot setup log4j logging system.", ce);
-        }
-    }
-    
-    /**
-     * Create a bootstrap logger that uses the servlet context
-     * @param servletContext
-     * @param logLevelString
-     * @return the logger
-     */
-    public static Logger createBootstrapLogger(ServletContext servletContext, String logLevelString) {
-        // create a bootstrap logger
-        int logLevel;
-        if ( "DEBUG".equalsIgnoreCase(logLevelString) ) {
-            logLevel = ServletLogger.LEVEL_DEBUG;
-        } else if ( "WARN".equalsIgnoreCase(logLevelString) ) {
-            logLevel = ServletLogger.LEVEL_WARN;
-        } else if ( "ERROR".equalsIgnoreCase(logLevelString) ) {
-            logLevel = ServletLogger.LEVEL_ERROR;
-        } else {
-            logLevel = ServletLogger.LEVEL_INFO;
-        }
-        return new ServletLogger(servletContext, "Cocoon", logLevel);
-    }
-
-    protected static Logger initLogger(ServletContext servletContext,
-                                       Settings       settings)
-    throws Exception {
-        // create a bootstrap logger
-        final String logLevelString = settings.getBootstrapLogLevel();
-        final Logger bootstrapLogger = BeanFactoryUtil.createBootstrapLogger(servletContext, logLevelString);
-
-
-        // create an own context for the logger manager
-        final DefaultContext subcontext = new SettingsContext(settings);
-        subcontext.put("context-work", new File(settings.getWorkDirectory()));
-        final File logSCDir = new File(settings.getWorkDirectory(), "cocoon-logs");
-        logSCDir.mkdirs();
-        subcontext.put("log-dir", logSCDir.toString());
-        subcontext.put("servlet-context", servletContext);
-
-        final Log4JConfLoggerManager loggerManager = new Log4JConfLoggerManager();
-        loggerManager.enableLogging(bootstrapLogger);
-        loggerManager.contextualize(subcontext);
-
-        // Configure the log4j manager
-        String loggerConfig = settings.getLoggingConfiguration();
-        if ( loggerConfig != null && !loggerConfig.startsWith("/") ) {
-            loggerConfig = '/' + loggerConfig;
-        }
-        if ( loggerConfig != null ) {
-            final URL url = servletContext.getResource(loggerConfig);
-            if ( url != null ) {
-                final ConfigurationBuilder builder = new ConfigurationBuilder(settings);
-                final Configuration conf = builder.build(servletContext.getResourceAsStream(loggerConfig));
-                // override log level?
-                if (settings.getOverrideLogLevel() != null) {
-                    changeLogLevel(conf.getChildren(), settings.getOverrideLogLevel());
-                }
-                loggerManager.configure(conf);
-            } else {
-                bootstrapLogger.warn("The logging configuration '" + loggerConfig + "' is not available.");
-                loggerManager.configure(new DefaultConfiguration("empty"));
-            }
-        } else {
-            loggerManager.configure(new DefaultConfiguration("empty"));
-        }
-
-        String accesslogger = settings.getEnvironmentLogger();
-        if (accesslogger == null) {
-            accesslogger = "cocoon";
-        }
-        return loggerManager.getLoggerForCategory(accesslogger);
-    }
-
-    protected static void changeLogLevel(Configuration[] configs, String level) {
-        for(int i=0; i<configs.length; i++) {
-            if ( configs[i].getName().equals("priority") ) {
-                // we now that this is a DefaultConfiguration
-                ((DefaultConfiguration)configs[i]).setAttribute("value", level);
-            }
-            changeLogLevel(configs[i].getChildren(), level);
-        }
     }
 
     protected static void prepareBeanFactory(CocoonBeanFactory factory,

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonBeanFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonBeanFactory.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonBeanFactory.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonBeanFactory.java Fri Aug 25 11:46:03 2006
@@ -27,6 +27,7 @@
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.core.container.spring.avalon.AvalonBeanPostProcessor;
+import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.config.BeanPostProcessor;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java Fri Aug 25 11:46:03 2006
@@ -16,7 +16,6 @@
  */
 package org.apache.cocoon.core.container.spring;
 
-import org.apache.cocoon.core.container.spring.avalon.AvalonElementParser;
 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 
 /**
@@ -35,7 +34,6 @@
      * @see org.springframework.beans.factory.xml.NamespaceHandler#init()
      */
     public void init() {
-        registerBeanDefinitionParser("avalon", new AvalonElementParser());
         registerBeanDefinitionParser("settings", new SettingsElementParser());
     }
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java Fri Aug 25 11:46:03 2006
@@ -31,6 +31,9 @@
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.core.container.spring.avalon.AvalonEnvironment;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
 import org.apache.cocoon.core.container.util.ConfigurationBuilder;
 import org.apache.cocoon.core.container.util.SimpleSourceResolver;
 import org.apache.cocoon.util.WildcardMatcherHelper;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java Fri Aug 25 11:46:03 2006
@@ -20,21 +20,22 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 
 import javax.servlet.ServletContext;
 
+import org.apache.cocoon.Constants;
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.configuration.SettingsDefaults;
 import org.apache.cocoon.configuration.impl.MutableSettings;
 import org.apache.cocoon.configuration.impl.PropertyHelper;
-import org.apache.cocoon.core.CoreInitializationException;
+import org.apache.cocoon.util.ClassUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.BeansException;
@@ -68,7 +69,7 @@
 
     protected ServletContext servletContext;
 
-    protected Settings settings;
+    protected MutableSettings settings;
 
     /**
      * @see org.springframework.web.context.ServletContextAware#setServletContext(javax.servlet.ServletContext)
@@ -79,59 +80,15 @@
 
     public void init()
     throws Exception {
-        final MutableSettings s = this.createSettings();
-        this.initSettingsFiles(s);
-        // update configuration
-        final URL u = this.getConfigFile(s.getConfiguration());
-        s.setConfiguration(u.toExternalForm());
+        this.settings = this.createSettings();
+        this.initSettingsFiles();
 
         // settings can't be changed anymore
-        s.makeReadOnly();
-        this.settings = s;
-    }
-
-    /**
-     * Get the URL of the main Cocoon configuration file.
-     */
-    protected URL getConfigFile(final String configFileName)
-    throws Exception {
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("Using configuration file: " + configFileName);
-        }
-
-        URL result;
-        try {
-            // test if this is a qualified url
-            if (configFileName.indexOf(':') == -1) {
-                result = this.servletContext.getResource(configFileName);
-            } else {
-                result = new URL(configFileName);
-            }
-        } catch (Exception mue) {
-            String msg = "Setting for 'configuration' is invalid : " + configFileName;
-            this.logger.error(msg, mue);
-            throw new CoreInitializationException(msg, mue);
-        }
+        this.settings.makeReadOnly();
 
-        if (result == null) {
-            File resultFile = new File(configFileName);
-            if (resultFile.isFile()) {
-                try {
-                    result = resultFile.getCanonicalFile().toURL();
-                } catch (Exception e) {
-                    String msg = "Setting for 'configuration' is invalid : " + configFileName;
-                    this.logger.error(msg, e);
-                    throw new CoreInitializationException(msg, e);
-                }
-            }
-        }
-
-        if (result == null) {
-            String msg = "Setting for 'configuration' doesn't name an existing resource : " + configFileName;
-            this.logger.error(msg);
-            throw new CoreInitializationException(msg);
-        }
-        return result;
+        this.dumpSystemProperties();
+        this.forceLoad();
+        this.logger.info("Apache Cocoon " + Constants.VERSION + " is up and ready.");
     }
 
     /**
@@ -139,7 +96,7 @@
      * @param settings 
      * @param log 
      */
-    protected void initSettingsFiles(MutableSettings settings) {
+    protected void initSettingsFiles() {
         // first init the work-directory for the logger.
         // this is required if we are running inside a war file!
         final String workDirParam = settings.getWorkDirectory();
@@ -318,9 +275,8 @@
             // now process
             final Iterator i = propertyUris.iterator();
             while ( i.hasNext() ) {
-                Resource src = null;
+                Resource src = (Resource)i.next();
                 try {
-                    src = (Resource)i.next();
                     final InputStream propsIS = src.getInputStream();
                     this.servletContext.log("Reading settings from '" + src.getURL() + "'.");
                     properties.load(propsIS);
@@ -397,6 +353,54 @@
 
         protected String resolveStringValue(String strVal) {
             return parseStringValue(strVal, this.props, null);
+        }
+    }
+    /**
+     * Dump System Properties.
+     */
+    protected void dumpSystemProperties() {
+        if (this.logger.isDebugEnabled()) {
+            try {
+                Enumeration e = System.getProperties().propertyNames();
+                this.logger.debug("===== System Properties Start =====");
+                while (e.hasMoreElements()) {
+                    String key = (String) e.nextElement();
+                    this.logger.debug(key + "=" + System.getProperty(key));
+                }
+                this.logger.debug("===== System Properties End =====");
+            } catch (SecurityException se) {
+                // Ignore Exceptions.
+            }
+        }
+    }
+
+    /**
+     * Handle the <code>load-class</code> settings. This overcomes
+     * limits in many classpath issues. One of the more notorious
+     * ones is a bug in WebSphere that does not load the URL handler
+     * for the <code>classloader://</code> protocol. In order to
+     * overcome that bug, set <code>org.apache.cocoon.classloader.load.classes.XY</code> property to
+     * the <code>com.ibm.servlet.classloader.Handler</code> value.
+     *
+     * <p>If you need to load more than one class, then add several
+     * properties, all starting with <cod>org.apache.cocoon.classloader.load.classes.</code>
+     * followed by a self defined identifier.</p>
+     */
+    protected void forceLoad() {
+        final Iterator i = this.settings.getLoadClasses().iterator();
+        while (i.hasNext()) {
+            final String fqcn = (String)i.next();
+            try {
+                if (this.logger.isDebugEnabled()) {
+                    this.logger.debug("Loading class: " + fqcn);
+                }
+                ClassUtils.loadClass(fqcn).newInstance();
+            } catch (Exception e) {
+                if (this.logger.isWarnEnabled()) {
+                    this.logger.warn("Could not load class: " + fqcn + ". Continuing initialization.", e);
+                }
+                // Do not throw an exception, because it is not a fatal error.
+            }
         }
     }
 

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java Fri Aug 25 11:46:03 2006
@@ -16,10 +16,12 @@
  */
 package org.apache.cocoon.core.container.spring;
 
+import org.apache.cocoon.Constants;
 import org.apache.cocoon.configuration.Settings;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.BeanDefinitionHolder;
-import org.springframework.beans.factory.config.RuntimeBeanReference;
 import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
 import org.springframework.beans.factory.support.BeanDefinitionRegistry;
 import org.springframework.beans.factory.support.RootBeanDefinition;
@@ -28,19 +30,25 @@
 import org.w3c.dom.Element;
 
 /**
+ * Add a bean definition for the settings object to the bean factory.
+ * @see CocoonNamespaceHandler
+ * @see SettingsBeanFactoryPostProcessor
  * @version $Id$
  * @since 2.2
  */
 public class SettingsElementParser implements BeanDefinitionParser {
 
+    /** Logger (we use the same logging mechanism as Spring!) */
+    protected final Log logger = LogFactory.getLog(getClass());
+
     /**
      * @see org.springframework.beans.factory.xml.BeanDefinitionParser#parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)
      */
     public BeanDefinition parse(Element element, ParserContext parserContext) {
+        this.logger.info("Initializing Apache Cocoon " + Constants.VERSION);
         this.addComponent(SettingsBeanFactoryPostProcessor.class,
                           Settings.ROLE,
                           "init",
-                          false,
                           parserContext.getRegistry());
         return null;
     }
@@ -48,16 +56,12 @@
     protected void addComponent(Class  componentClass,
                                 String role,
                                 String initMethod,
-                                boolean requiresSettings,
                                 BeanDefinitionRegistry registry) {
         RootBeanDefinition beanDef = new RootBeanDefinition();
         beanDef.setBeanClass(componentClass);      
         beanDef.setSingleton(true);
         if ( initMethod != null ) {
             beanDef.setInitMethodName(initMethod);
-        }
-        if ( requiresSettings ) {
-            beanDef.getPropertyValues().addPropertyValue("settings", new RuntimeBeanReference(Settings.ROLE));
         }
         
         BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDef, role);

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java Fri Aug 25 11:46:03 2006
@@ -25,6 +25,11 @@
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.ProcessingUtil;
+import org.apache.cocoon.core.container.spring.avalon.AvalonServiceManager;
+import org.apache.cocoon.core.container.spring.avalon.AvalonServiceSelector;
+import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
+import org.apache.cocoon.core.container.spring.avalon.PoolableFactoryBean;
 import org.springframework.util.StringUtils;
 
 /**

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java Fri Aug 25 11:46:03 2006
@@ -1,16 +1,19 @@
 package org.apache.cocoon.core.container.spring.avalon;
 
+import java.io.ByteArrayInputStream;
+
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
+import org.apache.avalon.framework.configuration.DefaultConfigurationSerializer;
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.parameters.Parameterizable;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.cocoon.core.container.spring.ComponentInfo;
-import org.apache.cocoon.core.container.spring.ConfigurationInfo;
+import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.core.container.util.ConfigurationBuilder;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.beans.factory.BeanFactory;
@@ -32,6 +35,15 @@
     protected Context context;
     protected BeanFactory beanFactory;
     protected ConfigurationInfo configurationInfo;
+    protected Settings settings;
+
+    public Settings getSettings() {
+        return settings;
+    }
+
+    public void setSettings(Settings settings) {
+        this.settings = settings;
+    }
 
     /**
      * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
@@ -95,9 +107,17 @@
             }
             ContainerUtil.contextualize(bean, this.context);
             ContainerUtil.service(bean, (ServiceManager)this.beanFactory.getBean(ServiceManager.class.getName()));
-            Configuration config = info.getConfiguration();
+            Configuration config = info.getProcessedConfiguration();
             if ( config == null ) {
-                config = EMPTY_CONFIG;
+                config = info.getConfiguration();
+                if ( config == null ) {
+                    config = EMPTY_CONFIG;
+                }
+                ConfigurationBuilder builder = new ConfigurationBuilder(this.settings);
+                // this is a little bit hacky but should do the trick
+                DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
+                config = builder.build(new ByteArrayInputStream(serializer.serialize(config).getBytes("utf-8")));
+                info.setProcessedConfiguration(config);
             }
             if ( bean instanceof Configurable ) {
                 ContainerUtil.configure(bean, config);

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonContextFactoryBean.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonContextFactoryBean.java?rev=436902&r1=436901&r2=436902&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonContextFactoryBean.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonContextFactoryBean.java Fri Aug 25 11:46:03 2006
@@ -15,13 +15,20 @@
  */
 package org.apache.cocoon.core.container.spring.avalon;
 
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
 import javax.servlet.ServletContext;
 
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.DefaultContext;
+import org.apache.cocoon.Constants;
+import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.core.CoreUtil;
 import org.apache.cocoon.core.container.util.ComponentContext;
+import org.apache.cocoon.environment.http.HttpContext;
 import org.springframework.beans.factory.FactoryBean;
 import org.springframework.web.context.ServletContextAware;
 
@@ -48,16 +55,32 @@
         this.servletContext = sContext;
     }
 
+    /**
+     * Create the Avalon context object.
+     * @throws Exception
+     */
     protected void init()
     throws Exception {
+        // create new Avalon context
         final DefaultContext appContext = new ComponentContext();
 
         // add root url
-        String contextUrl = CoreUtil.getContextUrl(this.servletContext, "/WEB-INF/web.xml");
-        CoreUtil.addSourceResolverContext(appContext, servletContext, contextUrl);
+        final String contextUrl = CoreUtil.getContextUrl(this.servletContext, "/WEB-INF/web.xml");
+        try {
+            appContext.put(ContextHelper.CONTEXT_ROOT_URL, new URL(contextUrl));
+        } catch (MalformedURLException ignore) {
+            // we simply ignore this
+        }
+    
+        // add environment context and config
+        appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, new HttpContext(this.servletContext));
 
         // add the Avalon context attributes that are contained in the settings
-        CoreUtil.addSettingsContext(appContext, settings);
+        appContext.put(Constants.CONTEXT_WORK_DIR, new File(this.settings.getWorkDirectory()));
+        appContext.put(Constants.CONTEXT_UPLOAD_DIR, new File(this.settings.getUploadDirectory()));
+        appContext.put(Constants.CONTEXT_CACHE_DIR, new File(this.settings.getCacheDirectory()));
+        appContext.put(Constants.CONTEXT_DEFAULT_ENCODING, this.settings.getFormEncoding());
+
         this.context = appContext;
     }
 



Mime
View raw message