Package org.apache.commons.jcs3
Class JCS
java.lang.Object
org.apache.commons.jcs3.JCS
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. One CacheAccess
 object 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.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <K,V> GroupCacheAccess<K, V> getGroupCacheInstance(String region) Get a GroupCacheAccess which accesses the provided region.static <K,V> GroupCacheAccess<K, V> getGroupCacheInstance(String region, ICompositeCacheAttributes icca) Get a GroupCacheAccess which accesses the provided region.static <K,V> GroupCacheAccess<K, V> getGroupCacheInstance(String region, ICompositeCacheAttributes icca, IElementAttributes eattr) Get a GroupCacheAccess which accesses the provided region.static <K,V> CacheAccess<K, V> getInstance(String region) Get a CacheAccess which accesses the provided region.static <K,V> CacheAccess<K, V> getInstance(String region, ICompositeCacheAttributes icca) Get a CacheAccess which accesses the provided region.static <K,V> CacheAccess<K, V> getInstance(String region, ICompositeCacheAttributes icca, IElementAttributes eattr) Get a CacheAccess which accesses the provided region.static voidsetConfigFilename(String configFilename) Set the filename that the cache manager will be initialized with.static voidsetConfigProperties(Properties configProps) Set the properties that the cache manager will be initialized with.static voidsetLogSystem(String logSystem) Set the log system.static voidshutdown()Shut down the cache manager and set the instance to null
- 
Constructor Details- 
JCSpublic JCS()
 
- 
- 
Method Details- 
setConfigFilenameSet the filename that the cache manager will be initialized with. Only matters before the instance is initialized.- Parameters:
- configFilename-
 
- 
setConfigPropertiesSet the properties that the cache manager will be initialized with. Only matters before the instance is initialized.- Parameters:
- configProps-
 
- 
setLogSystemSet the log system. Must be called before getInstance is called Predefined Log systems areLogManager.LOGSYSTEM_JAVA_UTIL_LOGGINGandLogManager.LOGSYSTEM_LOG4J2- Parameters:
- logSystem- the logSystem to set
 
- 
shutdownShut down the cache manager and set the instance to null
- 
getInstanceGet a CacheAccess which accesses the provided region.- Parameters:
- region- Region that return CacheAccess will provide access to
- Returns:
- A CacheAccess which provides access to a given region.
- Throws:
- CacheException
 
- 
getInstancepublic static <K,V> CacheAccess<K,V> getInstance(String region, ICompositeCacheAttributes icca) throws CacheException Get a CacheAccess which accesses the provided region.- Parameters:
- region- Region that return CacheAccess will provide access to
- icca- CacheAttributes for region
- Returns:
- A CacheAccess which provides access to a given region.
- Throws:
- CacheException
 
- 
getInstancepublic static <K,V> CacheAccess<K,V> getInstance(String region, ICompositeCacheAttributes icca, IElementAttributes eattr) throws CacheException Get a CacheAccess which accesses the provided region.- Parameters:
- region- Region that return CacheAccess will provide access to
- icca- CacheAttributes for region
- eattr- ElementAttributes for the region
- Returns:
- A CacheAccess which provides access to a given region.
- Throws:
- CacheException
 
- 
getGroupCacheInstancepublic static <K,V> GroupCacheAccess<K,V> getGroupCacheInstance(String region) throws CacheException Get a GroupCacheAccess which accesses the provided region.- Parameters:
- region- Region that return GroupCacheAccess will provide access to
- Returns:
- A GroupCacheAccess which provides access to a given region.
- Throws:
- CacheException
 
- 
getGroupCacheInstancepublic static <K,V> GroupCacheAccess<K,V> getGroupCacheInstance(String region, ICompositeCacheAttributes icca) throws CacheException Get a GroupCacheAccess which accesses the provided region.- Parameters:
- region- Region that return GroupCacheAccess will provide access to
- icca- CacheAttributes for region
- Returns:
- A GroupCacheAccess which provides access to a given region.
- Throws:
- CacheException
 
- 
getGroupCacheInstancepublic static <K,V> GroupCacheAccess<K,V> getGroupCacheInstance(String region, ICompositeCacheAttributes icca, IElementAttributes eattr) throws CacheException Get a GroupCacheAccess which accesses the provided region.- Parameters:
- region- Region that return CacheAccess will provide access to
- icca- CacheAttributes for region
- eattr- ElementAttributes for the region
- Returns:
- A GroupCacheAccess which provides access to a given region.
- Throws:
- CacheException
 
 
-