|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.appserv.web.cache.DefaultCacheHelper
public class DefaultCacheHelper
DefaultCacheHelper interface is the built-in implementation of the
CacheHelper interface to aide in:
a) the key generation b) whether to cache the response.
There is one CacheHelper instance per web application.
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_CACHING_FILTER_NAME
|
static java.lang.String |
PROP_KEY_GENERATOR_ATTR_NAME
|
| Fields inherited from interface com.sun.appserv.web.cache.CacheHelper |
|---|
ATTR_CACHE_MAPPED_SERVLET_NAME, ATTR_CACHE_MAPPED_URL_PATTERN, TIMEOUT_VALUE_NOT_SET |
| Constructor Summary | |
|---|---|
DefaultCacheHelper()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Stop this Context component. |
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 cacheable data in this request |
void |
init(javax.servlet.ServletContext context,
java.util.Map<java.lang.String,java.lang.String> props)
initialize this 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? |
void |
setCacheManager(CacheManager manager)
set the CacheManager for this application |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ATTR_CACHING_FILTER_NAME
public static final java.lang.String PROP_KEY_GENERATOR_ATTR_NAME
| Constructor Detail |
|---|
public DefaultCacheHelper()
| Method Detail |
|---|
public void setCacheManager(CacheManager manager)
manager - associated with this application
public void init(javax.servlet.ServletContext context,
java.util.Map<java.lang.String,java.lang.String> props)
init in interface CacheHelpercontext - the web application context this helper belongs toprops - helper propertiespublic java.lang.String getCacheKey(javax.servlet.http.HttpServletRequest request)
getCacheKey in interface CacheHelperrequest - incoming HttpServletRequest
public boolean isCacheable(javax.servlet.http.HttpServletRequest request)
isCacheable in interface CacheHelperrequest - incoming HttpServletRequest object
true if the response could be cached.
or return false if the results of this request
must not be cached.
Applies pre-configured cacheability constraints in the cache-mapping;
all constraints must pass for this to be cacheable.public boolean isRefreshNeeded(javax.servlet.http.HttpServletRequest request)
isRefreshNeeded in interface CacheHelperrequest - 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.
XXX: 04/16/02 right now there is no configurability for this in
ias-web.xml; should add a refresh-field element there:
public int getTimeout(javax.servlet.http.HttpServletRequest request)
getTimeout in interface CacheHelperrequest - incoming HttpServletRequest object
public void destroy()
throws java.lang.Exception
destroy in interface CacheHelperjava.lang.Exception - if a shutdown error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||