|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CachingFilter
Defines methods common to all caching HTTP filters.
Method Summary | |
---|---|
String |
calculateKey(javax.servlet.http.HttpServletRequest req)
CachingFilter works off a key. |
CacheManager |
getCacheManager()
Returns the CacheManager for this caching filter. |
String |
getDefaultCacheName()
Returns the default name for the cache managed by the filter. |
CachedResource |
getResource(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
javax.servlet.FilterChain chain)
Returns a cached resource from the specified request and response. |
boolean |
isCacheable(javax.servlet.http.HttpServletRequest req)
Indicates whether the resource from the specified request can return a cached copy. |
void |
writeResponse(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
CachedResource resource)
Writes the response from a PageInfo object. |
Method Detail |
---|
String getDefaultCacheName()
This method must not return null
.
CacheManager getCacheManager()
boolean isCacheable(javax.servlet.http.HttpServletRequest req)
This method may be used to determine whether of not this filter should be used for the resource. Implementations may use this method to decide whether to bypass the filter and directly invoke the rest of the filter chain.
req
- The HTTP servlet request.
true
if the caching filter can use a cache;
false
to invoke the rest of the filter chain.String calculateKey(javax.servlet.http.HttpServletRequest req)
Implementers should differentiate between GET and HEAD requests otherwise blank pages can result.
req
- The HTTP servlet request
CachedResource getResource(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException, CacheException
This method may invoke the rest of the filter chain.
req
- The HTTP servlet request.res
- The HTTP servlet response.chain
- The filter chain.
IOException
- Should an IO error occur
javax.servlet.ServletException
- For general errors or errors while invoking the filetr chain.
CacheException
- For caching-specific error.void writeResponse(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, CachedResource resource) throws IOException, javax.servlet.ServletException, CacheException
req
- The HTTP servlet request.res
- the HTTP servlet response.resource
- The cached resource build previously.
IOException
- Should an IO error occur
javax.servlet.ServletException
- For general errors or errors while invoking the filetr chain.
CacheException
- For caching-specific error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |