public class ProxyCacheFilterChain extends AbstractCacheFilterChain implements CacheListener, CauchoFilterChain
| Constructor and Description |
|---|
ProxyCacheFilterChain(FilterChain next,
WebApp webApp)
Create the filter chain servlet.
|
ProxyCacheFilterChain(ProxyCache cache,
FilterChain next,
WebApp webApp)
Create the filter chain servlet.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache() |
void |
clearExpires()
Clears the expires timers
|
void |
doFilter(ServletRequest request,
ServletResponse response)
Handles caching for the filter.
|
boolean |
equals(java.lang.Object o) |
ProxyCacheEntry |
fillEntry(CauchoRequest req,
CauchoResponse res,
java.util.ArrayList<java.lang.String> keys,
java.util.ArrayList<java.lang.String> values,
java.lang.String contentType,
java.lang.String charEncoding,
long contentLength) |
boolean |
fillFromCache(CauchoRequest req,
CauchoResponse response,
AbstractCacheEntry abstractEntry)
fillFromCache is called when the client needs the entire result, and
the result is already in the cache.
|
void |
finishCaching(CauchoResponse res)
Update the headers when the caching has finished.
|
long |
getHitCount() |
FilterChain |
getNext() |
java.lang.String |
getUri() |
WebApp |
getWebApp() |
int |
hashCode() |
void |
killCaching(CauchoResponse res)
Update the headers when the caching has finished.
|
void |
removeEvent()
Callback when the item has been removed from the cache, usually
because of an LRU event.
|
AbstractCacheEntry |
startCaching(CauchoRequest req,
CauchoResponse res,
java.util.ArrayList<java.lang.String> keys,
java.util.ArrayList<java.lang.String> values,
java.lang.String contentType,
java.lang.String charEncoding,
long contentLength)
Starts the caching after the headers have been sent.
|
java.lang.String |
toString() |
public ProxyCacheFilterChain(FilterChain next, WebApp webApp)
public ProxyCacheFilterChain(ProxyCache cache, FilterChain next, WebApp webApp)
public long getHitCount()
public WebApp getWebApp()
public java.lang.String getUri()
public FilterChain getNext()
getNext in interface CauchoFilterChainpublic void clearExpires()
public void doFilter(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
doFilter in interface FilterChainreq - the servlet requestres - the servlet responseServletExceptionjava.io.IOExceptionpublic boolean fillFromCache(CauchoRequest req, CauchoResponse response, AbstractCacheEntry abstractEntry) throws java.io.IOException
fillFromCache in class AbstractCacheFilterChainreq - the servlet request trying to get data from the cacheresponse - the servlet response which will receive dataentry - the cache entry to useisSyntheticHeader - if false, the not-modified should be sent to the browserjava.io.IOExceptionpublic AbstractCacheEntry startCaching(CauchoRequest req, CauchoResponse res, java.util.ArrayList<java.lang.String> keys, java.util.ArrayList<java.lang.String> values, java.lang.String contentType, java.lang.String charEncoding, long contentLength)
startCaching in class AbstractCacheFilterChainreq - the servlet requestreq - the servlet responsekeys - the saved header keysvalues - the saved header valuescontentType - the response content typecharEncoding - the response character encodingpublic ProxyCacheEntry fillEntry(CauchoRequest req, CauchoResponse res, java.util.ArrayList<java.lang.String> keys, java.util.ArrayList<java.lang.String> values, java.lang.String contentType, java.lang.String charEncoding, long contentLength)
public void clearCache()
public void finishCaching(CauchoResponse res)
finishCaching in class AbstractCacheFilterChainokay - if true, the cache if validpublic void killCaching(CauchoResponse res)
killCaching in class AbstractCacheFilterChainokay - if true, the cache if validpublic void removeEvent()
removeEvent in interface CacheListenerpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object