FileDocCategorySizeDatePackage
CacheHelper.javaAPI DocGlassfish v2 API4467Fri May 04 22:35:26 BST 2007com.sun.appserv.web.cache

CacheHelper

public interface CacheHelper
CacheHelper interface is an user-extensible interface to customize: a) the key generation b) whether to cache the response.

Fields Summary
public static final String
ATTR_CACHE_MAPPED_SERVLET_NAME
public static final String
ATTR_CACHE_MAPPED_URL_PATTERN
public static final int
TIMEOUT_VALUE_NOT_SET
Constructors Summary
Methods Summary
public voiddestroy()
Stop the helper from active use

exception
Exception if an error occurs

public java.lang.StringgetCacheKey(javax.servlet.http.HttpServletRequest request)
getCacheKey: generate the key to be used to cache this request

param
request incoming HttpServletRequest object
return
the generated key for this requested cacheable resource.

public intgetTimeout(javax.servlet.http.HttpServletRequest request)
get timeout for the cached response.

param
request incoming HttpServletRequest object
return
the timeout in seconds for the cached response; a return value of -1 means the response never expires and a value of -2 indicates helper cannot determine the timeout (container assigns default timeout)

public voidinit(javax.servlet.ServletContext context, java.util.Map props)
initialize the helper

param
context the web application context this helper belongs to
exception
Exception if a startup error occurs

public booleanisCacheable(javax.servlet.http.HttpServletRequest request)
isCacheable: is the response to given request cachebale?

param
request incoming HttpServletRequest object
return
true if the response could be cached. or false if the results of this request must not be cached.

public booleanisRefreshNeeded(javax.servlet.http.HttpServletRequest request)
isRefreshNeeded: is the response to given request be refreshed?

param
request incoming HttpServletRequest object
return
true if the response needs to be refreshed. or return false if the results of this request don't need to be refreshed.