public class DelegatingQueryCache extends Object implements QueryCache
| Constructor and Description | 
|---|
| DelegatingQueryCache(QueryCache cache)Constructor. | 
| DelegatingQueryCache(QueryCache cache,
                    RuntimeExceptionTranslator trans) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addTypesChangedListener(TypesChangedListener listen)Add a new types event listener to this cache. | 
| void | clear()Remove all data from this cache. | 
| void | close()Free the resources used by this cache. | 
| boolean | equals(Object other) | 
| QueryResult | get(QueryKey qk)Return a list of oids for the given query key. | 
| QueryCache | getDelegate()Return the direct delegate. | 
| QueryCache | getInnermostDelegate()Return the native delegate. | 
| QueryStatistics<QueryKey> | getStatistics()Gets the simple statistics for query results. | 
| int | hashCode() | 
| void | initialize(DataCacheManager mgr)Initialize any resources associated with the given
  DataCacheManager. | 
| void | onTypesChanged(TypesChangedEvent e)Notification that instances of persistent types have changed. | 
| boolean | pin(QueryKey qk)Pin the value stored under  qkinto the
 cache. | 
| QueryResult | put(QueryKey qk,
   QueryResult oids)Set the list of OIDs for the given query key. | 
| QueryResult | remove(QueryKey qk)Remove the value stored under the given query key. | 
| boolean | removeTypesChangedListener(TypesChangedListener listen)Remove an types event listener from this cache. | 
| protected RuntimeException | translate(RuntimeException re)Translate the OpenJPA exception. | 
| boolean | unpin(QueryKey qk)Unpin the value stored under  keyinto the cache. | 
| void | writeLock()Obtain a write lock on the cache. | 
| void | writeUnlock()Release the write lock on the cache. | 
public DelegatingQueryCache(QueryCache cache)
public DelegatingQueryCache(QueryCache cache, RuntimeExceptionTranslator trans)
public QueryCache getDelegate()
public QueryCache getInnermostDelegate()
protected RuntimeException translate(RuntimeException re)
public void initialize(DataCacheManager mgr)
QueryCacheDataCacheManager.initialize in interface QueryCachepublic void onTypesChanged(TypesChangedEvent e)
TypesChangedListeneronTypesChanged in interface TypesChangedListenerpublic QueryResult get(QueryKey qk)
QueryCacheget in interface QueryCachepublic QueryResult put(QueryKey qk, QueryResult oids)
QueryCacheput in interface QueryCachenull if
 the key was not previously cached. See Map.put(K, V)
 for more information.public QueryResult remove(QueryKey qk)
QueryCacheQueryCache class. Instead, the cache should
 be updated by implementing RemoteCommitListener,
 which will result in all queries that may be invalid being dropped.remove in interface QueryCachenull if
 the key was not previously cached. See Map.remove(java.lang.Object)
 for more information.public void clear()
QueryCacheclear in interface QueryCachepublic boolean pin(QueryKey qk)
QueryCacheqk into the
 cache. This method guarantees that qk's value
 will not be expired if the cache exceeds its capacity. It
 causes this data to be ignored when determining whether or not
 the cache is full, effectively increasing the total amount of
 data stored in the cache. This method does not affect the
 behavior of QueryCache.remove(org.apache.openjpa.datacache.QueryKey) or TypesChangedListener.onTypesChanged(org.apache.openjpa.datacache.TypesChangedEvent).pin in interface QueryCachetrue if key's value was
 pinned into the cache; false if the key is not in the cache.public boolean unpin(QueryKey qk)
QueryCachekey into the cache.
 This method reverses a previous invocation of QueryCache.pin(org.apache.openjpa.datacache.QueryKey).
 This method does not remove anything from the cache; it merely
 makes key's value a candidate for flushing from the cache.unpin in interface QueryCachetrue if key's value was
 unpinned from the cache; false if the
 key is not in the cache.public void writeLock()
QueryCachewriteLock in interface QueryCachepublic void writeUnlock()
QueryCachewriteUnlock in interface QueryCachepublic void addTypesChangedListener(TypesChangedListener listen)
QueryCacheaddTypesChangedListener in interface QueryCachepublic boolean removeTypesChangedListener(TypesChangedListener listen)
QueryCacheremoveTypesChangedListener in interface QueryCachepublic void close()
QueryCacheclose in interface QueryCacheclose in interface Closeablepublic QueryStatistics<QueryKey> getStatistics()
QueryCachegetStatistics in interface QueryCacheCopyright © 2006–2018 Apache Software Foundation. All rights reserved.