org.apache.jcs.access
Class GroupCacheAccess

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

public class GroupCacheAccess
extends CacheAccess
implements IGroupCacheAccess

Access for groups.


Field Summary
 
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.
 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: remove all the group members
 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)
          Remove the item from this group in this region by this name.
 
Methods inherited from class org.apache.jcs.access.CacheAccess
clear, defineRegion, defineRegion, defineRegion, destroy, destroy, dispose, ensureCacheManager, freeMemoryElements, get, getAccess, getAccess, getCacheAttributes, getCacheElement, getCacheElements, getDefaultElementAttributes, getElementAttributes, getElementAttributes, getMatching, getMatchingCacheElements, getStatistics, getStats, put, put, putSafe, remove, remove, resetElementAttributes, resetElementAttributes, setCacheAttributes, setDefaultElementAttributes
 
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, freeMemoryElements, get, getCacheAttributes, getCacheElement, getCacheElements, getElementAttributes, getElementAttributes, getMatching, getMatchingCacheElements, put, put, putSafe, remove, remove, resetElementAttributes, resetElementAttributes, setCacheAttributes
 

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.

Parameters:
region -
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.

Parameters:
region -
icca -
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.

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:
name - The key name.
groupName - The group name.
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:
name - The key name.
groupName - The group name.
value - The object to cache
attr - The objects attributes.
Throws:
CacheException

remove

public void remove(java.lang.Object name,
                   java.lang.String group)
Description copied from interface: IGroupCacheAccess
Remove the item from this group in this region by this name.

Specified by:
remove in interface IGroupCacheAccess
Parameters:
name -
group -

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
Parameters:
group -
Returns:
A Set of keys.

invalidateGroup

public void invalidateGroup(java.lang.String group)
Invalidates a group: remove all the group members

Specified by:
invalidateGroup in interface IGroupCacheAccess
Parameters:
group - The name of the group to invalidate


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.