Kodo 4.2.0. generated on July 28 2008

kodo.datacache
Class MonitoringQueryCache

java.lang.Object
  extended by org.apache.openjpa.datacache.DelegatingQueryCache
      extended by kodo.datacache.MonitoringQueryCache
All Implemented Interfaces:
StatisticsProvider, QueryCache, TypesChangedListener, Closeable

public class MonitoringQueryCache
extends DelegatingQueryCache
implements StatisticsProvider

Delegating query cache that provides monitoring statistics.


Constructor Summary
MonitoringQueryCache(OpenJPAConfiguration conf, QueryCache cache)
          Provide delegate on construction.
 
Method Summary
 void close()
           
 QueryResult get(QueryKey key)
           
 double getHitRate()
          Returns the percentage of hits.
 int getHits()
          Returns the number of cache hits for invocations of the get(org.apache.openjpa.datacache.QueryKey) method.
 int getMisses()
          Returns the number of cache misses for invocations of the get(org.apache.openjpa.datacache.QueryKey) method.
 Collection getStatistics()
          Get statistics exported by this object.
 String getStatisticsString()
          Returns a localized string containing the number of hits, the number of misses, and the hit ratio (hits / (hits+misses)).
 void resetStatistics()
          Reset the caching statistics.
 
Methods inherited from class org.apache.openjpa.datacache.DelegatingQueryCache
addTypesChangedListener, clear, equals, getDelegate, getInnermostDelegate, hashCode, initialize, onTypesChanged, pin, put, remove, removeTypesChangedListener, translate, unpin, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonitoringQueryCache

public MonitoringQueryCache(OpenJPAConfiguration conf,
                            QueryCache cache)
Provide delegate on construction.

Method Detail

getHits

public int getHits()
Returns the number of cache hits for invocations of the get(org.apache.openjpa.datacache.QueryKey) method.


getMisses

public int getMisses()
Returns the number of cache misses for invocations of the get(org.apache.openjpa.datacache.QueryKey) method.


getHitRate

public double getHitRate()
Returns the percentage of hits.


getStatisticsString

public String getStatisticsString()
Returns a localized string containing the number of hits, the number of misses, and the hit ratio (hits / (hits+misses)).


getStatistics

public Collection getStatistics()
Get statistics exported by this object.

Specified by:
getStatistics in interface StatisticsProvider

resetStatistics

public void resetStatistics()
Reset the caching statistics.


get

public QueryResult get(QueryKey key)
Specified by:
get in interface QueryCache
Overrides:
get in class DelegatingQueryCache

close

public void close()
Specified by:
close in interface QueryCache
Specified by:
close in interface Closeable
Overrides:
close in class DelegatingQueryCache

Kodo 4.2.0. generated on July 28 2008

Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.