org.apache.taglibs.cache
Class CacheUtil

java.lang.Object
  extended byorg.apache.taglibs.cache.CacheUtil

public class CacheUtil
extends java.lang.Object

Contains static methods that can be used to save and retrieve information used to retrieve appropriate caches and to configure the runtime behavior of the Cache Taglib.

Author:
Shawn Bayern

Constructor Summary
CacheUtil()
           
 
Method Summary
static LRUCache getCache(int scope, java.lang.String name, javax.servlet.jsp.PageContext ctx)
          Retrieves (and creates if necessary) an appropriate LRUCache given a scope, name, and context.
static int getCacheLifetime(int scope, javax.servlet.jsp.PageContext pageContext)
          Retrieves the lifetime of items in the cache, given a particular scope and a context.
static int getCacheSize(int scope, javax.servlet.jsp.PageContext pageContext)
          Retrieves the size of the cache, given a particular scope and a context.
static void invalidateCache(int scope, java.lang.String name, javax.servlet.jsp.PageContext pageContext)
          Invalidates an entire cache
static void invalidateCachedItem(int scope, java.lang.String name, java.lang.String key, javax.servlet.jsp.PageContext pageContext)
          Invalidates an individual cache entry (key)
static void setCacheLifetime(int lifetime, int scope, javax.servlet.jsp.PageContext ctx)
          Sets a particular cache lifetime to use for new caches in the given scope.
static void setCacheSize(int size, int scope, javax.servlet.jsp.PageContext ctx)
          Sets a particular cache size to use for new caches in the given scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheUtil

public CacheUtil()
Method Detail

getCacheSize

public static int getCacheSize(int scope,
                               javax.servlet.jsp.PageContext pageContext)
Retrieves the size of the cache, given a particular scope and a context.


getCacheLifetime

public static int getCacheLifetime(int scope,
                                   javax.servlet.jsp.PageContext pageContext)
Retrieves the lifetime of items in the cache, given a particular scope and a context.


setCacheSize

public static void setCacheSize(int size,
                                int scope,
                                javax.servlet.jsp.PageContext ctx)
Sets a particular cache size to use for new caches in the given scope.


setCacheLifetime

public static void setCacheLifetime(int lifetime,
                                    int scope,
                                    javax.servlet.jsp.PageContext ctx)
Sets a particular cache lifetime to use for new caches in the given scope.


getCache

public static LRUCache getCache(int scope,
                                java.lang.String name,
                                javax.servlet.jsp.PageContext ctx)
Retrieves (and creates if necessary) an appropriate LRUCache given a scope, name, and context.


invalidateCache

public static void invalidateCache(int scope,
                                   java.lang.String name,
                                   javax.servlet.jsp.PageContext pageContext)
Invalidates an entire cache


invalidateCachedItem

public static void invalidateCachedItem(int scope,
                                        java.lang.String name,
                                        java.lang.String key,
                                        javax.servlet.jsp.PageContext pageContext)
Invalidates an individual cache entry (key)



Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.