cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r380191 - in /cocoon/trunk: cocoon-core/src/main/java/org/apache/cocoon/bean/ cocoon-core/src/main/java/org/apache/cocoon/configuration/ cocoon-core/src/main/java/org/apache/cocoon/core/ cocoon-core/src/main/java/org/apache/cocoon/core/cont...
Date Thu, 23 Feb 2006 18:31:57 GMT
Author: cziegeler
Date: Thu Feb 23 10:31:51 2006
New Revision: 380191

URL: http://svn.apache.org/viewcvs?rev=380191&view=rev
Log:
Move all container related classes into own package; clean up logging

Added:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java
      - copied, changed from r380180, cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/configuration/ConfigurationBuilder.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java
      - copied, changed from r380180, cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/logging/SettingsContext.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SimpleSourceResolver.java
      - copied, changed from r380180, cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/source/SimpleSourceResolver.java
Removed:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/configuration/ConfigurationBuilder.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/logging/SettingsContext.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/source/SimpleSourceResolver.java
Modified:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonWrapper.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/container/spring/ApplicationContextFactory.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/commandline/CommandLineContext.java
    cocoon/trunk/cocoon-cron/cocoon-cron-impl/src/main/java/org/apache/cocoon/environment/background/BackgroundEnvironment.java

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonWrapper.java?rev=380191&r1=380190&r2=380191&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonWrapper.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/bean/CocoonWrapper.java Thu Feb
23 10:31:51 2006
@@ -99,7 +99,7 @@
         // FIXME - make the level configurable
         this.log = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
 
-        this.cliContext = new CommandLineContext(this.contextDir, this.log);
+        this.cliContext = new CommandLineContext(this.contextDir);
 
         this.context = getDir(this.contextDir, "context");
         this.work = getDir(workDir, "working");

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=380191&r1=380190&r2=380191&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 Thu Feb 23
10:31:51 2006
@@ -46,12 +46,12 @@
 import org.apache.cocoon.components.container.ComponentContext;
 import org.apache.cocoon.components.source.SourceUtil;
 import org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper;
-import org.apache.cocoon.configuration.ConfigurationBuilder;
 import org.apache.cocoon.core.container.spring.ApplicationContextFactory;
 import org.apache.cocoon.core.container.spring.AvalonEnvironment;
 import org.apache.cocoon.core.container.spring.ConfigReader;
 import org.apache.cocoon.core.container.spring.ConfigurationInfo;
-import org.apache.cocoon.core.source.SimpleSourceResolver;
+import org.apache.cocoon.core.container.util.ConfigurationBuilder;
+import org.apache.cocoon.core.container.util.SimpleSourceResolver;
 import org.apache.cocoon.util.ClassUtils;
 import org.apache.cocoon.util.StringUtils;
 import org.apache.cocoon.util.location.Location;

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ApplicationContextFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ApplicationContextFactory.java?rev=380191&r1=380190&r2=380191&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ApplicationContextFactory.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ApplicationContextFactory.java
Thu Feb 23 10:31:51 2006
@@ -31,11 +31,11 @@
 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.ConfigurationBuilder;
 import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.CoreInitializationException;
 import org.apache.cocoon.core.Settings;
-import org.apache.cocoon.core.logging.SettingsContext;
+import org.apache.cocoon.core.container.util.ConfigurationBuilder;
+import org.apache.cocoon.core.container.util.SettingsContext;
 import org.apache.cocoon.generation.Generator;
 import org.apache.cocoon.matching.Matcher;
 import org.apache.cocoon.reading.Reader;

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java?rev=380191&r1=380190&r2=380191&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
Thu Feb 23 10:31:51 2006
@@ -28,8 +28,8 @@
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.DefaultConfigurationSerializer;
 import org.apache.cocoon.components.source.SourceUtil;
-import org.apache.cocoon.configuration.ConfigurationBuilder;
-import org.apache.cocoon.core.source.SimpleSourceResolver;
+import org.apache.cocoon.core.container.util.ConfigurationBuilder;
+import org.apache.cocoon.core.container.util.SimpleSourceResolver;
 import org.apache.cocoon.matching.helpers.WildcardHelper;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;

Copied: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java
(from r380180, cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/configuration/ConfigurationBuilder.java)
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java?p2=cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java&p1=cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/configuration/ConfigurationBuilder.java&r1=380180&r2=380191&rev=380191&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/configuration/ConfigurationBuilder.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java
Thu Feb 23 10:31:51 2006
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.configuration;
+package org.apache.cocoon.core.container.util;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -27,7 +27,6 @@
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.cocoon.core.Settings;
-import org.apache.cocoon.core.container.util.PropertyHelper;
 import org.xml.sax.Attributes;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.ErrorHandler;

Copied: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java
(from r380180, cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/logging/SettingsContext.java)
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java?p2=cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java&p1=cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/logging/SettingsContext.java&r1=380180&r2=380191&rev=380191&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/logging/SettingsContext.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java
Thu Feb 23 10:31:51 2006
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.core.logging;
+package org.apache.cocoon.core.container.util;
 
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.ContextException;

Copied: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SimpleSourceResolver.java
(from r380180, cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/source/SimpleSourceResolver.java)
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SimpleSourceResolver.java?p2=cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SimpleSourceResolver.java&p1=cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/source/SimpleSourceResolver.java&r1=380180&r2=380191&rev=380191&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/source/SimpleSourceResolver.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SimpleSourceResolver.java
Thu Feb 23 10:31:51 2006
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.core.source;
+package org.apache.cocoon.core.container.util;
 
 import java.io.File;
 import java.io.IOException;

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/commandline/CommandLineContext.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/commandline/CommandLineContext.java?rev=380191&r1=380190&r2=380191&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/commandline/CommandLineContext.java
(original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/environment/commandline/CommandLineContext.java
Thu Feb 23 10:31:51 2006
@@ -21,7 +21,6 @@
 import java.net.URL;
 import java.util.Enumeration;
 
-import org.apache.avalon.framework.logger.Logger;
 import org.apache.cocoon.environment.Context;
 import org.apache.cocoon.environment.impl.AbstractContext;
 
@@ -35,14 +34,10 @@
     /** The context directory path. */
     private String contextDir;
 
-    /** The logger for debugging etc. */
-    protected Logger logger;
-
     /**
      * Constructs a CommandlineContext object from a ServletContext object
      */
-    public CommandLineContext(String contextDir, Logger logger) {
-        this.logger = logger;        
+    public CommandLineContext(String contextDir) {
         String contextDirPath = new File(contextDir).getAbsolutePath();
         // store contextDirPath as is don't remove trailing /.
         this.contextDir = contextDirPath;
@@ -79,9 +74,6 @@
      * @see org.apache.cocoon.environment.Context#getAttribute(java.lang.String)
      */
     public Object getAttribute(String name) {
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("CommandlineContext: getAttribute=" + name);
-        }
         return super.getAttribute(name);
     }
 
@@ -89,9 +81,6 @@
      * @see org.apache.cocoon.environment.Context#setAttribute(java.lang.String, java.lang.Object)
      */
     public void setAttribute(String name, Object value) {
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("CommandlineContext: setAttribute=" + name);
-        }
         super.setAttribute(name, value);
     }
 
@@ -99,9 +88,6 @@
      * @see org.apache.cocoon.environment.Context#removeAttribute(java.lang.String)
      */
     public void removeAttribute(String name) {
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("CommandlineContext: removeAttribute=" + name);
-        }
         super.removeAttribute(name);
     }
 
@@ -109,9 +95,6 @@
      * @see org.apache.cocoon.environment.Context#getAttributeNames()
      */
     public Enumeration getAttributeNames() {
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("CommandlineContext: getAttributeNames");
-        }
         return super.getAttributeNames();
     }
 
@@ -119,9 +102,6 @@
      * @see org.apache.cocoon.environment.Context#getResource(java.lang.String)
      */
     public URL getResource(String path) throws MalformedURLException {
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("CommandlineContext: getResource=" + path);
-        }
         // rely on File to build correct File and URL
         File f = new File( contextDir, path );
         if (!f.exists()) return null;
@@ -132,9 +112,6 @@
      * @see org.apache.cocoon.environment.Context#getRealPath(java.lang.String)
      */
     public String getRealPath(String path) {
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("CommandlineContext: getRealPath=" + path);
-        }
         // rely on File to build correct File and URL
         File f = new File( this.contextDir, path );
         return f.getAbsolutePath();
@@ -144,9 +121,6 @@
      * @see org.apache.cocoon.environment.Context#getMimeType(java.lang.String)
      */
     public String getMimeType(String file) {
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("CommandlineContext: getMimeType=" + file);
-        }
         //return servletContext.getMimeType(file);
         return null;
     }
@@ -155,7 +129,6 @@
      * @see org.apache.cocoon.environment.Context#getInitParameter(java.lang.String)
      */
     public String getInitParameter(String name) {
-        this.logger.debug("CommandlineContext: getInitParameter=" + name);
         return super.getInitParameter(name);
     }
 
@@ -163,7 +136,6 @@
      * @see org.apache.cocoon.environment.Context#getResourceAsStream(java.lang.String)
      */
     public InputStream getResourceAsStream(String path){
-        this.logger.debug("CommandlineContext: getResourceAsStream "+path);
         return super.getResourceAsStream(path);
     }
 }

Modified: cocoon/trunk/cocoon-cron/cocoon-cron-impl/src/main/java/org/apache/cocoon/environment/background/BackgroundEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-cron/cocoon-cron-impl/src/main/java/org/apache/cocoon/environment/background/BackgroundEnvironment.java?rev=380191&r1=380190&r2=380191&view=diff
==============================================================================
--- cocoon/trunk/cocoon-cron/cocoon-cron-impl/src/main/java/org/apache/cocoon/environment/background/BackgroundEnvironment.java
(original)
+++ cocoon/trunk/cocoon-cron/cocoon-cron-impl/src/main/java/org/apache/cocoon/environment/background/BackgroundEnvironment.java
Thu Feb 23 10:31:51 2006
@@ -15,23 +15,19 @@
  */
 package org.apache.cocoon.environment.background;
 
-import org.apache.avalon.framework.logger.Logger;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
 
+import org.apache.avalon.framework.logger.Logger;
 import org.apache.cocoon.environment.AbstractEnvironment;
 import org.apache.cocoon.environment.Context;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
-import org.apache.cocoon.environment.commandline.CommandLineContext;
 import org.apache.cocoon.environment.commandline.CommandLineRequest;
 import org.apache.cocoon.environment.commandline.CommandLineResponse;
 import org.apache.cocoon.util.NullOutputStream;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.HashMap;
-
 /**
  * A simple implementation of <code>org.apache.cocoon.environment.Environment</code>
  * for pipeline calls which are not externally triggered.
@@ -64,31 +60,6 @@
     }
 
     /**
-     * @param uri
-     * @param view
-     * @param context
-     * @param stream
-     * @param logger
-     */
-    public BackgroundEnvironment(String uri,
-                                 String view,
-                                 File context,
-                                 OutputStream stream,
-                                 Logger logger) {
-        super(uri, view);
-        enableLogging(logger);
-        this.outputStream = stream;
-
-        // TODO Would special Background*-objects have advantages?
-        Request request = new CommandLineRequest(this, "", uri, null, null, null);
-        this.objectModel.put(ObjectModelHelper.REQUEST_OBJECT, request);
-        this.objectModel.put(ObjectModelHelper.RESPONSE_OBJECT,
-                             new CommandLineResponse());
-        this.objectModel.put(ObjectModelHelper.CONTEXT_OBJECT,
-                             new CommandLineContext(context.getAbsolutePath(), logger));
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.cocoon.environment.Environment#redirect(java.lang.String, boolean,
boolean)
      */
     public void redirect(String newURL, boolean global, boolean permanent) throws IOException
{



Mime
View raw message