|
|||||||||
| 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
Class MetaObjectCacheImpl

java.lang.Objectojb.broker.cache.MetaObjectCacheImpl
- All Implemented Interfaces:
- ObjectCache
- public class MetaObjectCacheImpl
- extends java.lang.Object
- implements ObjectCache
- extends java.lang.Object
This cache makes it possible to have separate cache implementations for
each class. When an object is cached / looked up the MetaObjectCacheImpl
checks if a special ObjectCache has been set for this class. It recursively
looks up the superclasses of the given object to look for a special cache. If
no special cache is found it uses the ObjectCacheDefaultImpl to cache the
object.
It is also possible to switch off caching for a specific class by setting
the object cache to null.
| Field Summary | |
private java.util.Map |
cachesByClass
|
| Constructor Summary | |
MetaObjectCacheImpl()
Constructor for the MetaObjectCacheImpl object |
|
| Method Summary | |
void |
cache(ojb.broker.Identity oid,
java.lang.Object obj)
Caches the given object using the given Identity as key |
void |
cache(java.lang.Object obj)
Caches the given Object |
void |
clear()
Clears the cache |
private ObjectCache |
getCache(java.lang.Class objectClass)
Gets the cache for the given class |
java.lang.Object |
lookup(ojb.broker.Identity oid)
Looks up the object from the cache |
void |
remove(java.lang.Object obj)
Removes the given object from the cache |
protected void |
removeByOID(ojb.broker.Identity oid)
Removes the object identified by the given Identity from the cache |
void |
setClassCache(java.lang.Class objectClass,
ObjectCache cache)
Sets the ObjectCache implementation to use for objects with the given type and subclasses |
private void |
setClassCache(java.lang.String className,
ObjectCache cache)
Sets the ObjectCache implementation for the given class name |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
cachesByClass
private java.util.Map cachesByClass
| Constructor Detail |
MetaObjectCacheImpl
public MetaObjectCacheImpl()
- Constructor for the MetaObjectCacheImpl object
| Method Detail |
setClassCache
public void setClassCache(java.lang.Class objectClass, ObjectCache cache)
- Sets the ObjectCache implementation to use for objects with the given
type and subclasses
cache
public void cache(java.lang.Object obj)
- Caches the given Object
- Specified by:
cachein interfaceObjectCache
cache
public void cache(ojb.broker.Identity oid, java.lang.Object obj)
- Caches the given object using the given Identity as key
- Specified by:
cachein interfaceObjectCache
lookup
public java.lang.Object lookup(ojb.broker.Identity oid)
- Looks up the object from the cache
- Specified by:
lookupin interfaceObjectCache
removeByOID
protected void removeByOID(ojb.broker.Identity oid)
- Removes the object identified by the given Identity from the cache
remove
public void remove(java.lang.Object obj)
- Removes the given object from the cache
- Specified by:
removein interfaceObjectCache
clear
public void clear()
- Clears the cache
- Specified by:
clearin interfaceObjectCache
setClassCache
private void setClassCache(java.lang.String className, ObjectCache cache)
- Sets the ObjectCache implementation for the given class name
getCache
private ObjectCache getCache(java.lang.Class objectClass)
- Gets the cache for the given class
|
|||||||||
| Home >> All >> ojb >> broker >> [ cache overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
ojb.broker.cache.MetaObjectCacheImpl