|
SolarMetric Kodo JDO 3.0.3 generated on February 20 2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kodo.datacache.AbstractCacheImpl | +--kodo.datacache.CacheImpl
A PersistenceManagerFactory cache implementation. Batch updates are performed atomically.
Fields inherited from class kodo.datacache.AbstractCacheImpl |
cache, conf, log |
Fields inherited from interface kodo.datacache.DataCache |
DEFAULT_NAME |
Constructor Summary | |
CacheImpl()
|
Method Summary | |
protected boolean |
addExistingUpdates()
Do nothing with the existing updates. |
void |
afterCommit(RemoteCommitEvent event)
Notification that a transaction associated with a different PersistenceManagerFactory has successfully committed. |
void |
close()
Close any resources used by this listener. |
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object. |
CacheMap |
getCacheMap()
Returns the underlying CacheMap that this
CacheImpl is using. |
int |
getCacheSize()
Returns the maximum number of unpinned objects to keep hard references to. |
boolean |
getKeepSoftReferences()
Returns whether or not this cache will keep soft references when objects expire. |
int |
getSoftReferenceSize()
Returns the maximum number of unpinned objects to keep soft references to. |
protected Map |
newMap()
Returns a new CacheMap for use as the underlying data
cache. |
boolean |
pin(Object key)
Pin the value stored under oid into the cache. |
void |
setCacheSize(int size)
Sets the maximum number of unpinned objects to keep hard references to. |
void |
setKeepSoftReferences(boolean refs)
Configures whether or not this cache will keep soft references when objects expire. |
void |
setSoftReferenceSize(int size)
Sets the maximum number of unpinned objects to keep soft references to. |
boolean |
unpin(Object key)
Unpin the value stored under oid into the cache. |
Methods inherited from class kodo.datacache.AbstractCacheImpl |
addListener, batchUpdate, clear, clearListeners, containsKey, get, getCacheStatisticsString, getHitCount, getMap, getMissCount, getName, getRecordCacheStatistics, getStatistics, keyRemoved, put, registerListener, remove, removeAll, removeListener, removeListener, setConfiguration, setName, setRecordCacheStatistics, startConfiguration, toString, updateValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CacheImpl()
Method Detail |
public CacheMap getCacheMap()
Returns the underlying CacheMap
that this
CacheImpl
is using. This is not an unmodifiable
view on the map, so care should be taken with this
reference. Implementations should probably not mess with the
contents of the cache, but should only use this reference to
obtain cache metrics.
public void setCacheSize(int size)
size
, then this method will result in the cache
flushing old values.public int getCacheSize()
public void setSoftReferenceSize(int size)
size
, then this method will result in the cache
flushing values.public int getSoftReferenceSize()
-1
.public void setKeepSoftReferences(boolean refs)
true
.public boolean getKeepSoftReferences()
protected Map newMap()
CacheMap
for use as the underlying data
cache. This implementation returns a CacheMap
. To
implement a more sophisticated caching strategy, override this
method to return a subclass of CacheMap
.newMap
in class AbstractCacheImpl
protected boolean addExistingUpdates()
addExistingUpdates
in class AbstractCacheImpl
public boolean pin(Object key)
DataCache
oid
into the cache.
This method guarantees that oid
's value will not
be dropped by the caching algorithm. This method does not
affect the behavior of DataCache.remove(java.lang.Object)
.kodo.datacache.DataCache
true
if oid
's value was
pinned into the cache; false
if the
oid is not in the cache.public boolean unpin(Object key)
DataCache
oid
into the cache.
This method reverses a previous invocation of DataCache.pin(java.lang.Object)
.
This method does not remove anything from the cache; it merely
makes oid
's value a candidate for flushing from
the cache.kodo.datacache.DataCache
true
if oid
's value was
unpinned from the cache; false
if the
oid is not in the cache.public void close()
RemoteCommitListener
close
in interface RemoteCommitListener
close
in class AbstractCacheImpl
public void endConfiguration()
Configurable
endConfiguration
in class AbstractCacheImpl
public void afterCommit(RemoteCommitEvent event)
RemoteCommitListener
afterCommit
in interface RemoteCommitListener
|
SolarMetric Kodo JDO 3.0.3 generated on February 20 2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |