java.lang.Object
ojb.broker.cache.PermanentObjectCacheImpl
- All Implemented Interfaces:
- ObjectCache
- public class PermanentObjectCacheImpl
- extends java.lang.Object
- implements ObjectCache
This is an implementation of the ObjectCache interface that caches all
objects in memory regardless of memory consumption.
It is not intended to be used as the main ObjectCache but only to be used
in conjunction with the MultipleObjectCacheImpl for special object classes.
It should only be used for objects which are few in number and not too big
in size but expensive to re-create from the DB.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cachedObjects
protected java.util.Map cachedObjects
- holds all cached object identities
PermanentObjectCacheImpl
public PermanentObjectCacheImpl()
cache
public void cache(java.lang.Object obj)
- Caches the given object
- Specified by:
cache in interface ObjectCache
clear
public void clear()
- Clears the cache
- Specified by:
clear in interface ObjectCache
cache
public void cache(ojb.broker.Identity oid,
java.lang.Object obj)
- Caches the given object
- Specified by:
cache in interface ObjectCache
lookup
public java.lang.Object lookup(ojb.broker.Identity oid)
- Looks up the cache for an object that matches the given identity
- Specified by:
lookup in interface ObjectCache
remove
public void remove(java.lang.Object obj)
- Description of the Method
- Specified by:
remove in interface ObjectCache