|
||||||||||
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
public abstract class AbstractCachingProcessingPipeline
This is the base class for all caching pipeline implementations that check different pipeline components.
Field Summary | |
---|---|
protected boolean |
cacheCompleteResponse
Cache complete response |
protected CachedResponse |
cachedResponse
The cached response |
protected boolean |
completeResponseIsCached
Complete response is cached |
protected int |
firstNotCacheableTransformerIndex
The index indicating to the first transformer which is not cacheable |
protected int |
firstProcessedTransformerIndex
The index indicating the first transformer getting input from the cache |
protected PipelineCacheKey |
fromCacheKey
This key indicates the response that is fetched from the cache |
protected boolean |
generatorIsCacheableProcessingComponent
|
protected String |
generatorRole
The role name of the generator |
protected long |
lockTimeout
Maximum wait time on a pipeline lock |
static String |
PIPELOCK_PREFIX
|
protected String |
readerRole
The role name of the reader |
protected boolean |
serializerIsCacheableProcessingComponent
|
protected String |
serializerRole
The role name of the serializer |
protected PipelineCacheKey |
toCacheKey
This key indicates the response that will get into the cache |
protected SourceValidity[] |
toCacheSourceValidities
The source validities used for caching |
protected boolean[] |
transformerIsCacheableProcessingComponent
|
protected ArrayList |
transformerRoles
The role names of the transfomrers |
protected Store |
transientStore
Store for pipeline locks (optional) |
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 | |
---|---|
AbstractCachingProcessingPipeline()
|
Method Summary | |
---|---|
void |
addTransformer(String role,
String source,
Parameters param,
Parameters hintParam)
Add a transformer. |
protected abstract void |
cacheResults(Environment environment,
OutputStream os)
Abstract method defined in subclasses |
protected abstract void |
connectCachingPipeline(Environment environment)
Abstract method defined in subclasses |
protected void |
connectPipeline(Environment environment)
Connect the pipeline. |
protected void |
generateCachingKey(Environment environment)
The components of the pipeline are checked if they are Cacheable. |
protected void |
generateLock(Environment env,
Object key)
makes the lock (instantiates a new object and puts it into the store) |
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. |
SourceValidity |
getValidityForEventPipeline()
Return valid validity objects for the event pipeline. |
protected abstract ComponentCacheKey |
newComponentCacheKey(int type,
String role,
Serializable key)
Abstract method defined in subclasses |
void |
parameterize(Parameters params)
Parameterizable Interface - Configuration |
protected boolean |
processReader(Environment environment)
Process the pipeline using a reader. |
protected boolean |
processXMLPipeline(Environment environment)
Process the given Environment , producing the output. |
void |
recycle()
Recyclable Interface |
protected void |
releaseLock(Object key)
releases the lock (notifies it and removes it from the store) |
void |
setGenerator(String role,
String source,
Parameters param,
Parameters hintParam)
Set the generator. |
void |
setReader(String role,
String source,
Parameters param,
String mimeType)
Set the Reader. |
void |
setSerializer(String role,
String source,
Parameters param,
Parameters hintParam,
String mimeType)
Set the serializer. |
protected void |
setupPipeline(Environment environment)
Setup the evenet pipeline. |
protected void |
setupValidities()
Generate validity objects for the new response |
protected void |
validatePipeline(Environment environment)
Calculate the key that can be used to get something from the cache, and handle expires properly. |
protected boolean |
waitForLock(Environment env,
Object key)
|
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, informBranchPoint, 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 |
---|
public static final String PIPELOCK_PREFIX
protected String generatorRole
protected ArrayList transformerRoles
protected String serializerRole
protected String readerRole
protected CachedResponse cachedResponse
protected int firstProcessedTransformerIndex
protected boolean completeResponseIsCached
protected PipelineCacheKey fromCacheKey
protected PipelineCacheKey toCacheKey
protected SourceValidity[] toCacheSourceValidities
protected int firstNotCacheableTransformerIndex
protected boolean cacheCompleteResponse
protected boolean generatorIsCacheableProcessingComponent
protected boolean serializerIsCacheableProcessingComponent
protected boolean[] transformerIsCacheableProcessingComponent
protected Store transientStore
protected long lockTimeout
Constructor Detail |
---|
public AbstractCachingProcessingPipeline()
Method Detail |
---|
protected abstract void cacheResults(Environment environment, OutputStream os) throws Exception
Exception
protected abstract ComponentCacheKey newComponentCacheKey(int type, String role, Serializable key)
protected abstract void connectCachingPipeline(Environment environment) throws ProcessingException
ProcessingException
public void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
parameterize
in class BaseCachingProcessingPipeline
ParameterException
public void setGenerator(String role, String source, Parameters param, Parameters hintParam) throws ProcessingException
setGenerator
in interface ProcessingPipeline
setGenerator
in class AbstractProcessingPipeline
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 AbstractProcessingPipeline
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
setSerializer
in class AbstractProcessingPipeline
mimeType
- Can be null
ProcessingException
public void setReader(String role, String source, Parameters param, String mimeType) throws ProcessingException
setReader
in interface ProcessingPipeline
setReader
in class AbstractProcessingPipeline
mimeType
- Can be null
ProcessingException
protected boolean waitForLock(Environment env, Object key)
protected void generateLock(Environment env, Object key)
protected void releaseLock(Object key)
protected boolean processXMLPipeline(Environment environment) throws ProcessingException
Environment
, producing the output.
processXMLPipeline
in class AbstractProcessingPipeline
ProcessingException
protected void generateCachingKey(Environment environment) throws ProcessingException
ProcessingException
protected void setupValidities() throws ProcessingException
ProcessingException
protected void validatePipeline(Environment environment) throws ProcessingException
ProcessingException
protected void setupPipeline(Environment environment) throws ProcessingException
setupPipeline
in class AbstractProcessingPipeline
ProcessingException
protected void connectPipeline(Environment environment) throws ProcessingException
connectPipeline
in class AbstractProcessingPipeline
ProcessingException
protected boolean processReader(Environment environment) throws ProcessingException
processReader
in class AbstractProcessingPipeline
ProcessingException
- if an error occurspublic SourceValidity getValidityForEventPipeline()
null
.
getValidityForEventPipeline
in interface ProcessingPipeline
getValidityForEventPipeline
in class AbstractProcessingPipeline
public String getKeyForEventPipeline()
AbstractProcessingPipeline
null
getKeyForEventPipeline
in interface ProcessingPipeline
getKeyForEventPipeline
in class AbstractProcessingPipeline
public void recycle()
recycle
in interface Recyclable
recycle
in class BaseCachingProcessingPipeline
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |