org.apache.cocoon.pipeline
Class CachingPipeline

java.lang.Object
  extended by org.apache.cocoon.pipeline.AbstractPipeline
      extended by org.apache.cocoon.pipeline.CachingPipeline
All Implemented Interfaces:
Pipeline
Direct Known Subclasses:
AsyncCachePipeline

public class CachingPipeline
extends AbstractPipeline

A Pipeline implementation that returns a cached result if, and only if all its components support caching. A PipelineComponent is cacheable if it implements the interface CachingPipelineComponent.


Field Summary
protected  CacheKey cacheKey
           
protected  CachingOutputStream cachingOutputStream
           
protected  PipelineCache pipelineCache
           
 
Constructor Summary
CachingPipeline()
           
 
Method Summary
 CacheKey constructCacheKey()
           
 void execute()
          After the pipeline has been setup (Pipeline.setup(OutputStream, Map), this method can be invoked in order to produce the result.
protected  CacheValue getCachedValue(CacheKey cacheKey)
           
 long getLastModified()
          Get the time of the last modification.
protected  void setCachedValue(CacheKey cacheKey, CacheValue cacheValue)
           
 void setPipelineCache(PipelineCache pipelineCache)
           
 void setup(OutputStream outputStream)
          After the pipeline has been prepared (Pipeline.addComponent(PipelineComponent), this method can be invoked in order to setup and initialize the pipeline and its components.
 void setup(OutputStream outputStream, Map<String,Object> parameters)
          The same as Pipeline.setup(OutputStream) but also allows passing parameters to the pipeline components.
 
Methods inherited from class org.apache.cocoon.pipeline.AbstractPipeline
addComponent, getComponents, getContentType, getFinisher, invokeStarter, setupComponents, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pipelineCache

protected PipelineCache pipelineCache

cacheKey

protected CacheKey cacheKey

cachingOutputStream

protected CachingOutputStream cachingOutputStream
Constructor Detail

CachingPipeline

public CachingPipeline()
Method Detail

setup

public void setup(OutputStream outputStream)
Description copied from class: AbstractPipeline
After the pipeline has been prepared (Pipeline.addComponent(PipelineComponent), this method can be invoked in order to setup and initialize the pipeline and its components.

Specified by:
setup in interface Pipeline
Overrides:
setup in class AbstractPipeline
Parameters:
outputStream - An OutputStream where the pipeline execution result is written.
See Also:
Pipeline.setup(java.io.OutputStream, java.util.Map)

setup

public void setup(OutputStream outputStream,
                  Map<String,Object> parameters)
Description copied from class: AbstractPipeline
The same as Pipeline.setup(OutputStream) but also allows passing parameters to the pipeline components.

Specified by:
setup in interface Pipeline
Overrides:
setup in class AbstractPipeline
Parameters:
outputStream - An OutputStream where the pipeline execution result is written.
parameters - A Map of parameters that are available to all PipelineComponents.
See Also:
Pipeline.setup(java.io.OutputStream, java.util.Map)

execute

public void execute()
             throws Exception
Description copied from class: AbstractPipeline
After the pipeline has been setup (Pipeline.setup(OutputStream, Map), this method can be invoked in order to produce the result.

Specified by:
execute in interface Pipeline
Overrides:
execute in class AbstractPipeline
Throws:
Exception - Any problem that might occur while processing the pipeline.
See Also:
Pipeline.execute()

setPipelineCache

public void setPipelineCache(PipelineCache pipelineCache)

getLastModified

public long getLastModified()
Description copied from interface: Pipeline
Get the time of the last modification.

Specified by:
getLastModified in interface Pipeline
Overrides:
getLastModified in class AbstractPipeline
Returns:
The last modification date

constructCacheKey

public CacheKey constructCacheKey()

getCachedValue

protected CacheValue getCachedValue(CacheKey cacheKey)

setCachedValue

protected void setCachedValue(CacheKey cacheKey,
                              CacheValue cacheValue)


Copyright © 2008 The Apache Software Foundation. All Rights Reserved.