类 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>
BaseCacheStatisticsProvider
implementation that uses JMX to retrieve the cache statistics.- 从以下版本开始:
- 1.3.0
构造器概要
构造器 构造器 说明 AbstractJmxCacheStatisticsProvider()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected <T> T
getAttribute(ObjectName objectName, String attributeName, Class<T> type)
protected abstract CacheStatistics
getCacheStatistics(ObjectName objectName)
Return the currentCacheStatistics
snapshot from the MBean identified by the specifiedObjectName
.CacheStatistics
getCacheStatistics(org.springframework.cache.CacheManager cacheManager, C cache)
Return the currentCacheStatistics
snapshot for the specifiedCache
ornull
if the given cache could not be handled.protected MBeanServer
getMBeanServer()
protected abstract ObjectName
getObjectName(C cache)
Return theObjectName
of the MBean that is managing the specified cache ornull
if none is found.
构造器详细资料
AbstractJmxCacheStatisticsProvider
public AbstractJmxCacheStatisticsProvider()
方法详细资料
getCacheStatistics
public CacheStatistics getCacheStatistics(org.springframework.cache.CacheManager cacheManager, C cache)
从接口复制的说明:CacheStatisticsProvider
Return the currentCacheStatistics
snapshot for the specifiedCache
ornull
if the given cache could not be handled.- 指定者:
getCacheStatistics
在接口中CacheStatisticsProvider<C extends org.springframework.cache.Cache>
- 参数:
cacheManager
- theCacheManager
handling this cachecache
- the cache to handle- 返回:
- the current cache statistics or
null
getObjectName
protected abstract ObjectName getObjectName(C cache) throws MalformedObjectNameException
Return theObjectName
of the MBean that is managing the specified cache ornull
if none is found.- 参数:
cache
- the cache to handle- 返回:
- the object name of the cache statistics MBean
- 抛出:
MalformedObjectNameException
- if theObjectName
for that cache is invalid
getCacheStatistics
protected abstract CacheStatistics getCacheStatistics(ObjectName objectName)
Return the currentCacheStatistics
snapshot 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)