|
|||||||||||
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 org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline org.apache.cocoon.components.pipeline.impl.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 org.apache.cocoon.caching.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 String |
generatorRole
The role name of the generator |
static String |
PIPELOCK_PREFIX
|
protected String |
readerRole
The role name of the reader |
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 List |
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, generatorSource, lastConsumer, manager, newManager, outputBufferSize, parameters, reader, readerMimeType, readerParam, readerSource, serializer, serializerMimeType, serializerParam, serializerSource, sourceResolver, transformerParams, transformers, 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 org.apache.cocoon.caching.CachedResponse |
cacheResults(org.apache.cocoon.environment.Environment environment,
OutputStream os)
Abstract method defined in subclasses |
protected abstract void |
connectCachingPipeline(org.apache.cocoon.environment.Environment environment)
Abstract method defined in subclasses |
protected void |
connectPipeline(org.apache.cocoon.environment.Environment environment)
Connect the pipeline. |
protected void |
generateCachingKey(org.apache.cocoon.environment.Environment environment)
The components of the pipeline are checked if they are Cacheable. |
protected void |
generateLock(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(org.apache.cocoon.environment.Environment environment)
Process the pipeline using a reader. |
protected boolean |
processXMLPipeline(org.apache.cocoon.environment.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(org.apache.cocoon.environment.Environment environment)
Setup the evenet pipeline. |
protected void |
setupValidities()
Generate validity objects for the new response |
protected void |
validatePipeline(org.apache.cocoon.environment.Environment environment)
Calculate the key that can be used to get something from the cache, and handle expires properly. |
protected boolean |
waitForLock(Object key)
Look up the lock object by key, and if present, wait till notified. |
Methods inherited from class org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline |
dispose |
Methods inherited from class org.apache.cocoon.components.pipeline.AbstractProcessingPipeline |
checkIfModified, checkPipeline, connect, getGenerator, getLocation, handleException, informBranchPoint, isInternalError, prepareInternal, prepareInternalErrorHandler, preparePipeline, process, process, processErrorHandler, service, setErrorHandler, setMimeTypeForReader, setMimeTypeForSerializer, setProcessorManager, setup, setupReader |
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 |
public static final String PIPELOCK_PREFIX
protected String generatorRole
protected List transformerRoles
protected String serializerRole
protected String readerRole
protected org.apache.cocoon.caching.CachedResponse cachedResponse
protected int firstProcessedTransformerIndex
protected boolean completeResponseIsCached
protected PipelineCacheKey fromCacheKey
protected PipelineCacheKey toCacheKey
protected SourceValidity[] toCacheSourceValidities
protected int firstNotCacheableTransformerIndex
protected boolean cacheCompleteResponse
protected Store transientStore
Constructor Detail |
public AbstractCachingProcessingPipeline()
Method Detail |
protected abstract org.apache.cocoon.caching.CachedResponse cacheResults(org.apache.cocoon.environment.Environment environment, OutputStream os) throws Exception
null
Exception
protected abstract ComponentCacheKey newComponentCacheKey(int type, String role, Serializable key)
protected abstract void connectCachingPipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.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 org.apache.cocoon.ProcessingException
setGenerator
in interface org.apache.cocoon.components.pipeline.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.
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
addTransformer
in interface org.apache.cocoon.components.pipeline.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.
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
setSerializer
in class AbstractProcessingPipeline
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
setReader
in class AbstractProcessingPipeline
mimeType
- Can be null
org.apache.cocoon.ProcessingException
protected boolean waitForLock(Object key)
protected void generateLock(Object key)
protected void releaseLock(Object key)
protected boolean processXMLPipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
Environment
, producing the output.
processXMLPipeline
in class AbstractProcessingPipeline
org.apache.cocoon.ProcessingException
protected void generateCachingKey(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected void setupValidities() throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected void validatePipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
protected void setupPipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
setupPipeline
in class AbstractProcessingPipeline
org.apache.cocoon.ProcessingException
protected void connectPipeline(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
connectPipeline
in class AbstractProcessingPipeline
org.apache.cocoon.ProcessingException
protected boolean processReader(org.apache.cocoon.environment.Environment environment) throws org.apache.cocoon.ProcessingException
processReader
in class AbstractProcessingPipeline
org.apache.cocoon.ProcessingException
- if an error occurspublic SourceValidity getValidityForEventPipeline()
null
.
getValidityForEventPipeline
in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
getValidityForEventPipeline
in class AbstractProcessingPipeline
public String getKeyForEventPipeline()
AbstractProcessingPipeline
null
getKeyForEventPipeline
in interface org.apache.cocoon.components.pipeline.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 |