|
|||||||||
| Home >> All >> ojb >> broker >> [ cache overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
ojb.broker.cache
Interface ObjectCache

- All Known Implementing Classes:
- MetaObjectCacheImpl, ObjectCacheDefaultImpl, PermanentObjectCacheImpl
- public interface ObjectCache
The ObjectCache stores all Objects loaded by the PersistenceBroker from a DB. When the PersistenceBroker tries to get an Object by its Primary key values it first lookups the cache if the object has been already loaded and cached. Using an ObjectCache has several advantages: - it increases performance as it reduces DB lookups. - it allows to perform circular lookups (as by crossreferenced objects) that would result in non-terminating loops without such a cache. - it maintains the uniqueness of objects as any Db row will be mapped to exactly one object. This interface allows to have userdefined Cache implementations. The ObjectCacheFactory is responsible for generating cache instances. by default it uses the OJB ObjectCacheDefaultImpl.
| Method Summary | |
void |
cache(ojb.broker.Identity oid,
java.lang.Object obj)
makes object obj persistent to the Objectcache under the key oid. |
void |
cache(java.lang.Object obj)
Make object obj persistent to Objectcache. |
void |
clear()
clear the ObjectCache. |
java.lang.Object |
lookup(ojb.broker.Identity oid)
Lookup object with Identity oid in objectTable. |
void |
remove(java.lang.Object obj)
removes an Object from the cache. |
| Method Detail |
cache
public void cache(java.lang.Object obj) throws ojb.broker.metadata.ClassNotPersistenceCapableException
- Make object obj persistent to Objectcache.
compute objects identity and use it as key for the hashmap
cache
public void cache(ojb.broker.Identity oid, java.lang.Object obj)
- makes object obj persistent to the Objectcache under the key oid.
lookup
public java.lang.Object lookup(ojb.broker.Identity oid)
- Lookup object with Identity oid in objectTable.
returns null if no matching id is found
remove
public void remove(java.lang.Object obj)
- removes an Object from the cache.
clear
public void clear()
- clear the ObjectCache.
|
|||||||||
| Home >> All >> ojb >> broker >> [ cache overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC