|
||||||||||
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 org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline org.apache.cocoon.components.pipeline.impl.CachingPointProcessingPipeline
public class CachingPointProcessingPipeline
The caching-point pipeline implements an extended caching algorithm which is of particular benefit for use with those pipelines that utilise cocoon-views and/or provide drill-down functionality.
Field Summary | |
---|---|
protected boolean |
autoCachingPoint
|
protected String |
autoCachingPointSwitch
|
protected ArrayList |
isCachePoint
|
protected boolean |
nextIsCachePoint
|
protected ArrayList |
xmlSerializerArray
|
Fields inherited from class org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline |
---|
cacheCompleteResponse, cachedResponse, completeResponseIsCached, firstNotCacheableTransformerIndex, firstProcessedTransformerIndex, fromCacheKey, generatorIsCacheableProcessingComponent, generatorRole, lockTimeout, PIPELOCK_PREFIX, readerRole, serializerIsCacheableProcessingComponent, serializerRole, toCacheKey, toCacheSourceValidities, transformerIsCacheableProcessingComponent, transformerRoles, transientStore |
Fields inherited from class org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline |
---|
cache, xmlDeserializer, xmlSerializer |
Fields inherited from class org.apache.cocoon.components.pipeline.AbstractProcessingPipeline |
---|
configuration, configuredExpires, configuredOutputBufferSize, expires, generator, generatorParam, generatorSelector, generatorSource, lastConsumer, manager, newManager, outputBufferSize, parameters, reader, readerMimeType, readerParam, readerSelector, readerSource, serializer, serializerMimeType, serializerParam, serializerSelector, serializerSource, sitemapReaderMimeType, sitemapSerializerMimeType, transformerParams, transformers, transformerSelectors, transformerSources |
Fields inherited from interface org.apache.cocoon.components.pipeline.ProcessingPipeline |
---|
ROLE |
Constructor Summary | |
---|---|
CachingPointProcessingPipeline()
|
Method Summary | |
---|---|
void |
addTransformer(String role,
String source,
Parameters param,
Parameters hintParam)
Add a transformer. |
protected void |
cacheResults(Environment environment,
OutputStream os)
Cache longest cacheable path plus cache points. |
protected void |
connectCachingPipeline(Environment environment)
Connect the caching point pipeline. |
void |
informBranchPoint()
Determine if the given branch-point is a caching-point. |
protected ComponentCacheKey |
newComponentCacheKey(int type,
String role,
Serializable key)
Create a new ComponentCachekey ComponentCacheKeys can be flagged as cachepoints |
void |
parameterize(Parameters config)
The CachingPointProcessingPipeline is configurable. |
void |
recycle()
Recyclable Interface |
void |
setGenerator(String role,
String source,
Parameters param,
Parameters hintParam)
Set the generator. |
Methods inherited from class org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline |
---|
connectPipeline, generateCachingKey, generateLock, getKeyForEventPipeline, getValidityForEventPipeline, processReader, processXMLPipeline, releaseLock, setReader, setSerializer, setupPipeline, setupValidities, validatePipeline, waitForLock |
Methods inherited from class org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline |
---|
dispose |
Methods inherited from class org.apache.cocoon.components.pipeline.AbstractProcessingPipeline |
---|
checkIfModified, checkPipeline, compose, connect, getGenerator, getLocation, handleException, isInternalError, prepareInternal, prepareInternalErrorHandler, preparePipeline, process, process, processErrorHandler, recompose, release, setErrorHandler, setMimeTypeForReader, setMimeTypeForSerializer, setup, setupReader |
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 ArrayList isCachePoint
protected ArrayList xmlSerializerArray
protected boolean nextIsCachePoint
protected String autoCachingPointSwitch
protected boolean autoCachingPoint
Constructor Detail |
---|
public CachingPointProcessingPipeline()
Method Detail |
---|
public void parameterize(Parameters config) throws ParameterException
CachingPointProcessingPipeline
is configurable.
The autoCachingPoint algorithm (if enabled) will automatically cache common elements of the pipeline currently being processed - as well as the entire cacheable pipeline according to the "longest cacheable key" algorithm. This feature is especially useful for pipelines that branch at some point (this is the case with <map:select> or <map:act>).
The option autoCachingPoint can be switched on/off in the sitemap.xmap (on by default). For linear pipelines, one can switch "Off" autoCachingPoint and use attribute pipeline-hints="caching-point" to manually indicate that certain pipeline components (eg on <map:generator>) should be considered as cache points. Both options (automatic at branch points and manual with pipeline hints) can coexist in the same pipeline.
Works by requesting the pipeline processor to try shorter keys when looking for a cached content for the pipeline.
parameterize
in interface Parameterizable
parameterize
in class AbstractCachingProcessingPipeline
ParameterException
public void setGenerator(String role, String source, Parameters param, Parameters hintParam) throws ProcessingException
setGenerator
in interface ProcessingPipeline
setGenerator
in class AbstractCachingProcessingPipeline
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
addTransformer
in interface ProcessingPipeline
addTransformer
in class AbstractCachingProcessingPipeline
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 informBranchPoint()
informBranchPoint
in interface ProcessingPipeline
informBranchPoint
in class AbstractProcessingPipeline
SimpleParentProcessingNode
protected void cacheResults(Environment environment, OutputStream os) throws Exception
cacheResults
in class AbstractCachingProcessingPipeline
Exception
protected ComponentCacheKey newComponentCacheKey(int type, String role, Serializable key)
newComponentCacheKey
in class AbstractCachingProcessingPipeline
protected void connectCachingPipeline(Environment environment) throws ProcessingException
connectCachingPipeline
in class AbstractCachingProcessingPipeline
ProcessingException
public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractCachingProcessingPipeline
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |