Package org.apache.commons.jcs3.access
Class GroupCacheAccess<K,V>
java.lang.Object
org.apache.commons.jcs3.access.AbstractCacheAccess<GroupAttrName<K>,V>
org.apache.commons.jcs3.access.GroupCacheAccess<K,V>
- All Implemented Interfaces:
ICacheAccessManagement,IGroupCacheAccess<K,V>
public class GroupCacheAccess<K,V>
extends AbstractCacheAccess<GroupAttrName<K>,V>
implements IGroupCacheAccess<K,V>
Access for groups.
-
Constructor Summary
ConstructorsConstructorDescriptionGroupCacheAccess(CompositeCache<GroupAttrName<K>, V> cacheControl) Constructor for the GroupCacheAccess object -
Method Summary
Modifier and TypeMethodDescriptiongetFromGroup(K name, String group) Gets an item out of the cache that is in a specified group.getGroupKeys(String group) Gets the set of keys of objects currently in the group.Gets the set of group names in the cachevoidinvalidateGroup(String group) Invalidates a group: remove all the group membersvoidputInGroup(K name, String groupName, V value) Allows the user to put an object into a group within a particular cache region.voidputInGroup(K name, String groupName, V value, IElementAttributes attr) Allows the user to put an object into a group within a particular cache region.voidremoveFromGroup(K name, String group) Removes a single item by name from a group.Methods inherited from class org.apache.commons.jcs3.access.AbstractCacheAccess
clear, dispose, freeMemoryElements, getCacheAttributes, getCacheControl, getDefaultElementAttributes, getStatistics, getStats, setCacheAttributes, setDefaultElementAttributesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.jcs3.access.behavior.ICacheAccessManagement
clear, dispose, freeMemoryElements, getCacheAttributes, getDefaultElementAttributes, getStatistics, getStats, setCacheAttributes, setDefaultElementAttributes
-
Constructor Details
-
GroupCacheAccess
Constructor for the GroupCacheAccess object- Parameters:
cacheControl-
-
-
Method Details
-
getFromGroup
Gets an item out of the cache that is in a specified group.- Specified by:
getFromGroupin interfaceIGroupCacheAccess<K,V> - Parameters:
name- The key name.group- The group name.- Returns:
- The cached value, null if not found.
-
putInGroup
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:
putInGroupin interfaceIGroupCacheAccess<K,V> - Parameters:
name- The key name.groupName- The group name.value- The object to cache- Throws:
CacheException
-
putInGroup
public void putInGroup(K name, String groupName, V 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:
putInGroupin interfaceIGroupCacheAccess<K,V> - Parameters:
name- The key name.groupName- The group name.value- The object to cacheattr- The objects attributes.- Throws:
CacheException
-
removeFromGroup
Removes a single item by name from a group.- Specified by:
removeFromGroupin interfaceIGroupCacheAccess<K,V> - Parameters:
name-group-
-
getGroupKeys
Gets the set of keys of objects currently in the group.- Specified by:
getGroupKeysin interfaceIGroupCacheAccess<K,V> - Parameters:
group-- Returns:
- A Set of keys.
-
getGroupNames
Gets the set of group names in the cache- Returns:
- A Set of group names.
-
invalidateGroup
Invalidates a group: remove all the group members- Specified by:
invalidateGroupin interfaceIGroupCacheAccess<K,V> - Parameters:
group- The name of the group to invalidate
-