|
Java EE 5 SDK | ||||||||
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 String |
ATTR_CACHE_MAPPED_SERVLET_NAME
|
static String |
ATTR_CACHE_MAPPED_URL_PATTERN
|
static int |
TIMEOUT_VALUE_NOT_SET
|
Method Summary | |
---|---|
void |
destroy()
Stop the helper from active use |
String |
getCacheKey(HttpServletRequest request)
getCacheKey: generate the key to be used to cache this request |
int |
getTimeout(HttpServletRequest request)
get timeout for the cached response. |
void |
init(ServletContext context,
Map props)
initialize the helper |
boolean |
isCacheable(HttpServletRequest request)
isCacheable: is the response to given request cachebale? |
boolean |
isRefreshNeeded(HttpServletRequest request)
isRefreshNeeded: is the response to given request be refreshed? |
Field Detail |
---|
static final String ATTR_CACHE_MAPPED_SERVLET_NAME
static final String ATTR_CACHE_MAPPED_URL_PATTERN
static final int TIMEOUT_VALUE_NOT_SET
Method Detail |
---|
void init(ServletContext context, Map props) throws Exception
context
- the web application context this helper belongs to
Exception
- if a startup error occursString getCacheKey(HttpServletRequest request)
request
- incoming HttpServletRequest
object
boolean isCacheable(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(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(HttpServletRequest request)
request
- incoming HttpServletRequest
object
void destroy() throws Exception
Exception
- if an error occurs
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.