|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.pipeline.VirtualProcessingPipeline
Pipeline used by virtual pipeline components
Field Summary | |
protected XMLConsumer |
firstConsumer
This is the first consumer component in the pipeline, either the first transformer or the serializer. |
protected Generator |
generator
|
protected Parameters |
generatorParam
|
protected String |
generatorSource
|
protected XMLConsumer |
lastConsumer
This is the last component in the pipeline, either the serializer or a custom xmlconsumer for the cocoon: protocol etc. |
protected ServiceManager |
manager
The component manager set with compose() |
protected ServiceManager |
newManager
The component manager set with compose() and recompose() |
protected Processor |
processor
The current Processor |
protected Serializer |
serializer
|
protected String |
serializerMimeType
|
protected Parameters |
serializerParam
|
protected String |
serializerSource
|
protected ArrayList |
transformerParams
|
protected ArrayList |
transformers
|
protected ArrayList |
transformerSources
|
Fields inherited from interface org.apache.cocoon.components.pipeline.ProcessingPipeline |
ROLE |
Constructor Summary | |
VirtualProcessingPipeline(Context context)
|
Method Summary | |
void |
addTransformer(String role,
String source,
Parameters param,
Parameters hintParam)
Add a transformer at the end of the pipeline. |
protected boolean |
checkPipeline()
Sanity check |
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)
|
String |
getMimeType()
Get the mime-type for the serializer |
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. |
XMLConsumer |
getXMLConsumer(Environment environment)
Get the first consumer - used for VPC serializers |
XMLConsumer |
getXMLConsumer(Environment environment,
XMLConsumer consumer)
Get the first consumer - used for VPC transformers |
void |
informBranchPoint()
Informs pipeline we have come across a branch point Default Behaviour is do nothing |
protected boolean |
isInternalError()
|
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 |
processXMLPipeline(Environment environment)
Process the SAX event pipeline |
void |
recycle()
|
void |
service(ServiceManager manager)
|
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. |
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(Environment environment)
Setup pipeline components. |
boolean |
shouldSetContentLength()
Test if the serializer wants to set the content length |
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 ArrayList transformers
protected ArrayList transformerParams
protected ArrayList transformerSources
protected Serializer serializer
protected Parameters serializerParam
protected String serializerSource
protected String serializerMimeType
protected XMLConsumer firstConsumer
protected XMLConsumer lastConsumer
protected ServiceManager manager
protected ServiceManager newManager
protected Processor processor
Constructor Detail |
public VirtualProcessingPipeline(Context context) throws Exception
Method Detail |
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void setProcessorManager(ServiceManager manager)
setProcessorManager
in interface ProcessingPipeline
manager
- the processor's service manager.public void setup(Parameters params)
setup
in interface ProcessingPipeline
public Generator getGenerator()
getGenerator
in interface ProcessingPipeline
public void informBranchPoint()
informBranchPoint
in interface ProcessingPipeline
public void setGenerator(String role, String source, Parameters param, Parameters hintParam) throws ProcessingException
Generator
is fetched
from the latest ServiceManager
.
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 ServiceManager
.
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 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
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()
public void setReader(String role, String source, Parameters param, String mimeType) throws ProcessingException
ProcessingPipeline
setReader
in interface ProcessingPipeline
mimeType
- Can be null
ProcessingException
public boolean process(Environment environment) throws ProcessingException
ProcessingPipeline
Environment
, producing the output.
process
in interface ProcessingPipeline
ProcessingException
public boolean process(Environment environment, XMLConsumer consumer) throws ProcessingException
Environment
, but do not use the
serializer. Instead the sax events are streamed to the XMLConsumer.
process
in interface ProcessingPipeline
ProcessingException
public XMLConsumer getXMLConsumer(Environment environment, XMLConsumer consumer) throws ProcessingException
ProcessingException
public XMLConsumer getXMLConsumer(Environment environment) throws ProcessingException
ProcessingException
public String getMimeType()
public boolean shouldSetContentLength()
protected boolean processXMLPipeline(Environment environment) throws ProcessingException
ProcessingException
public void recycle()
recycle
in interface Recyclable
protected boolean processErrorHandler(Environment environment, ProcessingException e, XMLConsumer consumer) throws ProcessingException
ProcessingException
public SourceValidity getValidityForEventPipeline()
null
getValidityForEventPipeline
in interface ProcessingPipeline
public String getKeyForEventPipeline()
ProcessingPipeline
null
getKeyForEventPipeline
in interface ProcessingPipeline
protected Location getLocation(Parameters param)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |