|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache<K,V>
The CacheFactory
can return caches with
different underlying implementations,
but all of them implement this interface. This interface defines the basic
operations available on a cache. Note that this is a subset of the Map
interface - for example, there's no way to iterate over all the keys
in a Cache.
Note that there is no explicit garbage-collection method for a cache.
Caches may perform garbage collection on put
or
get
method calls, or they may use some background
garbage collection scheme - this is entirely up to the underlying cache
implementation.
Method Summary | |
---|---|
void |
clear()
Clear the cache. |
V |
get(java.lang.Object key)
Get an entry in the cache. |
void |
invalidate(java.lang.Object key)
Invalidate a cache key. |
void |
put(K key,
V value)
Place an entry in the cache. |
Methods inherited from interface com.ibm.portal.Identifiable |
---|
getObjectID |
Method Detail |
---|
V get(java.lang.Object key)
key
- - the cache keyvoid put(K key, V value)
If there is already an object in the cache under this key, that
object will be replaced with this value. !Attention! this does not
imply an invalidate()
call on the key!
key
- - the cache key, used to locate the entry on subsequent
lookups.value
- - the object to store in the cache under this keyvoid invalidate(java.lang.Object key)
If the cache implementation is cluster aware this call also invalidates the given key on all instances of this cache in the cluster
void clear()
invalidate()
for
each key in the cache.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |