org.apache.commons.cache
Class GroupMapImpl

java.lang.Object
  extended by org.apache.commons.cache.BaseStorageListener
      extended by org.apache.commons.cache.GroupMapImpl
All Implemented Interfaces:
Serializable, GroupMap, StorageListener

public class GroupMapImpl
extends BaseStorageListener
implements GroupMap, StorageListener

tk.

Version:
$Id: GroupMapImpl.java 155435 2005-02-26 13:17:27Z dirkv $
Author:
Rodney Waldhoff
See Also:
Serialized Form

Field Summary
protected  Cache _cache
          The Cache I am associated with.
protected  HashMap _groupToKeys
          A map from groups to a set of associated keys.
protected  HashMap _keyToGroup
          A map from keys to their groups.
 
Constructor Summary
GroupMapImpl()
           
 
Method Summary
protected  void clear()
           
 void cleared()
           
 void cleared(Serializable key)
           
 Serializable[] getKeysForGroup(Serializable group)
          Returns an array of key values associated with the given group.
static void main(String[] args)
           
 void setCache(Cache c)
          Sets my cache.
 void stored(Serializable key, Serializable val, Long expiresAt, Long cost, Serializable group)
           
 void unsetCache()
          Unsets my cache.
 
Methods inherited from class org.apache.commons.cache.BaseStorageListener
notStored, storeRequested
 
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.cache.StorageListener
notStored, storeRequested
 

Field Detail

_cache

protected Cache _cache
The Cache I am associated with.


_groupToKeys

protected HashMap _groupToKeys
A map from groups to a set of associated keys.


_keyToGroup

protected HashMap _keyToGroup
A map from keys to their groups.

Constructor Detail

GroupMapImpl

public GroupMapImpl()
Method Detail

getKeysForGroup

public Serializable[] getKeysForGroup(Serializable group)
Returns an array of key values associated with the given group.

Specified by:
getKeysForGroup in interface GroupMap

setCache

public void setCache(Cache c)
Sets my cache.

Specified by:
setCache in interface GroupMap

unsetCache

public void unsetCache()
Unsets my cache.

Specified by:
unsetCache in interface GroupMap

stored

public void stored(Serializable key,
                   Serializable val,
                   Long expiresAt,
                   Long cost,
                   Serializable group)
Specified by:
stored in interface StorageListener
Overrides:
stored in class BaseStorageListener

cleared

public void cleared(Serializable key)
Specified by:
cleared in interface StorageListener
Overrides:
cleared in class BaseStorageListener

cleared

public void cleared()
Specified by:
cleared in interface StorageListener
Overrides:
cleared in class BaseStorageListener

clear

protected void clear()

main

public static void main(String[] args)


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.