org.apache.jcs
Class JCS
java.lang.Object
org.apache.jcs.access.CacheAccess
org.apache.jcs.access.GroupCacheAccess
org.apache.jcs.JCS
- All Implemented Interfaces:
- ICacheAccess, IGroupCacheAccess
- public class JCS
- extends GroupCacheAccess
Simple class for using JCS. To use JCS in your application, you can use the
static methods of this class to get access objects (instances of this class)
for your cache regions. Ideally this class should be all you need to import
to use JCS. One JCS should be created for each region you want to access. If
you have several regions, then get instances for each. For best performance
the getInstance call should be made in an initialization method.
- Version:
- $Id: JCS.java,v 1.11 2005/06/04 02:01:54 asmuts Exp $
Constructor Summary |
protected |
JCS(CompositeCache cacheControl)
Protected constructor for use by the static factory methods. |
Method Summary |
protected static void |
ensureCacheManager()
Gets an instance of CompositeCacheManager and stores it in the cacheMgr
class field, if it is not already set. |
static JCS |
getInstance(java.lang.String region)
Get a JCS which accesses the provided region. |
static JCS |
getInstance(java.lang.String region,
ICompositeCacheAttributes icca)
Get a JCS which accesses the provided region. |
static void |
setConfigFilename(java.lang.String configFilename)
Set the filename that the cache manager will be initialized with. |
Methods inherited from class org.apache.jcs.access.CacheAccess |
clear, defineRegion, defineRegion, defineRegion, destroy, destroy, dispose, get, getAccess, getAccess, getCacheAttributes, getCacheElement, getElementAttributes, getElementAttributes, getStatistics, getStats, put, put, putSafe, remove, remove, resetElementAttributes, resetElementAttributes, save, setCacheAttributes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.jcs.access.behavior.ICacheAccess |
destroy, destroy, get, getCacheAttributes, getElementAttributes, getElementAttributes, put, put, putSafe, remove, remove, resetElementAttributes, resetElementAttributes, setCacheAttributes |
JCS
protected JCS(CompositeCache cacheControl)
- Protected constructor for use by the static factory methods.
- Parameters:
cacheControl
- Cache which the instance will provide access to
getInstance
public static JCS getInstance(java.lang.String region)
throws CacheException
- Get a JCS which accesses the provided region.
- Parameters:
region
- Region that return JCS will provide access to
- Returns:
- A JCS which provides access to a given region.
- Throws:
CacheException
getInstance
public static JCS getInstance(java.lang.String region,
ICompositeCacheAttributes icca)
throws CacheException
- Get a JCS which accesses the provided region.
- Parameters:
region
- Region that return JCS will provide access toicca
- CacheAttributes for region
- Returns:
- A JCS which provides access to a given region.
- Throws:
CacheException
ensureCacheManager
protected static void ensureCacheManager()
- Gets an instance of CompositeCacheManager and stores it in the cacheMgr
class field, if it is not already set. Unlike the implementation in
CacheAccess, the cache manager is a CompositeCacheManager. NOTE: This can
will be moved up into GroupCacheAccess.
setConfigFilename
public static void setConfigFilename(java.lang.String configFilename)
- Set the filename that the cache manager will be initialized with. Only
matters before the instance is initialized.
- Parameters:
configFilename
-
Copyright © 2002-2005 Apache Software Foundation. All Rights Reserved.