|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.speedo.usercache.lib.UserCacheImpl
Is a basic UserCacheView implementation using WeakReference in order to not disturb the real cache of persistent object.
Field Summary | |
static int |
DEFAULT_SIZE
|
protected java.util.Map |
key2oid
Contains the association user key TO object identifier |
protected java.util.Map |
oid2key
Contains the association object identifier TO user key |
Constructor Summary | |
UserCacheImpl()
Allocates an user cache with the default size. |
|
UserCacheImpl(int size)
Allocates an user cache with a particular size. |
Method Summary | |
java.lang.Object |
bind(java.lang.Object key,
java.lang.Object oid)
Adds an entry into user cache. |
java.lang.Object |
lookup(java.lang.Object key)
Look for an identifier of persistent instance from an user key |
java.lang.Object |
unbindFromKey(java.lang.Object key)
Forces the eviction of an entry from an user key |
java.lang.Object |
unbindFromOID(java.lang.Object oid)
Forces the eviction of an entry from an object identifier |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_SIZE
protected java.util.Map key2oid
protected java.util.Map oid2key
Constructor Detail |
public UserCacheImpl()
#DEFAULT_SIZE, UserCacheImpl(int)
public UserCacheImpl(int size)
size
- is the size of the cache.Method Detail |
public java.lang.Object bind(java.lang.Object key, java.lang.Object oid)
UserCache
bind
in interface UserCache
key
- is the user key the user of the persistent instance (not null)oid
- is the identifier of the persistent instance (not null)
public java.lang.Object unbindFromKey(java.lang.Object key)
UserCache
unbindFromKey
in interface UserCache
key
- is the user key of a persistent instance (not null)
public java.lang.Object unbindFromOID(java.lang.Object oid)
UserCache
unbindFromOID
in interface UserCache
oid
- is the identifier of a persistent instance (not null)
public java.lang.Object lookup(java.lang.Object key)
UserCache
lookup
in interface UserCache
key
- is the user key of the searched persistent instance (not null)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |