public class CacheInterceptor extends Object implements ClientRequestFilter, ClientResponseFilter
Modifier and Type | Field and Description |
---|---|
protected BrowserCache |
cache |
Constructor and Description |
---|
CacheInterceptor(BrowserCache cache) |
Modifier and Type | Method and Description |
---|---|
void |
cacheIfPossible(ClientRequestContext request,
ClientResponseContext response) |
void |
filter(ClientRequestContext request)
Filter method called before a request has been dispatched to a client
transport layer.
|
void |
filter(ClientRequestContext request,
ClientResponseContext response)
Filter method called after a response has been provided for a request
(either by a
request filter or when the
HTTP invocation returns. |
protected BrowserCache.Entry |
getEntry(ClientRequestContext request) |
void |
updateOnNotModified(ClientRequestContext request,
BrowserCache.Entry old,
ClientResponseContext response) |
protected BrowserCache cache
public CacheInterceptor(BrowserCache cache)
public void filter(ClientRequestContext request) throws IOException
ClientRequestFilter
Priority
).filter
in interface ClientRequestFilter
request
- request context.IOException
- if an I/O exception occurs.public void filter(ClientRequestContext request, ClientResponseContext response) throws IOException
ClientResponseFilter
request filter
or when the
HTTP invocation returns.
Filters in the filter chain are ordered according to their priority
(see Priority
).filter
in interface ClientResponseFilter
request
- request context.response
- response context.IOException
- if an I/O exception occurs.public void updateOnNotModified(ClientRequestContext request, BrowserCache.Entry old, ClientResponseContext response)
public void cacheIfPossible(ClientRequestContext request, ClientResponseContext response) throws IOException
IOException
protected BrowserCache.Entry getEntry(ClientRequestContext request) throws Exception
Exception
Copyright © 2017 JBoss by Red Hat. All rights reserved.