kodo.datacache
Class LRUQueryCache
java.lang.Object
   org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
       org.apache.openjpa.datacache.AbstractQueryCache
org.apache.openjpa.datacache.AbstractQueryCache
           kodo.datacache.LRUQueryCache
kodo.datacache.LRUQueryCache
- All Implemented Interfaces: 
- Serializable, QueryCache, TypesChangedListener, RemoteCommitListener, Configurable, Closeable, EventManager
- public class LRUQueryCache 
- extends AbstractQueryCache- implements RemoteCommitListener
An lru-based query cache.
- See Also:
- Serialized Form
 
 
 
 
 
| Methods inherited from class org.apache.openjpa.datacache.AbstractQueryCache | 
| addTypesChangedListener, afterCommit, clear, close, close, endConfiguration, fireEvent, get, isClosed, newListenerCollection, onTypesChanged, pin, put, remove, removeAllInternal, removeTypesChangedListener, setConfiguration, startConfiguration, unpin | 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
 
LRUQueryCache
public LRUQueryCache()
getCacheMap
public CacheMap getCacheMap()
- Returns the underlying CacheMapthat thisLRUQueryCacheis 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. Additionally, this map may contain
 expired data. Removal of timed-out data is done in a lazy
 fashion, so the actual size of the map may be greater than the
 number of non-expired query results in cache.
 
- 
 
- 
 
getCacheSize
public int getCacheSize()
- Returns the maximum number of unpinned objects to keep hard
 references to.
 
- 
 
- 
 
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.
 
- 
 
- 
 
getSoftReferenceSize
public int getSoftReferenceSize()
- Returns the maximum number of unpinned objects to keep soft
 references to. Defaults to -1.
 
- 
 
- 
 
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.
 
- 
 
- 
 
initialize
public void initialize(DataCacheManager mgr)
- 
- Specified by:
- initializein interface- QueryCache
- Overrides:
- initializein class- AbstractQueryCache
 
- 
 
writeLock
public void writeLock()
- 
- Specified by:
- writeLockin interface- QueryCache
 
- 
 
writeUnlock
public void writeUnlock()
- 
- Specified by:
- writeUnlockin interface- QueryCache
 
- 
 
getInternal
protected QueryResult getInternal(QueryKey qk)
- 
- Specified by:
- getInternalin class- AbstractQueryCache
 
- 
 
putInternal
protected QueryResult putInternal(QueryKey qk,
                                  QueryResult result)
- 
- Specified by:
- putInternalin class- AbstractQueryCache
 
- 
 
removeInternal
protected QueryResult removeInternal(QueryKey qk)
- 
- Specified by:
- removeInternalin class- AbstractQueryCache
 
- 
 
clearInternal
protected void clearInternal()
- 
- Specified by:
- clearInternalin class- AbstractQueryCache
 
- 
 
pinInternal
protected boolean pinInternal(QueryKey qk)
- 
- Specified by:
- pinInternalin class- AbstractQueryCache
 
- 
 
unpinInternal
protected boolean unpinInternal(QueryKey qk)
- 
- Specified by:
- unpinInternalin class- AbstractQueryCache
 
- 
 
keySet
protected Collection keySet()
- 
- Specified by:
- keySetin class- AbstractQueryCache
 
- 
 
Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.