org.objectweb.speedo.usercache.lib
Class CompositeUserCache

java.lang.Object
  extended byorg.objectweb.speedo.usercache.lib.CompositeUserCache
All Implemented Interfaces:
UserCache

public class CompositeUserCache
extends java.lang.Object
implements UserCache

Author:
S.Chassande-Barrioz

Constructor Summary
CompositeUserCache(UserCache[] inner)
           
 
Method Summary
 java.lang.Object bind(java.lang.Object key, java.lang.Object oid)
          Adds an entry into user cache.
 int getId()
           
 java.lang.String[] getIndexFieldNames()
           
 java.lang.String getName()
           
 boolean isActive()
           
 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
 

Constructor Detail

CompositeUserCache

public CompositeUserCache(UserCache[] inner)
Method Detail

bind

public java.lang.Object bind(java.lang.Object key,
                             java.lang.Object oid)
Description copied from interface: UserCache
Adds an entry into user cache. If an entry already exists with the same identifier or the same key, it has been replaced.

Specified by:
bind in interface UserCache
Parameters:
key - is the user key the user of the persistent instance (not null)
oid - is the identifier of the persistent instance (not null)
Returns:
the previous associated identifier of a persistent instance associated to the specified user key. The null value is returned if no entry was previously bound.

getId

public int getId()
Specified by:
getId in interface UserCache

getIndexFieldNames

public java.lang.String[] getIndexFieldNames()
Specified by:
getIndexFieldNames in interface UserCache

getName

public java.lang.String getName()
Specified by:
getName in interface UserCache

isActive

public boolean isActive()
Specified by:
isActive in interface UserCache

lookup

public java.lang.Object lookup(java.lang.Object key)
Description copied from interface: UserCache
Look for an identifier of persistent instance from an user key

Specified by:
lookup in interface UserCache
Parameters:
key - is the user key of the searched persistent instance (not null)
Returns:
the identifier of the persistent instance corresponding to the user key. If not found, a null value is returned.

unbindFromKey

public java.lang.Object unbindFromKey(java.lang.Object key)
Description copied from interface: UserCache
Forces the eviction of an entry from an user key

Specified by:
unbindFromKey in interface UserCache
Parameters:
key - is the user key of a persistent instance (not null)
Returns:
the object identifier if found, otherwise null

unbindFromOID

public java.lang.Object unbindFromOID(java.lang.Object oid)
Description copied from interface: UserCache
Forces the eviction of an entry from an object identifier

Specified by:
unbindFromOID in interface UserCache
Parameters:
oid - is the identifier of a persistent instance (not null)
Returns:
the user key if found, otherwise null