|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.cache.ObjectCacheLocalDefaultImpl
Simple, flexible local ObjectCache
implementation using a
HashMap
to cache given objects.
The cache uses soft-references which allows objects (softly) referenced by
the cache to be reclaimed by the Java Garbage Collector when they are not
longer referenced elsewhere.
Implementation configuration properties:
Property Key | Property Values |
timeout | Lifetime of the cached objects in seconds. If expired the cached object was not returned on lookup call (and removed from cache). |
Nested Class Summary | |
(package private) class |
ObjectCacheLocalDefaultImpl.CacheEntry
|
Field Summary | |
protected java.util.Map |
objectTable
the hashtable holding all cached object |
Constructor Summary | |
ObjectCacheLocalDefaultImpl(PersistenceBroker broker,
java.util.Properties prop)
|
Method Summary | |
void |
cache(Identity oid,
java.lang.Object obj)
Makes object persistent to the Objectcache. |
void |
clear()
Clear ObjectCache. |
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()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Map objectTable
Constructor Detail |
public ObjectCacheLocalDefaultImpl(PersistenceBroker broker, java.util.Properties prop)
Method Detail |
public void clear()
clear
in interface ObjectCache
public void cache(Identity oid, java.lang.Object obj)
cache
in interface ObjectCache
public java.lang.Object lookup(Identity oid)
lookup
in interface ObjectCache
public void remove(Identity oid)
remove
in interface ObjectCache
oid
- Identity of the object to be removed.public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |