LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data.cache
Class LyLruCache

java.lang.Object
  extended by leon.data.LyCache
      extended by leon.data.cache.LySimpleCache
          extended by leon.data.cache.LyLruCache

public class LyLruCache
extends LySimpleCache

This class implements a LRU (Last recently Used) cache in which objects are stored and unloaded on the fly, depending to dataSource needs, but n instances are keeped in memory after removing.


Nested Class Summary
 
Nested classes/interfaces inherited from class leon.data.LyCache
LyCache.Result
 
Field Summary
static java.lang.String __VERSION
          File version
 
Fields inherited from class leon.data.LyCache
NB_UNKNOWN_OBJECTS
 
Constructor Summary
LyLruCache(LyClass cacheClass, LyInfoCache policy)
          Constructor of a simple cache of objects related to a given class description.
 
Method Summary
 java.lang.Object getObject(LyObjectId id)
          Gets an object in this cache by its identifier.
 
Methods inherited from class leon.data.cache.LySimpleCache
allowLoaded, getObjectFromPeer, getSize, isEmpty
 
Methods inherited from class leon.data.LyCache
clearUnknownIdsCache, contains, contains, getCacheClass, getCount, getEnvironment, getObjectList, getObjects, getObjects, getPolicy, isLoaded, rehash, setLoaded
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyLruCache

public LyLruCache(LyClass cacheClass,
                  LyInfoCache policy)
Constructor of a simple cache of objects related to a given class description.

Parameters:
cacheClass - Class description of objects stored in the cache.
policy - Description of th epolicy of thsi cache.
Method Detail

getObject

public java.lang.Object getObject(LyObjectId id)
                           throws LyNoSuchObjectException
Gets an object in this cache by its identifier.

Overrides:
getObject in class LyCache
Parameters:
id - Object identifier.
Returns:
Object found in cache with the given identifier, or null if no object is found and if the id was registered in unknown ids list.
Throws:
LyNoSuchObjectException - If no object of this cache has this identifier and if the given id has not been regsitered in unknown ids list.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com