|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.lib.instrumentation.AbstractInstrument
org.apache.openjpa.instrumentation.AbstractDataCacheInstrument
public abstract class AbstractDataCacheInstrument
Provides a basic instrument implementation wrapper for the data cache. This class can be extended to create a provider specific instrument for the data cache.
| Field Summary | |
|---|---|
static long |
NO_STATS
Value indicating that cache statistics are not available. |
| Constructor Summary | |
|---|---|
AbstractDataCacheInstrument()
|
|
| Method Summary | |
|---|---|
void |
cache(String className,
boolean enable)
This method is used to enable/disable caching for the specified className. |
void |
clear()
Clears all data from the DataCache. |
void |
collectStatistics(boolean enable)
|
String |
getCacheName()
Returns the name of the cache |
Map<String,long[]> |
getCacheStatistics()
Returns the CacheStatistics for the cache. |
String |
getConfigId()
|
String |
getContextRef()
|
long |
getHitCount()
Returns the hit count since cache statistics were last reset |
long |
getHitCount(String c)
Gets number of total read requests that has been found in cache for the given class since last reset. |
InstrumentationLevel |
getLevel()
Gets the instrumentation level of this instrument. |
long |
getReadCount()
Returns the read count since cache statistics were last reset |
long |
getReadCount(String c)
Gets number of total read requests for the given class since last reset. |
Boolean |
getStatisticsEnabled()
Returns true if cache statistics are currently being calculated. |
long |
getTotalHitCount()
Returns the total hits since start. |
long |
getTotalHitCount(String c)
Gets number of total read requests that has been found in cache for the given class since start. |
long |
getTotalReadCount()
Returns the total reads since start. |
long |
getTotalReadCount(String c)
Gets number of total read requests for the given class since start. |
long |
getTotalWriteCount()
Returns the total writes since start. |
long |
getTotalWriteCount(String c)
Gets number of total write requests for the given class since start. |
long |
getWriteCount()
Returns the write count since cache statistics were last reset |
long |
getWriteCount(String c)
Gets number of total write requests for the given class since last reset. |
Map<String,Boolean> |
listKnownTypes()
Returns the names of classes that are known to the cache and whether or not they are currently being cached. |
void |
reset()
Resets cache statistics |
void |
setConfigId(String cid)
|
void |
setContextRef(String cref)
|
void |
setDataCache(DataCache dc)
|
void |
setDataCacheManager(DataCacheManager dcm)
|
Date |
sinceDate()
Returns date since cache statistics collection were last reset. |
Date |
startDate()
Returns date cache statistics collection started. |
| Methods inherited from class org.apache.openjpa.lib.instrumentation.AbstractInstrument |
|---|
getContext, getName, getOptions, getProvider, initialize, isStarted, restart, setContext, setOptions, setProvider, setStarted |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.openjpa.lib.instrumentation.Instrument |
|---|
start, stop |
| Field Detail |
|---|
public static final long NO_STATS
| Constructor Detail |
|---|
public AbstractDataCacheInstrument()
| Method Detail |
|---|
public void setDataCache(DataCache dc)
public void setDataCacheManager(DataCacheManager dcm)
public void setConfigId(String cid)
public void setContextRef(String cref)
public long getHitCount()
DataCacheInstrument
getHitCount in interface DataCacheInstrumentpublic long getReadCount()
DataCacheInstrument
getReadCount in interface DataCacheInstrumentpublic long getTotalHitCount()
DataCacheInstrument
getTotalHitCount in interface DataCacheInstrumentpublic long getTotalReadCount()
DataCacheInstrument
getTotalReadCount in interface DataCacheInstrumentpublic long getTotalWriteCount()
DataCacheInstrument
getTotalWriteCount in interface DataCacheInstrumentpublic long getWriteCount()
DataCacheInstrument
getWriteCount in interface DataCacheInstrumentpublic void reset()
DataCacheInstrument
reset in interface DataCacheInstrumentpublic Date sinceDate()
DataCacheInstrument
sinceDate in interface DataCacheInstrumentpublic Date startDate()
DataCacheInstrument
startDate in interface DataCacheInstrumentpublic String getConfigId()
public String getContextRef()
public String getCacheName()
DataCacheInstrument
getCacheName in interface DataCacheInstrumentpublic long getWriteCount(String c)
DataCacheInstrument
getWriteCount in interface DataCacheInstrumentpublic long getTotalWriteCount(String c)
DataCacheInstrument
getTotalWriteCount in interface DataCacheInstrumentpublic long getTotalReadCount(String c)
DataCacheInstrument
getTotalReadCount in interface DataCacheInstrumentpublic long getTotalHitCount(String c)
DataCacheInstrument
getTotalHitCount in interface DataCacheInstrumentpublic long getReadCount(String c)
DataCacheInstrument
getReadCount in interface DataCacheInstrumentpublic long getHitCount(String c)
DataCacheInstrument
getHitCount in interface DataCacheInstrumentpublic InstrumentationLevel getLevel()
Instrument
getLevel in interface InstrumentgetLevel in class AbstractInstrument
public void cache(String className,
boolean enable)
DataCacheInstrument
cache in interface DataCacheInstrumentpublic Map<String,Boolean> listKnownTypes()
DataCacheInstrument
listKnownTypes in interface DataCacheInstrumentpublic void collectStatistics(boolean enable)
collectStatistics in interface DataCacheInstrumentenable - - If true, the cache will start collecting statistics. Else cache statistics will not be collected.public Boolean getStatisticsEnabled()
DataCacheInstrument
getStatisticsEnabled in interface DataCacheInstrumentpublic Map<String,long[]> getCacheStatistics()
DataCacheInstrument
getCacheStatistics in interface DataCacheInstrumentpublic void clear()
DataCacheInstrument
clear in interface DataCacheInstrument
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||