|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.excalibur.cache.SynchronizedCache
A thread safe version of the Cache. Provide synchronized wrapper methods for all them methods defined in the Cache interface.
Constructor Summary | |
SynchronizedCache(Cache cache)
|
Method Summary | |
void |
addListener(CacheListener listener)
Add listener. |
int |
capacity()
Return capacity of cache. |
void |
clear()
Clear cache. |
boolean |
containsKey(java.lang.Object key)
|
java.lang.Object |
get(java.lang.Object key)
Get an item from the cache. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts a new item in the cache. |
java.lang.Object |
remove(java.lang.Object key)
Removes an item from the cache. |
void |
removeListener(CacheListener listener)
Remove listener. |
int |
size()
Return size of cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SynchronizedCache(Cache cache)
Method Detail |
public void addListener(CacheListener listener)
Cache
addListener
in interface Cache
org.apache.avalon.excalibur.cache.Cache
listener
- listener instance to addpublic void removeListener(CacheListener listener)
Cache
removeListener
in interface Cache
org.apache.avalon.excalibur.cache.Cache
listener
- listener instance to removepublic int capacity()
Cache
capacity
in interface Cache
org.apache.avalon.excalibur.cache.Cache
public int size()
Cache
size
in interface Cache
org.apache.avalon.excalibur.cache.Cache
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
Cache
put
in interface Cache
org.apache.avalon.excalibur.cache.Cache
key
- key for the itemvalue
- itempublic java.lang.Object get(java.lang.Object key)
Cache
get
in interface Cache
org.apache.avalon.excalibur.cache.Cache
key
- key to lookup the itempublic java.lang.Object remove(java.lang.Object key)
Cache
remove
in interface Cache
org.apache.avalon.excalibur.cache.Cache
key
- key to removepublic boolean containsKey(java.lang.Object key)
containsKey
in interface Cache
org.apache.avalon.excalibur.cache.Cache
key
- public void clear()
Cache
clear
in interface Cache
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |