bloritsch 01/06/08 08:02:22
Modified: src/org/apache/cocoon/components/pipeline Tag:
cocoon_20_branch AbstractEventPipeline.java
AbstractStreamPipeline.java
CachingEventPipeline.java
CachingStreamPipeline.java EventPipeline.java
StreamPipeline.java
Log:
Revert pipeline to original method--but retain the ProcessingException patch
from yesterday.
Revision Changes Path
No revision
No revision
1.5.2.3 +7 -12
xml-cocoon2/src/org/apache/cocoon/components/pipeline/AbstractEventPipeline.java
Index: AbstractEventPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/AbstractEventPipeline.java,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -r1.5.2.2 -r1.5.2.3
--- AbstractEventPipeline.java 2001/06/07 20:30:31 1.5.2.2
+++ AbstractEventPipeline.java 2001/06/08 15:02:16 1.5.2.3
@@ -35,7 +35,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:cziegeler@Carsten Ziegeler">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.5.2.2 $ $Date: 2001/06/07 20:30:31 $
+ * @version CVS $Revision: 1.5.2.3 $ $Date: 2001/06/08 15:02:16 $
*/
public abstract class AbstractEventPipeline
extends AbstractXMLProducer
@@ -80,7 +80,7 @@
this.sitemap = sitemap;
}
- public void setGenerator (Component role, String source, Parameters param,
Exception e)
+ public void setGenerator (String role, String source, Parameters param,
Exception e)
throws Exception {
this.setGenerator (role, source, param);
// FIXME(CZ) What can be done if this is not an ErrorNotifier?
@@ -91,12 +91,12 @@
}
}
- public void setGenerator (Component role, String source, Parameters param)
+ public void setGenerator (String role, String source, Parameters param)
throws Exception {
if (this.generator != null) {
throw new ProcessingException ("Generator already set. You can only
select one Generator (" + role + ")");
}
- this.generator = (Generator) role;
+ this.generator = (Generator) generatorSelector.select(role);
this.generatorSource = source;
this.generatorParam = param;
}
@@ -105,9 +105,9 @@
return this.generator;
}
- public void addTransformer (Component role, String source, Parameters param)
+ public void addTransformer (String role, String source, Parameters param)
throws Exception {
- this.transformers.add ((Transformer) role);
+ this.transformers.add ((Transformer)transformerSelector.select(role));
this.transformerSources.add (source);
this.transformerParams.add (param);
}
@@ -123,13 +123,8 @@
// execute the pipeline:
try {
this.generator.generate();
- } catch ( ProcessingException e ) {
- throw e;
} catch ( Exception e ) {
- throw new ProcessingException(
- "Failed to execute pipeline.",
- e
- );
+ throw e;
}
return true;
}
1.3.2.3 +11 -16
xml-cocoon2/src/org/apache/cocoon/components/pipeline/AbstractStreamPipeline.java
Index: AbstractStreamPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/AbstractStreamPipeline.java,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -r1.3.2.2 -r1.3.2.3
--- AbstractStreamPipeline.java 2001/06/07 20:30:32 1.3.2.2
+++ AbstractStreamPipeline.java 2001/06/08 15:02:17 1.3.2.3
@@ -34,7 +34,7 @@
* resource
* </UL>
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.3.2.2 $ $Date: 2001/06/07 20:30:32 $
+ * @version CVS $Revision: 1.3.2.3 $ $Date: 2001/06/08 15:02:17 $
*/
public abstract class AbstractStreamPipeline extends AbstractLoggable implements
StreamPipeline, Disposable {
protected EventPipeline eventPipeline;
@@ -80,42 +80,42 @@
return this.eventPipeline;
}
- public void setReader (Component role, String source, Parameters param)
+ public void setReader (String role, String source, Parameters param)
throws Exception {
this.setReader (role, source, param, null);
}
- public void setReader (Component role, String source, Parameters param, String
mimeType)
+ public void setReader (String role, String source, Parameters param, String
mimeType)
throws Exception {
if (this.reader != null) {
throw new ProcessingException ("Reader already set. You can only select
one Reader (" + role + ")");
}
- this.reader = (Reader) role;
+ this.reader = (Reader)readerSelector.select(role);
this.readerSource = source;
this.readerParam = param;
this.readerMimeType = mimeType;
- this.sitemapReaderMimeType =
readerSelector.getMimeTypeForRole(role.getClass().getName());
+ this.sitemapReaderMimeType = readerSelector.getMimeTypeForRole(role);
}
- public void setSerializer (Component role, String source, Parameters param)
+ public void setSerializer (String role, String source, Parameters param)
throws Exception {
this.setSerializer (role, source, param, null);
}
- public void setSerializer (Component role, String source, Parameters param,
String mimeType)
+ public void setSerializer (String role, String source, Parameters param, String
mimeType)
throws Exception {
if (this.serializer != null) {
throw new ProcessingException ("Serializer already set. You can only
select one Serializer (" + role + ")");
}
- this.serializer = (Serializer) role;
+ this.serializer = (Serializer)serializerSelector.select(role);
this.serializerSource = source;
this.serializerParam = param;
this.serializerMimeType = mimeType;
- this.sitemapSerializerMimeType =
serializerSelector.getMimeTypeForRole(role.getClass().getName());
+ this.sitemapSerializerMimeType =
serializerSelector.getMimeTypeForRole(role);
}
public boolean process(Environment environment)
- throws ProcessingException {
+ throws Exception {
if ( this.reader != null ) {
return processReader(environment);
} else {
@@ -129,13 +129,8 @@
// execute the pipeline:
try {
this.eventPipeline.process(environment);
- } catch ( ProcessingException e ) {
- throw e;
} catch ( Exception e ) {
- throw new ProcessingException(
- "Failed to execute pipeline.",
- e
- );
+ throw e;
}
return true;
1.7.2.3 +6 -11
xml-cocoon2/src/org/apache/cocoon/components/pipeline/CachingEventPipeline.java
Index: CachingEventPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/CachingEventPipeline.java,v
retrieving revision 1.7.2.2
retrieving revision 1.7.2.3
diff -u -r1.7.2.2 -r1.7.2.3
--- CachingEventPipeline.java 2001/06/07 20:30:33 1.7.2.2
+++ CachingEventPipeline.java 2001/06/08 15:02:17 1.7.2.3
@@ -52,7 +52,7 @@
* does not cache! (If it would cache, the response would be cached twice!)
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.7.2.2 $ $Date: 2001/06/07 20:30:33 $
+ * @version CVS $Revision: 1.7.2.3 $ $Date: 2001/06/08 15:02:17 $
*/
public final class CachingEventPipeline
extends AbstractEventPipeline
@@ -81,19 +81,19 @@
/**
* Set the generator.
*/
- public void setGenerator (Component role, String source, Parameters param)
+ public void setGenerator (String role, String source, Parameters param)
throws Exception {
super.setGenerator(role, source, param);
- this.generatorRole = role.getClass().getName();
+ this.generatorRole = role;
}
/**
* Add a transformer.
*/
- public void addTransformer (Component role, String source, Parameters param)
+ public void addTransformer (String role, String source, Parameters param)
throws Exception {
super.addTransformer(role, source, param);
- this.transformerRoles.add(role.getClass().getName());
+ this.transformerRoles.add(role);
}
/**
@@ -224,13 +224,8 @@
new CachedEventObject(this.validityObjects,
xmlSerializer.getSAXFragment()));
}
- } catch ( ProcessingException e ) {
- throw e;
} catch ( Exception e ) {
- throw new ProcessingException(
- "Failed to execute pipeline.",
- e
- );
+ throw e;
}
}
} finally {
1.3.2.3 +7 -13
xml-cocoon2/src/org/apache/cocoon/components/pipeline/CachingStreamPipeline.java
Index: CachingStreamPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/CachingStreamPipeline.java,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -r1.3.2.2 -r1.3.2.3
--- CachingStreamPipeline.java 2001/06/07 20:30:33 1.3.2.2
+++ CachingStreamPipeline.java 2001/06/08 15:02:18 1.3.2.3
@@ -45,7 +45,7 @@
* </ul>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.3.2.2 $ $Date: 2001/06/07 20:30:33 $
+ * @version CVS $Revision: 1.3.2.3 $ $Date: 2001/06/08 15:02:18 $
*/
public class CachingStreamPipeline extends AbstractStreamPipeline {
@@ -72,18 +72,18 @@
/** Set the serializer.
*/
- public void setSerializer (Component role, String source, Parameters param,
String mimeType)
+ public void setSerializer (String role, String source, Parameters param, String
mimeType)
throws Exception {
super.setSerializer(role, source, param, mimeType);
- this.serializerRole = role.getClass().getName();
+ this.serializerRole = role;
}
/** Set the Reader.
*/
- public void setReader (Component role, String source, Parameters param, String
mimeType)
+ public void setReader (String role, String source, Parameters param, String
mimeType)
throws Exception {
super.setReader(role, source, param, mimeType);
- this.readerRole = role.getClass().getName();
+ this.readerRole = role;
}
/** Process the pipeline using a reader.
@@ -241,7 +241,7 @@
* Process the request.
*/
public boolean process(Environment environment)
- throws ProcessingException {
+ throws Exception {
if ( super.reader != null ) {
return super.process(environment);
} else {
@@ -354,14 +354,8 @@
}
- } catch ( ProcessingException e ) {
- throw e;
} catch ( Exception e ) {
- getLogger().debug("Exception in process", e);
- throw new ProcessingException(
- "Failed to execute pipeline.",
- e
- );
+ throw e;
}
return true;
}
1.2.2.2 +3 -3
xml-cocoon2/src/org/apache/cocoon/components/pipeline/EventPipeline.java
Index: EventPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/EventPipeline.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- EventPipeline.java 2001/06/07 16:23:50 1.2.2.1
+++ EventPipeline.java 2001/06/08 15:02:18 1.2.2.2
@@ -18,13 +18,13 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/06/07 16:23:50 $
+ * @version CVS $Revision: 1.2.2.2 $ $Date: 2001/06/08 15:02:18 $
*/
public interface EventPipeline extends Component, Composable, Recyclable, Processor
{
- void setGenerator (Component role, String source, Parameters param, Exception
e) throws Exception;
- void setGenerator (Component role, String source, Parameters param) throws
Exception;
+ void setGenerator (String role, String source, Parameters param, Exception e)
throws Exception;
+ void setGenerator (String role, String source, Parameters param) throws
Exception;
Generator getGenerator ();
- void addTransformer (Component role, String source, Parameters param) throws
Exception;
+ void addTransformer (String role, String source, Parameters param) throws
Exception;
void setSitemap(Sitemap sitemap);
boolean process(Environment environment) throws Exception;
}
1.2.2.2 +4 -4
xml-cocoon2/src/org/apache/cocoon/components/pipeline/StreamPipeline.java
Index: StreamPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/StreamPipeline.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- StreamPipeline.java 2001/06/07 16:23:51 1.2.2.1
+++ StreamPipeline.java 2001/06/08 15:02:19 1.2.2.2
@@ -20,14 +20,14 @@
* <CODE>Serializer</CODE> and let them produce the character stream
* </UL>
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/06/07 16:23:51 $
+ * @version CVS $Revision: 1.2.2.2 $ $Date: 2001/06/08 15:02:19 $
*/
public interface StreamPipeline extends Component, Composable, Recyclable,
Processor {
void setEventPipeline (EventPipeline eventPipeline) throws Exception;
EventPipeline getEventPipeline ();
- void setReader (Component role, String source, Parameters param) throws
Exception;
- void setReader (Component role, String source, Parameters param, String
mimeType) throws Exception;
- void setSerializer (Component role, String source, Parameters param) throws
Exception;
- void setSerializer (Component role, String source, Parameters param, String
mimeType) throws Exception;
+ void setReader (String role, String source, Parameters param) throws Exception;
+ void setReader (String role, String source, Parameters param, String mimeType)
throws Exception;
+ void setSerializer (String role, String source, Parameters param) throws
Exception;
+ void setSerializer (String role, String source, Parameters param, String
mimeType) throws Exception;
}
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]