类 AbstractJmxCacheStatisticsProvider<C extends org.springframework.cache.Cache>
- java.lang.Object
- org.springframework.boot.actuate.cache.AbstractJmxCacheStatisticsProvider<C>
- 类型参数:
C- The cache type
- 所有已实现的接口:
CacheStatisticsProvider<C>
public abstract class AbstractJmxCacheStatisticsProvider<C extends org.springframework.cache.Cache> extends Object implements CacheStatisticsProvider<C>
BaseCacheStatisticsProviderimplementation that uses JMX to retrieve the cache statistics.- 从以下版本开始:
- 1.3.0
构造器概要
构造器 构造器 说明 AbstractJmxCacheStatisticsProvider()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected <T> TgetAttribute(ObjectName objectName, String attributeName, Class<T> type)protected abstract CacheStatisticsgetCacheStatistics(ObjectName objectName)Return the currentCacheStatisticssnapshot from the MBean identified by the specifiedObjectName.CacheStatisticsgetCacheStatistics(org.springframework.cache.CacheManager cacheManager, C cache)Return the currentCacheStatisticssnapshot for the specifiedCacheornullif the given cache could not be handled.protected MBeanServergetMBeanServer()protected abstract ObjectNamegetObjectName(C cache)Return theObjectNameof the MBean that is managing the specified cache ornullif none is found.
构造器详细资料
AbstractJmxCacheStatisticsProvider
public AbstractJmxCacheStatisticsProvider()
方法详细资料
getCacheStatistics
public CacheStatistics getCacheStatistics(org.springframework.cache.CacheManager cacheManager, C cache)
从接口复制的说明:CacheStatisticsProviderReturn the currentCacheStatisticssnapshot for the specifiedCacheornullif the given cache could not be handled.- 指定者:
getCacheStatistics在接口中CacheStatisticsProvider<C extends org.springframework.cache.Cache>- 参数:
cacheManager- theCacheManagerhandling this cachecache- the cache to handle- 返回:
- the current cache statistics or
null
getObjectName
protected abstract ObjectName getObjectName(C cache) throws MalformedObjectNameException
Return theObjectNameof the MBean that is managing the specified cache ornullif none is found.- 参数:
cache- the cache to handle- 返回:
- the object name of the cache statistics MBean
- 抛出:
MalformedObjectNameException- if theObjectNamefor that cache is invalid
getCacheStatistics
protected abstract CacheStatistics getCacheStatistics(ObjectName objectName)
Return the currentCacheStatisticssnapshot from the MBean identified by the specifiedObjectName.- 参数:
objectName- the object name of the cache statistics MBean- 返回:
- the current cache statistics
getMBeanServer
protected MBeanServer getMBeanServer()
getAttribute
protected <T> T getAttribute(ObjectName objectName, String attributeName, Class<T> type)