|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface that specifies a policy for caches.
Implementation classes can implement a LRU policy, a random one, a MRU one, or any other suitable policy.
Method Summary | |
void |
flush()
Flushes the cached objects from the cache. |
java.lang.Object |
get(java.lang.Object key)
Returns the object paired with the specified key if it's present in the cache, otherwise must return null. |
void |
insert(java.lang.Object key,
java.lang.Object object)
Inserts the specified object into the cache following the implemented policy. |
java.lang.Object |
peek(java.lang.Object key)
Returns the object paired with the specified key if it's present in the cache, otherwise must return null. |
void |
remove(java.lang.Object key)
Remove the cached object paired with the specified key. |
Methods inherited from interface org.jboss.util.Service |
destroy, init, start, stop |
Method Detail |
public java.lang.Object get(java.lang.Object key)
peek(java.lang.Object)
this method not only return whether
the object is present in the cache or not, but also
applies the implemented policy that will "refresh" the cached
object in the cache, because this cached object
was really requested.key
- the key paired with the objectpeek(java.lang.Object)
public java.lang.Object peek(java.lang.Object key)
get(java.lang.Object)
.key
- the key paired with the objectget(java.lang.Object)
public void insert(java.lang.Object key, java.lang.Object object)
key
- the key paired with the objectobject
- the object to cacheremove(java.lang.Object)
public void remove(java.lang.Object key)
key
- the key paired with the objectinsert(java.lang.Object, java.lang.Object)
public void flush()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |