org.apache.cxf.jaxrs.client.cache
Class CacheControlClientReaderInterceptor

java.lang.Object
  extended by org.apache.cxf.jaxrs.client.cache.CacheControlClientReaderInterceptor
All Implemented Interfaces:
javax.ws.rs.ext.ReaderInterceptor

@Priority(value=4999)
public class CacheControlClientReaderInterceptor
extends Object
implements javax.ws.rs.ext.ReaderInterceptor


Constructor Summary
CacheControlClientReaderInterceptor()
           
CacheControlClientReaderInterceptor(javax.cache.Cache<Key,Entry> cache)
           
 
Method Summary
 Object aroundReadFrom(javax.ws.rs.ext.ReaderInterceptorContext context)
           
protected  boolean isCacheControlValid(javax.ws.rs.ext.ReaderInterceptorContext context, javax.ws.rs.core.CacheControl responseControl)
           
 boolean isCacheInputStream()
           
 CacheControlClientReaderInterceptor setCache(javax.cache.Cache<Key,Entry> c)
           
 void setCacheResponseInputStream(boolean cacheInputStream)
          Enforce the caching of the response stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheControlClientReaderInterceptor

public CacheControlClientReaderInterceptor(javax.cache.Cache<Key,Entry> cache)

CacheControlClientReaderInterceptor

public CacheControlClientReaderInterceptor()
Method Detail

setCache

public CacheControlClientReaderInterceptor setCache(javax.cache.Cache<Key,Entry> c)

aroundReadFrom

public Object aroundReadFrom(javax.ws.rs.ext.ReaderInterceptorContext context)
                      throws IOException,
                             javax.ws.rs.WebApplicationException
Specified by:
aroundReadFrom in interface javax.ws.rs.ext.ReaderInterceptor
Throws:
IOException
javax.ws.rs.WebApplicationException

isCacheInputStream

public boolean isCacheInputStream()

setCacheResponseInputStream

public void setCacheResponseInputStream(boolean cacheInputStream)
Enforce the caching of the response stream. This is not recommended if the client code expects Serializable data, example, String or custom JAXB beans marked as Serializable, which can be stored in the cache directly. Use this property only if returning a cached entity does require a repeated stream parsing.

Parameters:
cacheInputStream -

isCacheControlValid

protected boolean isCacheControlValid(javax.ws.rs.ext.ReaderInterceptorContext context,
                                      javax.ws.rs.core.CacheControl responseControl)


Apache CXF