|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.speedo.usercache.lib.UserCacheViewImpl
Is a basic UserCacheView implementation using WeakReference in order to not disturb the real cache of persistent object.
Field Summary | |
protected java.util.Map |
cache
This field is the cache. |
protected java.lang.ref.ReferenceQueue |
queue
Queue used to register the weak references stored in the cache. |
Constructor Summary | |
UserCacheViewImpl()
|
Method Summary | |
java.lang.Object |
bind(java.lang.Object id,
java.lang.Object obj)
Register a persistent instance into the user view. |
void |
clean()
Removes all entries that have been garbage collected. |
java.lang.Object |
lookup(java.lang.Class clazz,
java.lang.Object key)
Look for a persistent instance with an user identifier and a class |
java.lang.Object |
rebind(java.lang.Object oldkey,
java.lang.Object newkey,
java.lang.Object obj)
Register an entry with an new user key. |
java.lang.Object |
unbind(java.lang.Class clazz,
java.lang.Object key)
Forces the eviction of an entry |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Map cache
protected java.lang.ref.ReferenceQueue queue
Constructor Detail |
public UserCacheViewImpl()
Method Detail |
public void clean()
clean
in interface UserCacheView
public java.lang.Object bind(java.lang.Object id, java.lang.Object obj)
UserCacheView
bind
in interface UserCacheView
id
- is the user key of the persistent instanceobj
- is the persistent instance. It cannot be null.
public java.lang.Object rebind(java.lang.Object oldkey, java.lang.Object newkey, java.lang.Object obj)
UserCacheView
rebind
in interface UserCacheView
oldkey
- is the old user key of the persistent instancenewkey
- is the new user key of the persistent instanceobj
- is the persistent instance. It cannot be null.
public java.lang.Object unbind(java.lang.Class clazz, java.lang.Object key)
UserCacheView
unbind
in interface UserCacheView
clazz
- is the class of the persistent instancekey
- is the user key of the persistent instance
public java.lang.Object lookup(java.lang.Class clazz, java.lang.Object key)
UserCacheView
lookup
in interface UserCacheView
clazz
- is the class of the searched persistent instancekey
- is the user key of the searched persistent instance
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |