cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r586241 - in /cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice: components/ postable/components/
Date Fri, 19 Oct 2007 02:58:34 GMT
Author: vgritsenko
Date: Thu Oct 18 19:58:33 2007
New Revision: 586241

URL: http://svn.apache.org/viewvc?rev=586241&view=rev
Log:
cleaning up loggers in servlet service

Modified:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/LinkRewriterReader.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceGenerator.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceTransformer.java

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/LinkRewriterReader.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/LinkRewriterReader.java?rev=586241&r1=586240&r2=586241&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/LinkRewriterReader.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/LinkRewriterReader.java
Thu Oct 18 19:58:33 2007
@@ -30,6 +30,10 @@
 
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceException;
+import org.apache.excalibur.source.SourceValidity;
+
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.caching.CacheableProcessingComponent;
 import org.apache.cocoon.components.modules.input.InputModule;
@@ -40,29 +44,23 @@
 import org.apache.cocoon.environment.Response;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.reading.AbstractReader;
-import org.apache.cocoon.util.avalon.CLLoggerWrapper;
 import org.apache.cocoon.util.location.LocationImpl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.source.SourceException;
-import org.apache.excalibur.source.SourceValidity;
+
 import org.xml.sax.SAXException;
 
 /**
  * @cocoon.sitemap.component.documentation
- * <code>LinkRewriterReader<code> realizes servlet: link rewriting in text resources.
It should be used especially for serving js files that have
- * paths refering to other blocks (servlet: links).
+ * <code>LinkRewriterReader<code> implements <code>servlet:</code>
link rewriting in
+ * text resources. It should be used especially for serving JavaScript files that have
+ * paths refering to other blocks (<code>servlet:</code> links).
  * 
  * <p><b>Configuration</b><br>
  * <code>encoding</code> - see {@link #setEncoding}<br>
  * <code>expires</code> - see {@link #setExpires}.
  */
-public class LinkRewriterReader extends AbstractReader implements CacheableProcessingComponent
{
+public class LinkRewriterReader extends AbstractReader
+                                implements CacheableProcessingComponent {
 
-    /** The default logger for this class. */
-    private Log logger = LogFactory.getLog(getClass());
-        
     protected long configuredExpires = -1;
     protected String configuredEncoding = "UTF-8";
     
@@ -98,10 +96,6 @@
     
     public void setInputModule(InputModule inputModule) {
         this.inputModule = inputModule;
-    }
-    
-    public void init() {
-        this.enableLogging(new CLLoggerWrapper(this.logger));
     }
     
     public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
throws ProcessingException, SAXException, IOException {

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceGenerator.java?rev=586241&r1=586240&r2=586241&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceGenerator.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceGenerator.java
Thu Oct 18 19:58:33 2007
@@ -21,18 +21,17 @@
 
 import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.commons.io.IOUtils;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceException;
+
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.components.source.util.SourceUtil;
+import org.apache.cocoon.core.xml.SAXParser;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.generation.AbstractGenerator;
 import org.apache.cocoon.servletservice.postable.PostableSource;
-import org.apache.cocoon.util.avalon.CLLoggerWrapper;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.source.SourceException;
-import org.apache.cocoon.core.xml.SAXParser;
+
 import org.xml.sax.SAXException;
 
 /**
@@ -48,14 +47,10 @@
  */
 public class ServletServiceGenerator extends AbstractGenerator {
 	
-	private Log logger = LogFactory.getLog(getClass());
 	private SAXParser saxParser;
 	
 	private PostableSource servletSource;
 	
-    public void init() {
-        this.enableLogging(new CLLoggerWrapper(this.logger));
-    }
 
 	/* (non-Javadoc)
 	 * @see org.apache.cocoon.generation.Generator#generate()
@@ -93,9 +88,9 @@
             throw SourceUtil.handle("Error during resolving of '" + src + "'.", se);
         }
         
-        if (logger.isDebugEnabled()) {
-        	logger.debug("Source " + service + " resolved to " + servletSource.getURI());
-            logger.debug("Source " + super.source + " resolved to " + inputSource.getURI());
+        if (getLogger().isDebugEnabled()) {
+        	getLogger().debug("Source " + service + " resolved to " + servletSource.getURI());
+            getLogger().debug("Source " + super.source + " resolved to " + inputSource.getURI());
         }
         
         IOUtils.copy(inputSource.getInputStream(), servletSource.getOutputStream());
@@ -108,5 +103,4 @@
 	public void setSaxParser(SAXParser saxParser) {
 		this.saxParser = saxParser;
 	}
-
 }

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java?rev=586241&r1=586240&r2=586241&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceSerializer.java
Thu Oct 18 19:58:33 2007
@@ -22,6 +22,9 @@
 
 import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.commons.io.IOUtils;
+import org.apache.excalibur.source.SourceException;
+
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.components.source.util.SourceUtil;
 import org.apache.cocoon.environment.ObjectModelHelper;
@@ -30,13 +33,9 @@
 import org.apache.cocoon.serialization.AbstractSerializer;
 import org.apache.cocoon.servletservice.postable.PostableSource;
 import org.apache.cocoon.sitemap.SitemapModelComponent;
-import org.apache.cocoon.util.avalon.CLLoggerWrapper;
 import org.apache.cocoon.xml.SaxBuffer;
 import org.apache.cocoon.xml.XMLUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.excalibur.source.SourceException;
+
 import org.xml.sax.SAXException;
 
 /**
@@ -53,20 +52,16 @@
  * service.
  * @cocoon.sitemap.component.name servletService  
  */
-public class ServletServiceSerializer extends AbstractSerializer implements SitemapModelComponent
{
-
-	private Log logger = LogFactory.getLog(getClass());
+public class ServletServiceSerializer extends AbstractSerializer
+                                      implements SitemapModelComponent {
 
 	private PostableSource servletSource;
 	private Response response;
 
 	private SaxBuffer saxBuffer;
-	
-	public void init() {
-        this.enableLogging(new CLLoggerWrapper(this.logger));
-    }
 
-	public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
+
+    public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
     throws ProcessingException, SAXException, IOException {
 		String service;
 		try {
@@ -83,8 +78,8 @@
 			throw SourceUtil.handle("Error during resolving of '" + service + "'.", se);
 		}
 
-		if (logger.isDebugEnabled()) {
-			logger.debug("Source " + service + " resolved to " + servletSource.getURI());
+		if (getLogger().isDebugEnabled()) {
+			getLogger().debug("Source " + service + " resolved to " + servletSource.getURI());
 		}
 
 		saxBuffer = new SaxBuffer();

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceTransformer.java?rev=586241&r1=586240&r2=586241&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceTransformer.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/postable/components/ServletServiceTransformer.java
Thu Oct 18 19:58:33 2007
@@ -20,17 +20,16 @@
 import java.io.StringReader;
 
 import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.commons.io.IOUtils;
+import org.apache.excalibur.source.SourceException;
+
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.components.source.util.SourceUtil;
 import org.apache.cocoon.core.xml.SAXParser;
 import org.apache.cocoon.servletservice.postable.PostableSource;
 import org.apache.cocoon.sitemap.DisposableSitemapComponent;
 import org.apache.cocoon.transformation.AbstractSAXTransformer;
-import org.apache.cocoon.util.avalon.CLLoggerWrapper;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.excalibur.source.SourceException;
+
 import org.xml.sax.SAXException;
 
 /**
@@ -44,17 +43,14 @@
  * by the service down the pipeline.
  * @cocoon.sitemap.component.name servletService 
  */
-public class ServletServiceTransformer extends AbstractSAXTransformer implements DisposableSitemapComponent
{
-	private Log logger = LogFactory.getLog(getClass());
-	
+public class ServletServiceTransformer extends AbstractSAXTransformer
+                                       implements DisposableSitemapComponent {
+
 	private SAXParser saxParser;
 	
 	private PostableSource servletSource;
 	
-    public void init() {
-        this.enableLogging(new CLLoggerWrapper(this.logger));
-    }
-	
+
 	public void setupTransforming() throws IOException, ProcessingException, SAXException {
 		super.setupTransforming();
 		
@@ -73,8 +69,8 @@
             throw SourceUtil.handle("Error during resolving of '" + service + "'.", se);
         }
         
-        if (logger.isDebugEnabled()) {
-        	logger.debug("Source " + service + " resolved to " + servletSource.getURI());
+        if (getLogger().isDebugEnabled()) {
+        	getLogger().debug("Source " + service + " resolved to " + servletSource.getURI());
         }
 		
 		startSerializedXMLRecording(null);



Mime
View raw message