public class ObjectCacheJCSImpl extends java.lang.Object implements ObjectCache
ObjectCache
implementation using
turbine-JCS to cache objects is primarily for intern use in
conjunction with ObjectCacheJCSPerClassImpl
implementation. If
used as main ObjectCache
all cached objects will be cached
under the same JCS region name (see DEFAULT_REGION
).
Implementation configuration properties:
Property Key | Property Values |
- | - |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_REGION
The used default region name.
|
Constructor and Description |
---|
ObjectCacheJCSImpl(PersistenceBroker broker,
java.util.Properties prop) |
ObjectCacheJCSImpl(java.lang.String name)
Constructor used by the
ObjectCacheJCSPerClassImpl |
Modifier and Type | Method and Description |
---|---|
void |
cache(Identity oid,
java.lang.Object obj)
makes object obj persistent to the Objectcache under the key oid.
|
boolean |
cacheIfNew(Identity oid,
java.lang.Object obj) |
void |
clear()
clear the ObjectCache.
|
java.lang.String |
getRegionName() |
java.lang.Object |
lookup(Identity oid)
Lookup object with Identity oid in objectTable.
|
void |
remove(Identity oid)
removes an Object from the cache.
|
java.lang.String |
toString() |
public static final java.lang.String DEFAULT_REGION
public ObjectCacheJCSImpl(PersistenceBroker broker, java.util.Properties prop)
public ObjectCacheJCSImpl(java.lang.String name)
ObjectCacheJCSPerClassImpl
public java.lang.String getRegionName()
public void cache(Identity oid, java.lang.Object obj)
cache
in interface ObjectCache
oid
- Identity of the object to cache.obj
- The object to cache.public boolean cacheIfNew(Identity oid, java.lang.Object obj)
public java.lang.Object lookup(Identity oid)
lookup
in interface ObjectCache
oid
- Identity of the object to search for.Identity
is found.public void remove(Identity oid)
remove
in interface ObjectCache
oid
- the Identity of the object to be removed.public void clear()
clear
in interface ObjectCache
public java.lang.String toString()
toString
in class java.lang.Object
(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