Kodo 4.2.0. (DEPRECATED)

kodo.datacache
Class LRUDataCache

java.lang.Object
  extended by org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
      extended by org.apache.openjpa.datacache.AbstractDataCache
          extended by kodo.datacache.LRUDataCache
All Implemented Interfaces:
Serializable, DataCache, RemoteCommitListener, Configurable, Closeable, EventManager

public class LRUDataCache
extends AbstractDataCache
implements RemoteCommitListener

An lru-based data cache.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.openjpa.datacache.AbstractDataCache
conf, log
 
Fields inherited from class org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
_listeners
 
Fields inherited from interface org.apache.openjpa.datacache.DataCache
NAME_DEFAULT
 
Constructor Summary
LRUDataCache()
           
 
Method Summary
protected  void clearInternal()
           
 CacheMap getCacheMap()
          Returns the underlying CacheMap that this LRUDataCache is using.
 int getCacheSize()
          Returns the maximum number of unpinned objects to keep hard references to.
protected  DataCachePCData getInternal(Object key)
           
 int getSoftReferenceSize()
          Returns the maximum number of unpinned objects to keep soft references to.
 void initialize(DataCacheManager mgr)
           
protected  void keyRemoved(Object key, boolean expired)
           
protected  boolean pinInternal(Object key)
           
protected  DataCachePCData putInternal(Object key, DataCachePCData pc)
           
protected  void removeAllInternal(Class cls, boolean subs)
           
protected  DataCachePCData removeInternal(Object key)
           
 void setCacheSize(int size)
          Sets the maximum number of unpinned objects to keep hard references to.
 void setSoftReferenceSize(int size)
          Sets the maximum number of unpinned objects to keep soft references to.
protected  boolean unpinInternal(Object key)
           
 void writeLock()
           
 void writeUnlock()
           
 
Methods inherited from class org.apache.openjpa.datacache.AbstractDataCache
addExpirationListener, afterCommit, clear, close, close, commit, contains, containsAll, endConfiguration, fireEvent, get, getAll, getEvictionSchedule, getName, isClosed, pin, pinAll, pinAll, put, putAllInternal, recacheUpdates, remove, removeAll, removeAll, removeAllInternal, removeAllTypeNamesInternal, removeExpirationListener, setConfiguration, setEvictionSchedule, setName, startConfiguration, toString, unpin, unpinAll, unpinAll, update
 
Methods inherited from class org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
addListener, fireEvent, getListeners, hasListener, hasListeners, isFailFast, newListenerCollection, removeListener, setFailFast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.event.RemoteCommitListener
afterCommit, close
 

Constructor Detail

LRUDataCache

public LRUDataCache()
Method Detail

getCacheMap

public CacheMap getCacheMap()
Returns the underlying CacheMap that this LRUDataCache is using. This is not an unmodifiable view on the map, so care should be taken with this reference. Implementations should probably not modify the contents of the cache, but should only use this reference to obtain cache metrics.


setCacheSize

public void setCacheSize(int size)
Sets the maximum number of unpinned objects to keep hard references to. If the map contains more unpinned objects than size, then this method will result in the cache flushing old values.


getCacheSize

public int getCacheSize()
Returns the maximum number of unpinned objects to keep hard references to.


setSoftReferenceSize

public void setSoftReferenceSize(int size)
Sets the maximum number of unpinned objects to keep soft references to. If the map contains more soft references than size, then this method will result in the cache flushing values.


getSoftReferenceSize

public int getSoftReferenceSize()
Returns the maximum number of unpinned objects to keep soft references to. Defaults to -1.


initialize

public void initialize(DataCacheManager mgr)
Specified by:
initialize in interface DataCache
Overrides:
initialize in class AbstractDataCache

writeLock

public void writeLock()
Specified by:
writeLock in interface DataCache

writeUnlock

public void writeUnlock()
Specified by:
writeUnlock in interface DataCache

getInternal

protected DataCachePCData getInternal(Object key)
Specified by:
getInternal in class AbstractDataCache

putInternal

protected DataCachePCData putInternal(Object key,
                                      DataCachePCData pc)
Specified by:
putInternal in class AbstractDataCache

removeInternal

protected DataCachePCData removeInternal(Object key)
Specified by:
removeInternal in class AbstractDataCache

removeAllInternal

protected void removeAllInternal(Class cls,
                                 boolean subs)
Specified by:
removeAllInternal in class AbstractDataCache

clearInternal

protected void clearInternal()
Specified by:
clearInternal in class AbstractDataCache

pinInternal

protected boolean pinInternal(Object key)
Specified by:
pinInternal in class AbstractDataCache

unpinInternal

protected boolean unpinInternal(Object key)
Specified by:
unpinInternal in class AbstractDataCache

keyRemoved

protected void keyRemoved(Object key,
                          boolean expired)
Overrides:
keyRemoved in class AbstractDataCache

Kodo 4.2.0. (DEPRECATED)

Copyright 2011 Oracle, Inc. All Rights Reserved.

This documentation is deprecated and will be removed in the next release of WebLogic Server.


Oracle Fusion Middleware Oracle Kodo 4.2.0 API Reference (DEPRECATED)
11g Release 1 (10.3.6)
Part Number E13950-02