org.apache.cocoon.pipeline
Class AsyncCachePipeline<T extends PipelineComponent>
java.lang.Object
org.apache.cocoon.pipeline.AbstractPipeline<T>
org.apache.cocoon.pipeline.CachingPipeline<T>
org.apache.cocoon.pipeline.AsyncCachePipeline<T>
- All Implemented Interfaces:
- CacheRefreshJob, Pipeline<T>
public class AsyncCachePipeline<T extends PipelineComponent>
- extends CachingPipeline<T>
- implements CacheRefreshJob
This Pipeline
basically works like the CachingPipeline
. The only difference is that when the cached
result isn't valid anymore, the refresh is done in a separate thread. This means that the re-production of the result
doesn't block the initial request. The disadvantage of this approach is that until the result is being reproduced, an
out-dated result is returned. If this is out of question for a use case, the CachingPipeline
has to be used.
Methods inherited from class org.apache.cocoon.pipeline.CachingPipeline |
constructCacheKey, getCachedValue, getCacheKey, getExpires, getLastModified, isCacheKeyValid, setCache, setCachedValue, setConfiguration, setExpires, setExpiresCacheKey, setup |
AsyncCachePipeline
public AsyncCachePipeline()
execute
public void execute()
throws Exception
- After the pipeline has been setup (
Pipeline.setup(OutputStream, Map)
,
this method can be invoked in order to produce the result.
- Specified by:
execute
in interface Pipeline<T extends PipelineComponent>
- Overrides:
execute
in class CachingPipeline<T extends PipelineComponent>
- Throws:
Exception
- Any problem that might occur while processing the
pipeline.- See Also:
CachingPipeline.execute()
getCacheRefreshManager
public CacheRefreshManager getCacheRefreshManager()
refresh
public void refresh(CacheKey cacheKey)
-
- Specified by:
refresh
in interface CacheRefreshJob
- See Also:
CacheRefreshJob.refresh(org.apache.cocoon.pipeline.caching.CacheKey)
setCacheRefreshManager
public void setCacheRefreshManager(CacheRefreshManager cacheRefreshManager)
Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.