Uses of Interface
org.miaixz.bus.core.cache.Cache

Packages that use Cache
Package
Description
提供简易缓存实现,此模块参考了jodd中的相应模块
文件缓存实现
各种缓存实现
  • Uses of Cache in org.miaixz.bus.core.cache

    Methods in org.miaixz.bus.core.cache that return Cache
    Modifier and Type
    Method
    Description
    default Cache<K,V>
    Cache.setListener(CacheListener<K,V> listener)
    设置监听
  • Uses of Cache in org.miaixz.bus.core.cache.file

    Modifier and Type
    Field
    Description
    protected final Cache<File,byte[]>
    AbstractFileCache.cache
    缓存实现
    Methods in org.miaixz.bus.core.cache.file that return Cache
    Modifier and Type
    Method
    Description
    protected abstract Cache<File,byte[]>
    AbstractFileCache.initCache()
    初始化实现文件缓存的缓存对象
    protected Cache<File,byte[]>
    LFUFileCache.initCache()
     
    protected Cache<File,byte[]>
    LRUFileCache.initCache()
     
  • Uses of Cache in org.miaixz.bus.core.cache.provider

    Classes in org.miaixz.bus.core.cache.provider that implement Cache
    Modifier and Type
    Class
    Description
    class 
    超时和限制大小的缓存的默认实现 继承此抽象缓存需要: 创建一个新的Map 实现 prune 策略
    class 
    FIFO(first in first out) 先进先出缓存.
    class 
    LFU(least frequently used) 最少使用率缓存 根据使用次数来判定对象是否被持续缓存 使用率是通过访问次数计算的。 当缓存满时清理过期对象。 清理后依旧满的情况下清除最少访问(访问计数最小)的对象并将其他对象的访问数减去这个最小访问数,以便新对象进入后可以公平计数。
    class 
    LRU (least recently used)最近最久未使用缓存 根据使用时间来判定对象是否被持续缓存 当对象被访问时放入缓存,当缓存满了,最久未被使用的对象将被移除。 此缓存基于LinkedHashMap,因此当被缓存的对象每被访问一次,这个对象的key就到链表头部。 这个算法简单并且非常快,他比FIFO有一个显著优势是经常使用的对象不太可能被移除缓存。 缺点是当缓存满时,不能被很快的访问。
    class 
    NoCache<K,V>
    无缓存实现,用于快速关闭缓存
    class 
    使用ReentrantLock保护的缓存,读写都使用悲观锁完成,主要避免某些Map无法使用读写锁的问题 例如使用了LinkedHashMap的缓存,由于get方法也会改变Map的结构,因此读写必须加互斥锁
    class 
    使用StampedLock保护的缓存,使用读写乐观锁
    class 
    定时缓存 此缓存没有容量限制,对象只有在过期后才会被移除
    class 
    弱引用缓存 对于一个给定的键,其映射的存在并不阻止垃圾回收器对该键的丢弃,这就使该键成为可终止的,被终止,然后被回收。 丢弃某个键时,其条目从映射中有效地移除。