|
JBoss Common Classes 2.2.17.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CachePolicy
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 |
create()
|
void |
destroy()
|
void |
flush()
Flushes the cached objects from the cache. |
Object |
get(Object key)
Returns the object paired with the specified key if it's present in the cache, otherwise must return null. |
void |
insert(Object key,
Object object)
Inserts the specified object into the cache following the implemented policy. |
Object |
peek(Object key)
Returns the object paired with the specified key if it's present in the cache, otherwise must return null. |
void |
remove(Object key)
Remove the cached object paired with the specified key. |
int |
size()
|
void |
start()
|
void |
stop()
|
Method Detail |
---|
Object get(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 object
peek(java.lang.Object)
Object peek(Object key)
get(java.lang.Object)
.
key
- the key paired with the object
get(java.lang.Object)
void insert(Object key, Object object)
key
- the key paired with the objectobject
- the object to cacheremove(java.lang.Object)
void remove(Object key)
key
- the key paired with the objectinsert(java.lang.Object, java.lang.Object)
void flush()
int size()
void create() throws Exception
Exception
void start() throws Exception
Exception
void stop()
void destroy()
|
JBoss Common Classes 2.2.17.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |