| org.apache.ojb.broker.cache.ObjectCacheInternal
All known Subclasses: org.apache.ojb.broker.cache.CacheDistributor, org.apache.ojb.broker.cache.MaterializationCache, org.apache.ojb.broker.cache.ObjectCacheDefaultImpl, org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl,
ObjectCacheInternal | public interface ObjectCacheInternal extends ObjectCache(Code) | | Internal used extension of the
ObjectCache .
author: Armin Waibel version: $Id: ObjectCacheInternal.java,v 1.1.2.4 2005/12/21 22:24:15 tomdz Exp $ |
Field Summary | |
final public static int | TYPE_CACHED_READ Object was read from a cache entity (e.g. | final public static int | TYPE_NEW_MATERIALIZED Object was new materialized from persistence storage. | final public static int | TYPE_TEMP Object caching type used for temporary storage of objects,
these objects will never be pushed to a higher level cache. | final public static int | TYPE_UNKNOWN Object caching type was unkown. | final public static int | TYPE_WRITE Object was update or insert. |
Method Summary | |
public boolean | cacheIfNew(Identity oid, Object obj) For internal use within ObjectCache implementations or to
build two-level caches. | public void | doInternalCache(Identity oid, Object obj, int type) For internal use.
This method have to be used by all OJB classes to cache objects.
It allows to decide if an object should be cached or not. |
TYPE_CACHED_READ | final public static int TYPE_CACHED_READ(Code) | | Object was read from a cache entity (e.g. from a second-level cache).
|
TYPE_NEW_MATERIALIZED | final public static int TYPE_NEW_MATERIALIZED(Code) | | Object was new materialized from persistence storage.
|
TYPE_TEMP | final public static int TYPE_TEMP(Code) | | Object caching type used for temporary storage of objects,
these objects will never be pushed to a higher level cache.
|
TYPE_UNKNOWN | final public static int TYPE_UNKNOWN(Code) | | Object caching type was unkown.
|
TYPE_WRITE | final public static int TYPE_WRITE(Code) | | Object was update or insert.
|
cacheIfNew | public boolean cacheIfNew(Identity oid, Object obj)(Code) | | For internal use within ObjectCache implementations or to
build two-level caches. Handle with care.
Used to cache new objects (not already cached) by it's
org.apache.ojb.broker.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
ObjectCacheInternal.cache(org.apache.ojb.broker.Identity,Object) cache .
Parameters: oid - Identity of the object to cache. Parameters: obj - The object to cache. If object was added true, else false. |
doInternalCache | public void doInternalCache(Identity oid, Object obj, int type)(Code) | | For internal use.
This method have to be used by all OJB classes to cache objects.
It allows to decide if an object should be cached or not. Useful
for two level caches to reduce object copy costs.
|
|
|