org.apache.cocoon.components.pipeline.impl
Class ExpiresCachingProcessingPipeline

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.pipeline.AbstractProcessingPipeline
          extended byorg.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline
              extended byorg.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessingPipeline
All Implemented Interfaces:
Disposable, Parameterizable, Poolable, org.apache.cocoon.components.pipeline.ProcessingPipeline, Recyclable, Serviceable

public class ExpiresCachingProcessingPipeline
extends BaseCachingProcessingPipeline

This pipeline implementation caches the complete content for a defined period of time (expires). The cache-expires parameter controls the period of time for caching the content. A positive value is a value in seconds, a value of zero means no caching and a negative value means indefinite caching. In this case, you should use an external mechanism to invalidate the cache entry.

Since:
2.1
Version:
$Id: ExpiresCachingProcessingPipeline.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
static String CACHE_EXPIRES_KEY
          This key can be used to put an expires information in the object model
static String CACHE_KEY_KEY
          This key can be used to put a key in the object model
protected  org.apache.cocoon.caching.CachedResponse cachedResponse
          The cached response
protected  long cacheExpires
          The expires information.
protected  IdentifierCacheKey cacheKey
          The key used for caching
protected  SourceValidity cacheValidity
          The source validity
protected  long defaultCacheExpires
          Default value for expiration
 
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
ExpiresCachingProcessingPipeline()
           
 
Method Summary
protected  void connectPipeline(org.apache.cocoon.environment.Environment environment)
          Connect the XML pipeline.
 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 If the "event pipeline" (= the complete pipeline without the serializer) is cacheable and valid, return all validity objects.
 void parameterize(Parameters params)
          Parameterizable Interface - Configuration
protected  void preparePipeline(org.apache.cocoon.environment.Environment environment)
          Prepare the pipeline
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
 
Methods inherited from class org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline
dispose
 
Methods inherited from class org.apache.cocoon.components.pipeline.AbstractProcessingPipeline
addTransformer, checkIfModified, checkPipeline, connect, getGenerator, getLocation, handleException, informBranchPoint, isInternalError, prepareInternal, prepareInternalErrorHandler, process, process, processErrorHandler, service, setErrorHandler, setGenerator, setMimeTypeForReader, setMimeTypeForSerializer, setProcessorManager, setReader, setSerializer, setup, setupPipeline, 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

CACHE_KEY_KEY

public static final String CACHE_KEY_KEY
This key can be used to put a key in the object model


CACHE_EXPIRES_KEY

public static final String CACHE_EXPIRES_KEY
This key can be used to put an expires information in the object model


cacheValidity

protected SourceValidity cacheValidity
The source validity


cacheKey

protected IdentifierCacheKey cacheKey
The key used for caching


cacheExpires

protected long cacheExpires
The expires information.


defaultCacheExpires

protected long defaultCacheExpires
Default value for expiration


cachedResponse

protected org.apache.cocoon.caching.CachedResponse cachedResponse
The cached response

Constructor Detail

ExpiresCachingProcessingPipeline

public ExpiresCachingProcessingPipeline()
Method Detail

parameterize

public void parameterize(Parameters params)
                  throws ParameterException
Description copied from class: BaseCachingProcessingPipeline
Parameterizable Interface - Configuration

Specified by:
parameterize in interface Parameterizable
Overrides:
parameterize in class BaseCachingProcessingPipeline
Throws:
ParameterException

processXMLPipeline

protected boolean processXMLPipeline(org.apache.cocoon.environment.Environment environment)
                              throws org.apache.cocoon.ProcessingException
Process the given Environment, producing the output.

Overrides:
processXMLPipeline in class AbstractProcessingPipeline
Throws:
org.apache.cocoon.ProcessingException

connectPipeline

protected void connectPipeline(org.apache.cocoon.environment.Environment environment)
                        throws org.apache.cocoon.ProcessingException
Connect the XML pipeline.

Overrides:
connectPipeline in class AbstractProcessingPipeline
Throws:
org.apache.cocoon.ProcessingException

preparePipeline

protected void preparePipeline(org.apache.cocoon.environment.Environment environment)
                        throws org.apache.cocoon.ProcessingException
Prepare the pipeline

Overrides:
preparePipeline in class AbstractProcessingPipeline
Throws:
org.apache.cocoon.ProcessingException

getValidityForEventPipeline

public 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. Otherwise return null

Specified by:
getValidityForEventPipeline in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
Overrides:
getValidityForEventPipeline in class AbstractProcessingPipeline

getKeyForEventPipeline

public String getKeyForEventPipeline()
Description copied from class: AbstractProcessingPipeline
Return the key for the event pipeline If the "event pipeline" (= the complete pipeline without the serializer) is cacheable and valid, return a key. Otherwise return null

Specified by:
getKeyForEventPipeline in interface org.apache.cocoon.components.pipeline.ProcessingPipeline
Overrides:
getKeyForEventPipeline in class AbstractProcessingPipeline

recycle

public void recycle()
Recyclable Interface

Specified by:
recycle in interface Recyclable
Overrides:
recycle in class BaseCachingProcessingPipeline

processReader

protected boolean processReader(org.apache.cocoon.environment.Environment environment)
                         throws org.apache.cocoon.ProcessingException
Description copied from class: AbstractProcessingPipeline
Process the pipeline using a reader.

Overrides:
processReader in class AbstractProcessingPipeline
Throws:
org.apache.cocoon.ProcessingException - if


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