|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ojb.broker.cache.MaterializationCache
public class MaterializationCache
A wrapper class for ObjectCache
implementations used to materialize object graphs and
push the fully materialized object to the real object cache.
To avoid passing of partial materialized objects to cache this class act as a temporary storage
for unmaterialized (new read or refreshed) objects.
Field Summary |
---|
Fields inherited from interface org.apache.ojb.broker.cache.ObjectCacheInternal |
---|
TYPE_CACHED_READ, TYPE_NEW_MATERIALIZED, TYPE_TEMP, TYPE_UNKNOWN, TYPE_WRITE |
Method Summary | |
---|---|
void |
cache(Identity oid,
Object obj)
Used to cache objects by it's Identity . |
boolean |
cacheIfNew(Identity oid,
Object obj)
For internal use within ObjectCache implementations or to build two-level caches. |
void |
clear()
Clear the cache. |
void |
disableMaterializationCache()
|
void |
doInternalCache(Identity oid,
Object obj,
int type)
For internal use. |
void |
doLocalClear()
Clears the internal used cache for object materialization. |
Object |
doLocalLookup(Identity oid)
|
void |
doLocalRemove(Identity oid)
|
void |
enableMaterializationCache()
For internal use only! Helper method to guarantee that only full materialized objects will be pushed to the application cache regardless if an local PB transaction is running or not. |
boolean |
isEnabledMaterialisationCache()
Returns true if the materialisation cache is enabled, otherwise false. |
Object |
lookup(Identity oid)
Lookup object with Identity 'oid' in cache. |
void |
remove(Identity oid)
Removes an Object from the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean isEnabledMaterialisationCache()
public void enableMaterializationCache()
disableMaterializationCache()
are used to delimit nested calls
and to detect the end of an object materialization and avoid endless loops on circular
references.
doLocalClear()
have to be called.
public void disableMaterializationCache()
enableMaterializationCache()
public void doInternalCache(Identity oid, Object obj, int type)
ObjectCacheInternal
doInternalCache
in interface ObjectCacheInternal
public void cache(Identity oid, Object obj)
ObjectCache
Identity
.
cache
in interface ObjectCache
oid
- Identity of the object to cache.obj
- The object to cache.public boolean cacheIfNew(Identity oid, Object obj)
ObjectCacheInternal
Used to cache new objects (not already cached) by it's
Identity
. This method was used to
cache new materialized objects and should work as a "atomic" method
(the check and the put of the object should be atomic) to avoid
concurrency problems.
Currently it's not mandatory that all ObjectCache implementations
support this method, so in some cases it's allowed to delegate this
method call to the standard cache
.
cacheIfNew
in interface ObjectCacheInternal
oid
- Identity of the object to cache.obj
- The object to cache.
ObjectCacheInternal.cacheIfNew(org.apache.ojb.broker.Identity, Object)
public Object lookup(Identity oid)
ObjectCache
lookup
in interface ObjectCache
oid
- Identity of the object to search for.
Identity
is found.public Object doLocalLookup(Identity oid)
public void remove(Identity oid)
ObjectCache
remove
in interface ObjectCache
oid
- Identity of the object to be removed.public void doLocalRemove(Identity oid)
public void doLocalClear()
public void clear()
ObjectCache
clear
in interface ObjectCache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |