You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/12/11 16:11:02 UTC
svn commit: r485693 - in
/cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler:
ProfilingCachingProcessingPipeline.java
ProfilingNonCachingProcessingPipeline.java
Author: cziegeler
Date: Mon Dec 11 07:11:01 2006
New Revision: 485693
URL: http://svn.apache.org/viewvc?view=rev&rev=485693
Log:
Sync with core
Modified:
cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java
Modified: cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java?view=diff&rev=485693&r1=485692&r2=485693
==============================================================================
--- cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java (original)
+++ cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java Mon Dec 11 07:11:01 2006
@@ -16,7 +16,6 @@
*/
package org.apache.cocoon.components.profiler;
-import java.io.IOException;
import java.util.Iterator;
import org.apache.avalon.framework.parameters.Parameters;
@@ -29,7 +28,6 @@
import org.apache.cocoon.transformation.Transformer;
import org.apache.cocoon.xml.XMLConsumer;
import org.apache.cocoon.xml.XMLProducer;
-import org.xml.sax.SAXException;
/**
* @version $Id$
@@ -86,7 +84,6 @@
public void setGenerator(String role, String source, Parameters param,
Parameters hintParam)
throws ProcessingException {
-
super.setGenerator(role, source, param, hintParam);
if (this.data==null) {
@@ -110,7 +107,6 @@
public void addTransformer(String role, String source, Parameters param,
Parameters hintParam)
throws ProcessingException {
-
super.addTransformer(role, source, param, hintParam);
if (this.data==null) {
@@ -133,7 +129,6 @@
Parameters hintParam,
String mimeType)
throws ProcessingException {
-
super.setSerializer(role, source, param, hintParam, mimeType);
if (this.data==null) {
@@ -153,7 +148,6 @@
public void setReader(String role, String source, Parameters param,
String mimeType)
throws ProcessingException {
-
super.setReader(role, source, param, mimeType);
if (this.data==null) {
@@ -202,12 +196,8 @@
);
}
this.data.setSetupTime(localIndex++, System.currentTimeMillis() - time);
-
- setMimeTypeForSerializer(environment);
- } catch (SAXException e) {
- throw new ProcessingException("Could not setup pipeline.", e);
- } catch (IOException e) {
- throw new ProcessingException("Could not setup pipeline.", e);
+ } catch (Exception e) {
+ handleException(e);
}
// Generate the key to fill the cache
Modified: cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java?view=diff&rev=485693&r1=485692&r2=485693
==============================================================================
--- cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java (original)
+++ cocoon/trunk/blocks/cocoon-profiler/cocoon-profiler-impl/src/main/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java Mon Dec 11 07:11:01 2006
@@ -16,7 +16,6 @@
*/
package org.apache.cocoon.components.profiler;
-import java.io.IOException;
import java.util.Iterator;
import org.apache.avalon.framework.activity.Disposable;
@@ -30,7 +29,6 @@
import org.apache.cocoon.transformation.Transformer;
import org.apache.cocoon.xml.XMLConsumer;
import org.apache.cocoon.xml.XMLProducer;
-import org.xml.sax.SAXException;
/**
* Special version of the NonCachingProcessingPipeline that supports capturing
@@ -91,7 +89,6 @@
public void setGenerator(String role, String source, Parameters param,
Parameters hintParam)
throws ProcessingException {
-
super.setGenerator(role, source, param, hintParam);
if (this.data==null) {
@@ -115,7 +112,6 @@
public void addTransformer(String role, String source, Parameters param,
Parameters hintParam)
throws ProcessingException {
-
super.addTransformer(role, source, param, hintParam);
if (this.data==null) {
@@ -138,7 +134,6 @@
Parameters hintParam,
String mimeType)
throws ProcessingException {
-
super.setSerializer(role, source, param, hintParam, mimeType);
if (this.data==null) {
@@ -158,7 +153,6 @@
public void setReader(String role, String source, Parameters param,
String mimeType)
throws ProcessingException {
-
super.setReader(role, source, param, mimeType);
if (this.data==null) {
@@ -209,12 +203,8 @@
);
}
this.data.setSetupTime(localIndex++, System.currentTimeMillis()-time);
-
- setMimeTypeForSerializer(environment);
- } catch (SAXException e) {
- throw new ProcessingException("Could not setup pipeline.", e);
- } catch (IOException e) {
- throw new ProcessingException("Could not setup pipeline.", e);
+ } catch (Exception e) {
+ handleException(e);
}
}
@@ -226,8 +216,7 @@
* @return true on success
*/
public boolean process(Environment environment)
- throws ProcessingException {
-
+ throws ProcessingException {
this.index = 0;
if (this.data!=null) {
// Capture environment info
@@ -253,7 +242,7 @@
*/
protected boolean processXMLPipeline(Environment environment) throws ProcessingException {
this.index = 0;
- if (this.data!=null) {
+ if (this.data != null) {
// Capture environment info
this.data.setEnvironmentInfo(new EnvironmentInfo(environment));
@@ -277,22 +266,22 @@
*/
protected boolean processReader(Environment environment) throws ProcessingException {
this.index = 0;
- if (this.data!=null) {
- // Capture environment info
- this.data.setEnvironmentInfo(new EnvironmentInfo(environment));
-
- // Execute pipeline
- long time = System.currentTimeMillis();
- boolean result = super.processReader(environment);
-
- this.data.setTotalTime(System.currentTimeMillis()-time);
-
- // Report
- profiler.addResult(environment.getURI(), this.data);
- return result;
- } else {
- getLogger().warn("Profiler Data havn't any components to measure");
- return super.processReader(environment);
+ if (this.data != null) {
+ // Capture environment info
+ this.data.setEnvironmentInfo(new EnvironmentInfo(environment));
+
+ // Execute pipeline
+ long time = System.currentTimeMillis();
+ boolean result = super.processReader(environment);
+
+ this.data.setTotalTime(System.currentTimeMillis()-time);
+
+ // Report
+ profiler.addResult(environment.getURI(), this.data);
+ return result;
+ } else {
+ getLogger().warn("Profiler Data havn't any components to measure");
+ return super.processReader(environment);
}
}