public abstract class AbstractMetaCache extends java.lang.Object implements ObjectCache
ObjectCache
interace.
getCache(org.apache.ojb.broker.Identity, java.lang.Object, int)
method in sub-classes.
All base Object/Identity validation is done by this class.Modifier and Type | Field and Description |
---|---|
static int |
METHOD_CACHE |
static int |
METHOD_LOOKUP |
static int |
METHOD_REMOVE |
Constructor and Description |
---|
AbstractMetaCache() |
Modifier and Type | Method and Description |
---|---|
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
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear
public static final int METHOD_CACHE
public static final int METHOD_LOOKUP
public static final int METHOD_REMOVE
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 forpublic void remove(Identity oid)
remove
in interface ObjectCache
oid
- oid of the object to remove(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30