org.apache.cocoon.pipeline
Class AsyncCachePipeline
java.lang.Object
org.apache.cocoon.pipeline.AbstractPipeline
org.apache.cocoon.pipeline.CachingPipeline
org.apache.cocoon.pipeline.AsyncCachePipeline
- All Implemented Interfaces:
- CacheRefreshJob, Pipeline
public class AsyncCachePipeline
- extends CachingPipeline
- implements CacheRefreshJob
This Pipeline
basically works like the CachingPipeline
. The only difference is that when the 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 being returned. If this is out of question for a use case, the
CachingPipeline
has to be used.
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
- Overrides:
execute
in class CachingPipeline
- 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 The Apache Software Foundation. All Rights Reserved.