SunONE Application Server v8.0 PE

com.sun.appserv.web.cache
Class DefaultCacheHelper

java.lang.Object
  extended bycom.sun.appserv.web.cache.DefaultCacheHelper
All Implemented Interfaces:
CacheHelper

public class DefaultCacheHelper
extends java.lang.Object
implements CacheHelper

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(HttpServletRequest request)
          getCacheKey: generate the key to be used to cache this request
 int getTimeout(HttpServletRequest request)
          get timeout for the cacheable data in this request
 void init(ServletContext context, java.util.Map props)
          initialize this 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?
 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

ATTR_CACHING_FILTER_NAME

public static final java.lang.String ATTR_CACHING_FILTER_NAME
See Also:
Constant Field Values

PROP_KEY_GENERATOR_ATTR_NAME

public static final java.lang.String PROP_KEY_GENERATOR_ATTR_NAME
See Also:
Constant Field Values
Constructor Detail

DefaultCacheHelper

public DefaultCacheHelper()
Method Detail

setCacheManager

public void setCacheManager(CacheManager manager)
set the CacheManager for this application

Parameters:
manager - associated with this application

init

public void init(ServletContext context,
                 java.util.Map props)
initialize this helper

Specified by:
init in interface CacheHelper
Parameters:
context - the web application context this helper belongs to
props - helper properties

getCacheKey

public java.lang.String getCacheKey(HttpServletRequest request)
getCacheKey: generate the key to be used to cache this request

Specified by:
getCacheKey in interface CacheHelper
Parameters:
request - incoming HttpServletRequest

isCacheable

public boolean isCacheable(HttpServletRequest request)
isCacheable: is the response to given request cachebale?

Specified by:
isCacheable in interface CacheHelper
Parameters:
request - incoming HttpServletRequest object

isRefreshNeeded

public boolean isRefreshNeeded(HttpServletRequest request)
isRefreshNeeded: is the response to given request be refreshed?

Specified by:
isRefreshNeeded in interface CacheHelper
Parameters:
request - incoming HttpServletRequest object

getTimeout

public int getTimeout(HttpServletRequest request)
get timeout for the cacheable data in this request

Specified by:
getTimeout in interface CacheHelper
Parameters:
request - incoming HttpServletRequest object

destroy

public void destroy()
             throws java.lang.Exception
Stop this Context component.

Specified by:
destroy in interface CacheHelper
Throws:
java.lang.Exception - if a shutdown error occurs

SunONE Application Server v8.0 PE

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.