Kodo 4.2.0. generated on July 28 2008

kodo.datacache
Class MonitoringDataCache

java.lang.Object
  extended by org.apache.openjpa.datacache.DelegatingDataCache
      extended by kodo.datacache.MonitoringDataCache
All Implemented Interfaces:
StatisticsProvider, DataCache, Closeable

public class MonitoringDataCache
extends DelegatingDataCache
implements StatisticsProvider

Delegating cache that provides monitoring statistics.


Field Summary
 
Fields inherited from interface org.apache.openjpa.datacache.DataCache
NAME_DEFAULT
 
Constructor Summary
MonitoringDataCache(OpenJPAConfiguration conf, DataCache cache)
          Provide delegate on construction.
 
Method Summary
 void close()
           
 DataCachePCData get(Object oid)
           
 double getHitRate()
          Returns the percentage of hits.
 int getHits()
          Returns the number of cache hits for invocations of the get(java.lang.Object) method.
 int getMisses()
          Returns the number of cache misses for invocations of the get(java.lang.Object) 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.DelegatingDataCache
addExpirationListener, clear, commit, contains, containsAll, equals, getAll, getDelegate, getInnermostDelegate, getName, hashCode, initialize, pin, pinAll, pinAll, put, remove, removeAll, removeAll, removeExpirationListener, setName, translate, unpin, unpinAll, unpinAll, update, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonitoringDataCache

public MonitoringDataCache(OpenJPAConfiguration conf,
                           DataCache cache)
Provide delegate on construction.

Method Detail

getHits

public int getHits()
Returns the number of cache hits for invocations of the get(java.lang.Object) method.


getMisses

public int getMisses()
Returns the number of cache misses for invocations of the get(java.lang.Object) 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 DataCachePCData get(Object oid)
Specified by:
get in interface DataCache
Overrides:
get in class DelegatingDataCache

close

public void close()
Specified by:
close in interface DataCache
Specified by:
close in interface Closeable
Overrides:
close in class DelegatingDataCache

Kodo 4.2.0. generated on July 28 2008

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