|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.cache.AbstractMetaCache
public abstract class AbstractMetaCache
An abstract 'meta' implementation of the ObjectCache
interace.
Implement the abstract getCache(org.apache.ojb.broker.Identity, java.lang.Object, int)
method in sub-classes.
All base Object/Identity validation is done by this class.
Field Summary | |
---|---|
static int |
METHOD_CACHE
|
static int |
METHOD_LOOKUP
|
static int |
METHOD_REMOVE
|
Constructor Summary | |
---|---|
AbstractMetaCache()
|
Method Summary | |
---|---|
void |
cache(Identity oid,
java.lang.Object obj)
Caches the given object using the given Identity as key |
boolean |
cacheIfNew(Identity oid,
java.lang.Object obj)
We delegate this method to the standard cache method. |
abstract ObjectCache |
getCache(Identity oid,
java.lang.Object obj,
int callingMethod)
This method handle all calls against the ObjectCache interface. |
java.lang.Object |
lookup(Identity oid)
Looks up the object from the cache |
void |
remove(Identity oid)
Removes the given object from the cache |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.ojb.broker.cache.ObjectCache |
---|
clear |
Field Detail |
---|
public static final int METHOD_CACHE
public static final int METHOD_LOOKUP
public static final int METHOD_REMOVE
Constructor Detail |
---|
public AbstractMetaCache()
Method Detail |
---|
public abstract ObjectCache getCache(Identity oid, java.lang.Object obj, int callingMethod)
ObjectCache
interface.
Note: The parameter obj
can be null
- e.g. when
lookup or remove method was called.
oid
- Identity of the target object.obj
- The target object itself or null
if not available.callingMethod
- Specifies the type of method call against the ObjectCache
interface. METHOD_CACHE
, METHOD_LOOKUP
, METHOD_REMOVE
.
ObjectCache
implementation.public void cache(Identity oid, java.lang.Object obj)
cache
in interface ObjectCache
oid
- The Identity keyobj
- The object o cachepublic boolean cacheIfNew(Identity oid, java.lang.Object obj)
public java.lang.Object lookup(Identity oid)
lookup
in interface ObjectCache
oid
- The Identity to look up the object for
public void remove(Identity oid)
remove
in interface ObjectCache
oid
- oid of the object to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |