|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CacheHelper
CacheHelper interface is an user-extensible interface to customize: a) the key generation b) whether to cache the response.
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_CACHE_MAPPED_SERVLET_NAME
|
static java.lang.String |
ATTR_CACHE_MAPPED_URL_PATTERN
|
static int |
TIMEOUT_VALUE_NOT_SET
|
| Method Summary | |
|---|---|
void |
destroy()
Stop the helper from active use |
java.lang.String |
getCacheKey(javax.servlet.http.HttpServletRequest request)
getCacheKey: generate the key to be used to cache this request |
int |
getTimeout(javax.servlet.http.HttpServletRequest request)
get timeout for the cached response. |
void |
init(javax.servlet.ServletContext context,
java.util.Map<java.lang.String,java.lang.String> props)
initialize the helper |
boolean |
isCacheable(javax.servlet.http.HttpServletRequest request)
isCacheable: is the response to given request cachebale? |
boolean |
isRefreshNeeded(javax.servlet.http.HttpServletRequest request)
isRefreshNeeded: is the response to given request be refreshed? |
| Field Detail |
|---|
static final java.lang.String ATTR_CACHE_MAPPED_SERVLET_NAME
static final java.lang.String ATTR_CACHE_MAPPED_URL_PATTERN
static final int TIMEOUT_VALUE_NOT_SET
| Method Detail |
|---|
void init(javax.servlet.ServletContext context,
java.util.Map<java.lang.String,java.lang.String> props)
throws java.lang.Exception
context - the web application context this helper belongs to
java.lang.Exception - if a startup error occursjava.lang.String getCacheKey(javax.servlet.http.HttpServletRequest request)
request - incoming HttpServletRequest object
boolean isCacheable(javax.servlet.http.HttpServletRequest request)
request - incoming HttpServletRequest object
true if the response could be cached. or
false if the results of this request must not be cached.boolean isRefreshNeeded(javax.servlet.http.HttpServletRequest request)
request - incoming HttpServletRequest object
true if the response needs to be refreshed.
or return false if the results of this request
don't need to be refreshed.int getTimeout(javax.servlet.http.HttpServletRequest request)
request - incoming HttpServletRequest object
void destroy()
throws java.lang.Exception
java.lang.Exception - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||