org.apache.jcs.access
Class GroupCacheAccess

java.lang.Object
  extended byorg.apache.jcs.access.CacheAccess
      extended byorg.apache.jcs.access.GroupCacheAccess
All Implemented Interfaces:
ICacheAccess, IGroupCacheAccess
Direct Known Subclasses:
JCS

public class GroupCacheAccess
extends CacheAccess
implements IGroupCacheAccess

Access for groups.

Author:
asmuts, John McNally

Field Summary
private static CompositeCacheManager cacheMgr
           
 
Fields inherited from class org.apache.jcs.access.CacheAccess
cacheControl
 
Constructor Summary
GroupCacheAccess(CompositeCache cacheControl)
          Constructor for the GroupCacheAccess object
 
Method Summary
 java.lang.Object getFromGroup(java.lang.Object name, java.lang.String group)
          Gets an item out of the cache that is in a specified group.
static GroupCacheAccess getGroupAccess(java.lang.String region)
          Gets the groupAccess attribute of the GroupCacheAccess class
static GroupCacheAccess getGroupAccess(java.lang.String region, ICompositeCacheAttributes icca)
          Gets the groupAccess attribute of the GroupCacheAccess class
private  GroupAttrName getGroupAttrName(java.lang.String group, java.lang.Object name)
           
 java.util.Set getGroupKeys(java.lang.String group)
          Gets the set of keys of objects currently in the group
 void invalidateGroup(java.lang.String group)
          Invalidates a group
 void putInGroup(java.lang.Object name, java.lang.String groupName, java.lang.Object value)
          Allows the user to put an object into a group within a particular cache region.
 void putInGroup(java.lang.Object name, java.lang.String groupName, java.lang.Object value, IElementAttributes attr)
          Allows the user to put an object into a group within a particular cache region.
 void remove(java.lang.Object name, java.lang.String group)
          Description of the Method
 
Methods inherited from class org.apache.jcs.access.CacheAccess
defineRegion, defineRegion, defineRegion, destroy, destroy, dispose, ensureCacheManager, get, getAccess, getAccess, getCacheAttributes, getElementAttributes, getElementAttributes, 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
 

Field Detail

cacheMgr

private static CompositeCacheManager cacheMgr
Constructor Detail

GroupCacheAccess

public GroupCacheAccess(CompositeCache cacheControl)
Constructor for the GroupCacheAccess object

Parameters:
cacheControl -
Method Detail

getGroupAccess

public static GroupCacheAccess getGroupAccess(java.lang.String region)
                                       throws CacheException
Gets the groupAccess attribute of the GroupCacheAccess class

Returns:
The groupAccess value
Throws:
CacheException

getGroupAccess

public static GroupCacheAccess getGroupAccess(java.lang.String region,
                                              ICompositeCacheAttributes icca)
                                       throws CacheException
Gets the groupAccess attribute of the GroupCacheAccess class

Returns:
The groupAccess value
Throws:
CacheException

getFromGroup

public java.lang.Object getFromGroup(java.lang.Object name,
                                     java.lang.String group)
Gets an item out of the cache that is in a specified group.

Specified by:
getFromGroup in interface IGroupCacheAccess
Parameters:
name - The key name.
group - The group name.
Returns:
The cached value, null if not found.

getGroupAttrName

private GroupAttrName getGroupAttrName(java.lang.String group,
                                       java.lang.Object name)

putInGroup

public void putInGroup(java.lang.Object name,
                       java.lang.String groupName,
                       java.lang.Object value)
                throws CacheException
Allows the user to put an object into a group within a particular cache region. This method sets the object's attributes to the default for the region.

Specified by:
putInGroup in interface IGroupCacheAccess
Parameters:
value - The object to cache
Throws:
CacheException

putInGroup

public void putInGroup(java.lang.Object name,
                       java.lang.String groupName,
                       java.lang.Object value,
                       IElementAttributes attr)
                throws CacheException
Allows the user to put an object into a group within a particular cache region. This method allows the object's attributes to be individually specified.

Specified by:
putInGroup in interface IGroupCacheAccess
Parameters:
value - The object to cache
attr - The objects attributes.
Throws:
CacheException

remove

public void remove(java.lang.Object name,
                   java.lang.String group)
Description of the Method

Specified by:
remove in interface IGroupCacheAccess

getGroupKeys

public java.util.Set getGroupKeys(java.lang.String group)
Gets the set of keys of objects currently in the group

Specified by:
getGroupKeys in interface IGroupCacheAccess

invalidateGroup

public void invalidateGroup(java.lang.String group)
Invalidates a group

Specified by:
invalidateGroup in interface IGroupCacheAccess