Package org.cache2k.operation
Interface CacheInfo
- 
- All Known Subinterfaces:
- CacheControl
 
 public interface CacheInfoInformation of a cache for introspection at runtime, for generic monitoring and management proposes. Additional information is available viaCacheStatisticsif statistics are enabled.It is intentionally that there is no way to retrieve the original configuration after creation. - Author:
- Jens Wilke
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetCapacityLimit()EithergetMaximumWeight()orgetEntryCapacity()depending on whether a weigher is present or not.@Nullable InstantgetClearedTime()Time of the most recentCache.clear()operation.InstantgetCreatedTime()Time when the cache was created.longgetEntryCapacity()The configured maximum number of entries in the cache.longgetExpiryAfterWriteTicks()ConfiguredCache2kBuilder.expireAfterWrite(Duration)orLong.MAX_VALUEif no expiry.StringgetImplementation()Descriptor of cache implementation in use.CacheType<?>getKeyType()Type of the cache key.StringgetManagerName()longgetMaximumWeight()Configured maximum weight or -1.StringgetName()longgetSize()The current number of entries within the cache, starting with 0.TimeReferencegetTimeReference()Effective time referencelonggetTotalWeight()Total weight of all entries in the cache.CacheType<?>getValueType()Type of the cache value.booleanisLoaderPresent()A loader is configured.booleanisStatisticsEnabled()This cache supports statistics.booleanisWeigherPresent()A weigher is configured.static CacheInfoof(Cache<?,?> cache)Request an instance for the given cache.
 
- 
- 
- 
Method Detail- 
getNameString getName() 
 - 
getManagerNameString getManagerName() 
 - 
getKeyTypeCacheType<?> getKeyType() Type of the cache key.
 - 
getValueTypeCacheType<?> getValueType() Type of the cache value.
 - 
getSizelong getSize() The current number of entries within the cache, starting with 0. This value is an estimate, when iterating the entries the cache will always return less or an identical number of entries.Expired entries may stay in the cache Cache2kBuilder.keepDataAfterExpired(boolean). These entries will be counted, but will not be returned by the iterator or apeekoperation
 - 
getEntryCapacitylong getEntryCapacity() The configured maximum number of entries in the cache.
 - 
getMaximumWeightlong getMaximumWeight() Configured maximum weight or -1.- See Also:
- Weigher,- Cache2kBuilder.maximumWeight(long)
 
 - 
getTotalWeightlong getTotalWeight() Total weight of all entries in the cache.- See Also:
- Weigher,- Cache2kBuilder.maximumWeight(long)
 
 - 
getCapacityLimitlong getCapacityLimit() EithergetMaximumWeight()orgetEntryCapacity()depending on whether a weigher is present or not.- See Also:
- Weigher
 
 - 
getImplementationString getImplementation() Descriptor of cache implementation in use. Either a class name or multiple class names.
 - 
isLoaderPresentboolean isLoaderPresent() A loader is configured. This can be used to determine, whether it makes sense to send the report/monitor the loader metrics.
 - 
isWeigherPresentboolean isWeigherPresent() A weigher is configured. This can be used to determine, whether it makes sense to send the report/monitor the weigher metrics.
 - 
isStatisticsEnabledboolean isStatisticsEnabled() This cache supports statistics.
 - 
getCreatedTimeInstant getCreatedTime() Time when the cache was created.We use the old type Dateand notInstanthere in order to make this interface usable for JMX directly, which does not supportInstant.
 - 
getClearedTime@Nullable @Nullable Instant getClearedTime() Time of the most recentCache.clear()operation.
 - 
getExpiryAfterWriteTickslong getExpiryAfterWriteTicks() ConfiguredCache2kBuilder.expireAfterWrite(Duration)orLong.MAX_VALUEif no expiry.- Since:
- 2.6
 
 - 
getTimeReferenceTimeReference getTimeReference() Effective time reference- Since:
- 2.6
 
 
- 
 
-