public class ObjectCacheSoftImpl extends java.lang.Object implements ObjectCache, org.apache.ojb.broker.util.configuration.Configurable
ObjectCache
implementation.Modifier and Type | Class and Description |
---|---|
static class |
ObjectCacheSoftImpl.SoftHashMap
Kind of map using SoftReference to store values
|
Constructor and Description |
---|
ObjectCacheSoftImpl(PersistenceBroker broker,
java.util.Properties properties)
Constructor called by ojb
|
Modifier and Type | Method and Description |
---|---|
void |
cache(Identity oid,
java.lang.Object obj)
Used to cache objects by it's
Identity . |
boolean |
cacheIfNew(Identity oid,
java.lang.Object obj) |
void |
clear()
Clear the cache.
|
void |
configure(org.apache.ojb.broker.util.configuration.Configuration configuration)
configure an object using the Configuration pConfig
|
java.lang.Object |
lookup(Identity oid)
Lookup object with Identity 'oid' in cache.
|
void |
remove(Identity oid)
Removes an Object from the cache.
|
public ObjectCacheSoftImpl(PersistenceBroker broker, java.util.Properties properties)
broker
- ignored parameterproperties
- ignored parameterpublic void configure(org.apache.ojb.broker.util.configuration.Configuration configuration) throws org.apache.ojb.broker.util.configuration.ConfigurationException
org.apache.ojb.broker.util.configuration.Configurable
configure
in interface org.apache.ojb.broker.util.configuration.Configurable
configuration
- the Configuration object used to configure current instanceorg.apache.ojb.broker.util.configuration.ConfigurationException
Configurable.configure(org.apache.ojb.broker.util.configuration.Configuration)
public void cache(Identity oid, java.lang.Object obj)
ObjectCache
Identity
.cache
in interface ObjectCache
oid
- Identity of the object to cache.obj
- The object to cache.ObjectCache.cache(org.apache.ojb.broker.Identity, java.lang.Object)
public boolean cacheIfNew(Identity oid, java.lang.Object obj)
public java.lang.Object lookup(Identity oid)
ObjectCache
lookup
in interface ObjectCache
oid
- Identity of the object to search for.Identity
is found.ObjectCache.lookup(org.apache.ojb.broker.Identity)
public void remove(Identity oid)
ObjectCache
remove
in interface ObjectCache
oid
- Identity of the object to be removed.ObjectCache.remove(org.apache.ojb.broker.Identity)
public void clear()
ObjectCache
clear
in interface ObjectCache
ObjectCache.clear()
(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