Class BaseCacheControl

  • All Implemented Interfaces:
    org.cache2k.operation.CacheControl, org.cache2k.operation.CacheInfo, org.cache2k.operation.CacheOperation

    public class BaseCacheControl
    extends Object
    implements org.cache2k.operation.CacheControl
    Provide cache control on top of internal cache. This gets reused by the JMX extension.
    Author:
    Jens Wilke
    • Constructor Detail

      • BaseCacheControl

        public BaseCacheControl​(InternalCache<?,​?> cache)
    • Method Detail

      • getKeyType

        public org.cache2k.config.CacheType<?> getKeyType()
        Specified by:
        getKeyType in interface org.cache2k.operation.CacheInfo
      • getValueType

        public org.cache2k.config.CacheType<?> getValueType()
        Specified by:
        getValueType in interface org.cache2k.operation.CacheInfo
      • getName

        public String getName()
        Specified by:
        getName in interface org.cache2k.operation.CacheInfo
      • getManagerName

        public String getManagerName()
        Specified by:
        getManagerName in interface org.cache2k.operation.CacheInfo
      • getSize

        public long getSize()
        Specified by:
        getSize in interface org.cache2k.operation.CacheInfo
      • getEntryCapacity

        public long getEntryCapacity()
        Specified by:
        getEntryCapacity in interface org.cache2k.operation.CacheInfo
      • getCapacityLimit

        public long getCapacityLimit()
        Specified by:
        getCapacityLimit in interface org.cache2k.operation.CacheInfo
      • getMaximumWeight

        public long getMaximumWeight()
        Specified by:
        getMaximumWeight in interface org.cache2k.operation.CacheInfo
      • getTotalWeight

        public long getTotalWeight()
        Specified by:
        getTotalWeight in interface org.cache2k.operation.CacheInfo
      • getCreatedTime

        public Instant getCreatedTime()
        Specified by:
        getCreatedTime in interface org.cache2k.operation.CacheInfo
      • getClearedTime

        public Instant getClearedTime()
        Specified by:
        getClearedTime in interface org.cache2k.operation.CacheInfo
      • getImplementation

        public String getImplementation()
        Specified by:
        getImplementation in interface org.cache2k.operation.CacheInfo
      • clear

        public CompletableFuture<Void> clear()
        Specified by:
        clear in interface org.cache2k.operation.CacheOperation
      • removeAll

        public CompletableFuture<Void> removeAll()
        Specified by:
        removeAll in interface org.cache2k.operation.CacheOperation
      • changeCapacity

        public CompletableFuture<Void> changeCapacity​(long entryCountOrWeight)
        Change the capacity. The special value 0 means cache disabled.
        Specified by:
        changeCapacity in interface org.cache2k.operation.CacheOperation
      • isLoaderPresent

        public boolean isLoaderPresent()
        Specified by:
        isLoaderPresent in interface org.cache2k.operation.CacheInfo
      • isWeigherPresent

        public boolean isWeigherPresent()
        Specified by:
        isWeigherPresent in interface org.cache2k.operation.CacheInfo
      • isStatisticsEnabled

        public boolean isStatisticsEnabled()
        Specified by:
        isStatisticsEnabled in interface org.cache2k.operation.CacheInfo
      • sampleStatistics

        public org.cache2k.operation.CacheStatistics sampleStatistics()
        Specified by:
        sampleStatistics in interface org.cache2k.operation.CacheControl
      • close

        public CompletableFuture<Void> close()
        Specified by:
        close in interface org.cache2k.operation.CacheOperation
      • destroy

        public CompletableFuture<Void> destroy()
        Specified by:
        destroy in interface org.cache2k.operation.CacheOperation
      • getExpiryAfterWriteTicks

        public long getExpiryAfterWriteTicks()
        Specified by:
        getExpiryAfterWriteTicks in interface org.cache2k.operation.CacheInfo
      • getTimeReference

        public org.cache2k.operation.TimeReference getTimeReference()
        Specified by:
        getTimeReference in interface org.cache2k.operation.CacheInfo