|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache
A Cache
defines an API for storing and later
retrieving Object
s based upon key values.
A Cache
supports an event subscription/publication
system.
Method Summary | |
---|---|
void |
clear()
Remove all values previously stored . |
void |
clear(Serializable key)
Remove any value previously stored under
the given key. |
void |
clearGroup(Serializable group)
Remove any value previously stored under
the given group. |
boolean |
contains(Serializable key)
Returns true if I have a value associated with the given key, false otherwise. |
Serializable[] |
getKeysForGroup(Serializable group)
|
long |
getStat(CacheStat stat)
|
void |
registerRetrievalListener(RetrievalListener obs)
Add the given RetrievalListener to my
set of RetrievalListener s. |
void |
registerStorageListener(StorageListener obs)
Add the given StorageListener to my
set of StorageListener s. |
Serializable |
retrieve(Serializable key)
Obtain the value previously stored under
the given key. |
boolean |
store(Serializable key,
Serializable val,
Long expiry,
Long cost)
Store the specified val under the specified key. |
boolean |
store(Serializable key,
Serializable val,
Long expiry,
Long cost,
Serializable group)
Store the specified val under the specified key and the specified group. |
void |
unregisterRetrievalListener(RetrievalListener obs)
Remove the given RetrievalListener from my
set of RetrievalListener s. |
void |
unregisterRetrievalListeners()
Clear my set of RetrievalListener s. |
void |
unregisterStorageListener(StorageListener obs)
Remove the given StorageListener from my
set of StorageListener s. |
void |
unregisterStorageListeners()
Clear my set of StorageListener s. |
Method Detail |
---|
boolean store(Serializable key, Serializable val, Long expiry, Long cost)
key
- the key used to later obtain the val from me,
which MUST NOT be null.val
- the val to store, which MUST NOT be null.expiry
- the timestamp at which the given val becomes stale, or null.cost
- the implemenation dependent cost of generating the val, or null.
boolean store(Serializable key, Serializable val, Long expiry, Long cost, Serializable group)
key
- the key used to later obtain the val from me,
which MUST NOT be null.group
- a meta-key which can be used to clear the object laterval
- the val to store, which MUST NOT be null.expiry
- the timestamp at which the given val becomes stale, or null.cost
- the implemenation dependent cost of generating the val, or null.
Serializable retrieve(Serializable key)
stored
under
the given key.
key
- the key which MUST NOT be null.
stored
value, or null.Serializable[] getKeysForGroup(Serializable group)
boolean contains(Serializable key)
key
- the key which MUST NOT be null.
void clear(Serializable key)
stored
under
the given key.
key
- the key which MUST NOT be null.void clearGroup(Serializable group)
stored
under
the given group.
group
- the group which MUST NOT be null.void clear()
stored
.
void registerStorageListener(StorageListener obs)
StorageListener
to my
set of StorageListener
s.
void unregisterStorageListener(StorageListener obs)
StorageListener
from my
set of StorageListener
s.
void unregisterStorageListeners()
StorageListener
s.
void registerRetrievalListener(RetrievalListener obs)
RetrievalListener
to my
set of RetrievalListener
s.
void unregisterRetrievalListener(RetrievalListener obs)
RetrievalListener
from my
set of RetrievalListener
s.
void unregisterRetrievalListeners()
RetrievalListener
s.
long getStat(CacheStat stat) throws UnsupportedOperationException
UnsupportedOperationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |