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
ConstructorDescriptionGroupCacheAccess
(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 cachevoid
invalidateGroup
(String group) Invalidates a group: remove all the group membersvoid
putInGroup
(K name, String groupName, V value) Allows the user to put an object into a group within a particular cache region.void
putInGroup
(K name, String groupName, V value, IElementAttributes attr) Allows the user to put an object into a group within a particular cache region.void
removeFromGroup
(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, 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.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:
getFromGroup
in 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:
putInGroup
in 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:
putInGroup
in 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:
removeFromGroup
in interfaceIGroupCacheAccess<K,
V> - Parameters:
name
-group
-
-
getGroupKeys
Gets the set of keys of objects currently in the group.- Specified by:
getGroupKeys
in 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:
invalidateGroup
in interfaceIGroupCacheAccess<K,
V> - Parameters:
group
- The name of the group to invalidate
-