|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.util.AbstractLogEnabled org.apache.cocoon.components.pipeline.AbstractProcessingPipeline
This is the base for all implementations of a ProcessingPipeline
.
It is advisable to inherit from this base class instead of doing a complete
own implementation!
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 org.apache.cocoon.generation.Generator |
generator
|
protected Parameters |
generatorParam
|
protected String |
generatorSource
|
protected org.apache.cocoon.xml.XMLConsumer |
lastConsumer
This is the last component in the pipeline, either the serializer or a custom XML consumer in case of internal processing. |
protected ServiceManager |
manager
The component manager set with compose() |
protected ServiceManager |
newManager
The component manager set with compose() and recompose() |
protected int |
outputBufferSize
Output Buffer Size |
protected Parameters |
parameters
The parameters |
protected org.apache.cocoon.reading.Reader |
reader
|
protected String |
readerMimeType
|
protected Parameters |
readerParam
|
protected String |
readerSource
|
protected org.apache.cocoon.serialization.Serializer |
serializer
|
protected String |
serializerMimeType
|
protected Parameters |
serializerParam
|
protected String |
serializerSource
|
protected org.apache.cocoon.environment.SourceResolver |
sourceResolver
The current SourceResolver |
protected ArrayList |
transformerParams
|
protected ArrayList |
transformers
|
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(org.apache.cocoon.environment.Environment environment,
long lastModified)
|
protected boolean |
checkPipeline()
Sanity check |
protected void |
connect(org.apache.cocoon.environment.Environment environment,
org.apache.cocoon.xml.XMLProducer producer,
org.apache.cocoon.xml.XMLConsumer consumer)
Connect the next component |
protected void |
connectPipeline(org.apache.cocoon.environment.Environment environment)
Connect the XML pipeline. |
org.apache.cocoon.generation.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 org.apache.cocoon.util.location.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(org.apache.cocoon.environment.Environment environment)
Prepare an internal processing. |
protected void |
prepareInternalErrorHandler(org.apache.cocoon.environment.Environment environment,
org.apache.cocoon.ProcessingException ex)
If prepareInternal fails, prepare internal error handler. |
protected void |
preparePipeline(org.apache.cocoon.environment.Environment environment)
Prepare the pipeline |
boolean |
process(org.apache.cocoon.environment.Environment environment)
Process the given Environment , producing the output. |
boolean |
process(org.apache.cocoon.environment.Environment environment,
org.apache.cocoon.xml.XMLConsumer consumer)
Process the given Environment , but do not use the
serializer. |
protected boolean |
processErrorHandler(org.apache.cocoon.environment.Environment environment,
org.apache.cocoon.ProcessingException e,
org.apache.cocoon.xml.XMLConsumer consumer)
|
protected boolean |
processReader(org.apache.cocoon.environment.Environment environment)
Process the pipeline using a reader. |
protected boolean |
processXMLPipeline(org.apache.cocoon.environment.Environment environment)
Process the SAX event pipeline |
void |
recycle()
|
void |
service(ServiceManager aManager)
|
void |
setErrorHandler(org.apache.cocoon.sitemap.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(org.apache.cocoon.environment.Environment environment)
Set the mime-type for a reader |
protected void |
setMimeTypeForSerializer(org.apache.cocoon.environment.Environment environment)
Set the mime-type for a serializer |
void |
setProcessorManager(ServiceManager manager)
Set the processor's service manager |
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(org.apache.cocoon.environment.Environment environment)
Setup pipeline components. |
protected void |
setupReader(org.apache.cocoon.environment.Environment environment)
Setup the reader |
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.apache.cocoon.generation.Generator generator
protected Parameters generatorParam
protected String generatorSource
protected ArrayList transformers
protected ArrayList transformerParams
protected ArrayList transformerSources
protected org.apache.cocoon.serialization.Serializer serializer
protected Parameters serializerParam
protected String serializerSource
protected String serializerMimeType
protected org.apache.cocoon.reading.Reader reader
protected Parameters readerParam
protected String readerSource
protected String readerMimeType
protected org.apache.cocoon.xml.XMLConsumer lastConsumer
protected ServiceManager manager
protected ServiceManager newManager
protected Parameters configuration
protected long configuredExpires
protected int configuredOutputBufferSize
protected Parameters parameters
protected long expires
protected int outputBufferSize
protected org.apache.cocoon.environment.SourceResolver sourceResolver
Constructor Detail |
public AbstractProcessingPipeline()
Method Detail |
public void service(ServiceManager aManager) throws ServiceException
service
in interface Serviceable
ServiceException
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
public void setProcessorManager(ServiceManager manager)
setProcessorManager
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
public void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
ParameterException
public void setup(Parameters params)
setup
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
public void informBranchPoint()
informBranchPoint
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
public org.apache.cocoon.generation.Generator getGenerator()
getGenerator
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
public void setGenerator(String role, String source, Parameters param, Parameters hintParam) throws org.apache.cocoon.ProcessingException
Generator
is fetched
from the latest ServiceManager
.
setGenerator
in interface org.apache.cocoon.components.pipeline.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.
org.apache.cocoon.ProcessingException
- if the generator couldn't be obtained.public void addTransformer(String role, String source, Parameters param, Parameters hintParam) throws org.apache.cocoon.ProcessingException
Transformer
is fetched
from the latest ServiceManager
.
addTransformer
in interface org.apache.cocoon.components.pipeline.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.
org.apache.cocoon.ProcessingException
- if the generator couldn't be obtained.public void setSerializer(String role, String source, Parameters param, Parameters hintParam, String mimeType) throws org.apache.cocoon.ProcessingException
setSerializer
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
mimeType
- Can be null
org.apache.cocoon.ProcessingException
public void setReader(String role, String source, Parameters param, String mimeType) throws org.apache.cocoon.ProcessingException
setReader
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
mimeType
- Can be null
org.apache.cocoon.ProcessingException
public void setErrorHandler(org.apache.cocoon.sitemap.SitemapErrorHandler errorHandler)
setErrorHandler
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
errorHandler
- error handlerprotected boolean checkPipeline()
protected void setupPipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected void connect(org.apache.cocoon.environment.Environment environment, org.apache.cocoon.xml.XMLProducer producer, org.apache.cocoon.xml.XMLConsumer consumer) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected void connectPipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
public boolean process(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
Environment
, producing the output.
process
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
org.apache.cocoon.ProcessingException
protected void preparePipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
public void prepareInternal(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
prepareInternal
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
environment
- The current environment.
org.apache.cocoon.ProcessingException
protected void prepareInternalErrorHandler(org.apache.cocoon.environment.Environment environment, org.apache.cocoon.ProcessingException ex) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected boolean isInternalError()
protected boolean processXMLPipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected void setupReader(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected void setMimeTypeForReader(org.apache.cocoon.environment.Environment environment)
environment
- The current environmentprotected void setMimeTypeForSerializer(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
environment
- The current environment
org.apache.cocoon.ProcessingException
protected boolean checkIfModified(org.apache.cocoon.environment.Environment environment, long lastModified) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected boolean processReader(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
- ifpublic void recycle()
recycle
in interface Recyclable
Recyclable.recycle()
public boolean process(org.apache.cocoon.environment.Environment environment, org.apache.cocoon.xml.XMLConsumer consumer) throws org.apache.cocoon.ProcessingException
Environment
, but do not use the
serializer. Instead all SAX events are streamed to the XMLConsumer.
process
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
org.apache.cocoon.ProcessingException
protected boolean processErrorHandler(org.apache.cocoon.environment.Environment environment, org.apache.cocoon.ProcessingException e, org.apache.cocoon.xml.XMLConsumer consumer) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
public SourceValidity getValidityForEventPipeline()
null
getValidityForEventPipeline
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
public String getKeyForEventPipeline()
null
getKeyForEventPipeline
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
protected org.apache.cocoon.util.location.Location getLocation(Parameters param)
protected void handleException(Exception e) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ConnectionResetException
- if connection reset detected
org.apache.cocoon.ProcessingException
- in all other cases
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |