Class LRUEvictionConfiguration

    • Constructor Detail

      • LRUEvictionConfiguration

        public LRUEvictionConfiguration()
        Create a new EntryEvictionConfiguration based on LRU algorithm.
      • LRUEvictionConfiguration

        public LRUEvictionConfiguration​(int maxEntries)
        Create a new EntryEvictionConfiguration with given capacity, eviction will be based on LRU algorithm.
        Parameters:
        maxEntries - the maximum entries the cache can contain.
        Since:
        4.3M1
    • Method Detail

      • setMaxEntries

        public void setMaxEntries​(int maxEntries)
        Parameters:
        maxEntries - see getMaxEntries()
      • getMaxEntries

        public int getMaxEntries()
        Returns:
        the maximum entries the cache can contain. When the cache reaches that any element, the defined eviction algorithm kicks in to remove existing cache entries.
      • setMaxIdle

        public void setMaxIdle​(int maxIdle)
        Parameters:
        maxIdle - see getMaxIdle()
        Since:
        7.4M2
      • getMaxIdle

        public int getMaxIdle()
        Returns:
        the time a cache entry will continue to stay in the cache after being last accessed, in seconds. When the time is reached, the entry is expired and removed from the cache. In addition, when the cache reaches its maximum number of entries, the defined eviction algorithm is used (e.g. LRU) and thus an entry can stay less time in the cache than its maximum defined time.
        Since:
        7.4M2
      • setLifespan

        public void setLifespan​(int lifespan)
        Parameters:
        lifespan - see getLifespan()
        Since:
        7.4M2
      • getLifespan

        public int getLifespan()
        Returns:
        the maximum lifespan of a cache entry, after which the entry is expired and removed from the cache, in seconds. In addition, when the cache reaches its maximum number of entries, the defined eviction algorithm is used (e.g. LRU) and thus an entry can stay less time in the cache than its maximum defined time.
        Since:
        7.4M2