|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.components.pipeline.AbstractProcessingPipeline
public abstract class AbstractProcessingPipeline
This is the base for all implementations of a ProcessingPipeline
.
Field Summary | |
---|---|
protected Parameters |
configuration
The configuration |
protected long |
configuredExpires
Configured Expires value |
protected int |
configuredOutputBufferSize
Configured Output Buffer Size |
protected long |
expires
Expires value |
protected Generator |
generator
|
protected Parameters |
generatorParam
|
protected ComponentSelector |
generatorSelector
|
protected String |
generatorSource
|
protected XMLConsumer |
lastConsumer
This is the last component in the pipeline, either the serializer or a custom XML consumer in case of internal processing. |
protected ComponentManager |
manager
The component manager set with compose() |
protected ComponentManager |
newManager
The component manager set with compose() and recompose() |
protected int |
outputBufferSize
Output Buffer Size |
protected Parameters |
parameters
The parameters |
protected Reader |
reader
|
protected String |
readerMimeType
|
protected Parameters |
readerParam
|
protected OutputComponentSelector |
readerSelector
|
protected String |
readerSource
|
protected Serializer |
serializer
|
protected String |
serializerMimeType
|
protected Parameters |
serializerParam
|
protected OutputComponentSelector |
serializerSelector
|
protected String |
serializerSource
|
protected String |
sitemapReaderMimeType
|
protected String |
sitemapSerializerMimeType
|
protected ArrayList |
transformerParams
|
protected ArrayList |
transformers
|
protected ArrayList |
transformerSelectors
|
protected ArrayList |
transformerSources
|
Fields inherited from interface org.apache.cocoon.components.pipeline.ProcessingPipeline |
---|
ROLE |
Constructor Summary | |
---|---|
AbstractProcessingPipeline()
|
Method Summary | |
---|---|
void |
addTransformer(String role,
String source,
Parameters param,
Parameters hintParam)
Add a transformer at the end of the pipeline. |
protected boolean |
checkIfModified(Environment environment,
long lastModified)
|
protected boolean |
checkPipeline()
Sanity check |
void |
compose(ComponentManager manager)
Composable Interface |
protected void |
connect(Environment environment,
XMLProducer producer,
XMLConsumer consumer)
Connect the next component |
protected void |
connectPipeline(Environment environment)
Connect the XML pipeline. |
Generator |
getGenerator()
Get the generator - used for content aggregation |
String |
getKeyForEventPipeline()
Return the key for the event pipeline If the "event pipeline" (= the complete pipeline without the serializer) is cacheable and valid, return a key. |
protected Location |
getLocation(Parameters param)
|
SourceValidity |
getValidityForEventPipeline()
Return valid validity objects for the event pipeline If the "event pipeline" (= the complete pipeline without the serializer) is cacheable and valid, return all validity objects. |
protected void |
handleException(Exception e)
Handles exception which can happen during pipeline processing. |
void |
informBranchPoint()
Informs pipeline we have come across a branch point. |
protected boolean |
isInternalError()
|
void |
parameterize(Parameters params)
Parameterizable Interface - Configuration |
void |
prepareInternal(Environment environment)
Prepare an internal processing. |
protected void |
prepareInternalErrorHandler(Environment environment,
ProcessingException ex)
If prepareInternal fails, prepare internal error handler. |
protected void |
preparePipeline(Environment environment)
Prepare the pipeline |
boolean |
process(Environment environment)
Process the given Environment , producing the output. |
boolean |
process(Environment environment,
XMLConsumer consumer)
Process the given Environment , but do not use the
serializer. |
protected boolean |
processErrorHandler(Environment environment,
ProcessingException e,
XMLConsumer consumer)
|
protected boolean |
processReader(Environment environment)
Process the pipeline using a reader. |
protected boolean |
processXMLPipeline(Environment environment)
Process the SAX event pipeline |
void |
recompose(ComponentManager manager)
Recomposable Interface |
void |
recycle()
|
void |
release()
Release this component. |
void |
setErrorHandler(SitemapErrorHandler errorHandler)
Sets error handler for this pipeline. |
void |
setGenerator(String role,
String source,
Parameters param,
Parameters hintParam)
Set the generator that will be used as the initial step in the pipeline. |
protected void |
setMimeTypeForReader(Environment environment)
Set the mime-type for a reader |
protected void |
setMimeTypeForSerializer(Environment environment)
Set the mime-type for a serializer |
void |
setReader(String role,
String source,
Parameters param,
String mimeType)
Set the reader for this pipeline |
void |
setSerializer(String role,
String source,
Parameters param,
Parameters hintParam,
String mimeType)
Set the serializer for this pipeline |
void |
setup(Parameters params)
Setup this component |
protected void |
setupPipeline(Environment environment)
Setup pipeline components. |
protected void |
setupReader(Environment environment)
Setup the reader |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Generator generator
protected Parameters generatorParam
protected String generatorSource
protected ComponentSelector generatorSelector
protected ArrayList transformers
protected ArrayList transformerParams
protected ArrayList transformerSources
protected ArrayList transformerSelectors
protected Serializer serializer
protected Parameters serializerParam
protected String serializerSource
protected String serializerMimeType
protected String sitemapSerializerMimeType
protected OutputComponentSelector serializerSelector
protected Reader reader
protected Parameters readerParam
protected String readerSource
protected String readerMimeType
protected String sitemapReaderMimeType
protected OutputComponentSelector readerSelector
protected XMLConsumer lastConsumer
protected ComponentManager manager
protected ComponentManager newManager
protected Parameters configuration
protected long configuredExpires
protected int configuredOutputBufferSize
protected Parameters parameters
protected long expires
protected int outputBufferSize
Constructor Detail |
---|
public AbstractProcessingPipeline()
Method Detail |
---|
public void compose(ComponentManager manager) throws ComponentException
compose
in interface Composable
ComponentException
public void recompose(ComponentManager manager) throws ComponentException
recompose
in interface Recomposable
ComponentException
public void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
ParameterException
public void setup(Parameters params)
setup
in interface ProcessingPipeline
public void release()
release
in interface ProcessingPipeline
public void informBranchPoint()
informBranchPoint
in interface ProcessingPipeline
public Generator getGenerator()
getGenerator
in interface ProcessingPipeline
public void setGenerator(String role, String source, Parameters param, Parameters hintParam) throws ProcessingException
Generator
is fetched
from the latest ComponentManager
given by compose()
or recompose()
.
setGenerator
in interface ProcessingPipeline
role
- the generator role in the component manager.source
- the source where to produce XML from, or null
if no
source is given.param
- the parameters for the generator.
ProcessingException
- if the generator couldn't be obtained.public void addTransformer(String role, String source, Parameters param, Parameters hintParam) throws ProcessingException
Transformer
is fetched
from the latest ComponentManager
given by compose()
or recompose()
.
addTransformer
in interface ProcessingPipeline
role
- the transformer role in the component manager.source
- the source used to setup the transformer (e.g. XSL file), or
null
if no source is given.param
- the parameters for the transfomer.
ProcessingException
- if the generator couldn't be obtained.public void setSerializer(String role, String source, Parameters param, Parameters hintParam, String mimeType) throws ProcessingException
setSerializer
in interface ProcessingPipeline
mimeType
- Can be null
ProcessingException
public void setReader(String role, String source, Parameters param, String mimeType) throws ProcessingException
setReader
in interface ProcessingPipeline
mimeType
- Can be null
ProcessingException
public void setErrorHandler(SitemapErrorHandler errorHandler)
setErrorHandler
in interface ProcessingPipeline
errorHandler
- error handlerprotected boolean checkPipeline()
protected void setupPipeline(Environment environment) throws ProcessingException
ProcessingException
protected void connect(Environment environment, XMLProducer producer, XMLConsumer consumer) throws ProcessingException
ProcessingException
protected void connectPipeline(Environment environment) throws ProcessingException
ProcessingException
public boolean process(Environment environment) throws ProcessingException
Environment
, producing the output.
process
in interface ProcessingPipeline
ProcessingException
protected void preparePipeline(Environment environment) throws ProcessingException
ProcessingException
public void prepareInternal(Environment environment) throws ProcessingException
prepareInternal
in interface ProcessingPipeline
environment
- The current environment.
ProcessingException
protected void prepareInternalErrorHandler(Environment environment, ProcessingException ex) throws ProcessingException
ProcessingException
protected boolean isInternalError()
protected boolean processXMLPipeline(Environment environment) throws ProcessingException
ProcessingException
protected void setupReader(Environment environment) throws ProcessingException
ProcessingException
protected void setMimeTypeForReader(Environment environment) throws ProcessingException
environment
- The current environment
ProcessingException
protected void setMimeTypeForSerializer(Environment environment) throws ProcessingException
environment
- The current environment
ProcessingException
protected boolean checkIfModified(Environment environment, long lastModified) throws ProcessingException
ProcessingException
protected boolean processReader(Environment environment) throws ProcessingException
ProcessingException
- ifpublic void recycle()
recycle
in interface Recyclable
public boolean process(Environment environment, XMLConsumer consumer) throws ProcessingException
Environment
, but do not use the
serializer. Instead all SAX events are streamed to the XMLConsumer.
process
in interface ProcessingPipeline
ProcessingException
protected boolean processErrorHandler(Environment environment, ProcessingException e, XMLConsumer consumer) throws ProcessingException
ProcessingException
public SourceValidity getValidityForEventPipeline()
null
getValidityForEventPipeline
in interface ProcessingPipeline
public String getKeyForEventPipeline()
null
getKeyForEventPipeline
in interface ProcessingPipeline
protected Location getLocation(Parameters param)
protected void handleException(Exception e) throws ProcessingException
ConnectionResetException
- if connection reset detected
ProcessingException
- in all other cases
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |