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

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.pipeline.AbstractProcessingPipeline
          extended by org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline
              extended by org.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessingPipeline
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, Composable, Recomposable, LogEnabled, Parameterizable, ProcessingPipeline

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:
CVS $Id: ExpiresCachingProcessingPipeline.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler

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  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, 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
ExpiresCachingProcessingPipeline()
           
 
Method Summary
protected  void connectPipeline(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(Environment environment)
          Prepare the pipeline
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 setupPipeline(Environment environment)
          Setup pipeline components.
 
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, compose, connect, getGenerator, getLocation, handleException, informBranchPoint, isInternalError, prepareInternal, prepareInternalErrorHandler, process, process, processErrorHandler, recompose, release, setErrorHandler, setGenerator, setMimeTypeForReader, setMimeTypeForSerializer, setReader, setSerializer, 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

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 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(Environment environment)
                              throws ProcessingException
Process the given Environment, producing the output.

Overrides:
processXMLPipeline in class AbstractProcessingPipeline
Throws:
ProcessingException

connectPipeline

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

Overrides:
connectPipeline in class AbstractProcessingPipeline
Throws:
ProcessingException

preparePipeline

protected void preparePipeline(Environment environment)
                        throws ProcessingException
Prepare the pipeline

Overrides:
preparePipeline in class AbstractProcessingPipeline
Throws:
ProcessingException

setupPipeline

protected void setupPipeline(Environment environment)
                      throws ProcessingException
Description copied from class: AbstractProcessingPipeline
Setup pipeline components.

Overrides:
setupPipeline in class AbstractProcessingPipeline
Throws:
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 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 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(Environment environment)
                         throws ProcessingException
Description copied from class: AbstractProcessingPipeline
Process the pipeline using a reader.

Overrides:
processReader in class AbstractProcessingPipeline
Throws:
ProcessingException - if


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