Class CacheConfiguration


  • public class CacheConfiguration
    extends java.lang.Object
    Author:
    Emmanuel Duchastenier
    • Constructor Detail

      • CacheConfiguration

        public CacheConfiguration()
    • Method Detail

      • getEvictionPolicy

        public java.lang.String getEvictionPolicy()
        Returns:
        the evictionPolicy
      • setEvictionPolicy

        public void setEvictionPolicy​(java.lang.String evictionPolicy)
        most implementation support LRU and LFU some implementation (ehcache) support FIFO also by default set to LRU
        Parameters:
        evictionPolicy - the evictionPolicy to set
      • isEternal

        public boolean isEternal()
        true if the elements are never evicted automatically
        Returns:
        the eternal
      • setEternal

        public void setEternal​(boolean eternal)
        Parameters:
        eternal - the eternal to set
      • getTimeToLiveSeconds

        public long getTimeToLiveSeconds()
        The time to live is the time elements from this cache will be kept. After this time the element can be evicted
        Returns:
        the timeToLiveSeconds
      • getMaxElementsInMemory

        public int getMaxElementsInMemory()
        the maximum number of elements the cache will keep in memory
        Returns:
        the maxElementsInMemory
      • getMaxElementsOnDisk

        public int getMaxElementsOnDisk()
        the maximum number of element the cache will keep on disk after the limit of elements in memory is reached
        Returns:
        the maxElementsOnDisk
      • isInMemoryOnly

        public boolean isInMemoryOnly()
        if true nothing is stored on disk
        Returns:
        the inMemoryOnly
      • setTimeToLiveSeconds

        public void setTimeToLiveSeconds​(long timeToLiveSeconds)
        Parameters:
        timeToLiveSeconds - the timeToLiveSeconds to set
      • setMaxElementsInMemory

        public void setMaxElementsInMemory​(int maxElementsInMemory)
        Parameters:
        maxElementsInMemory - the maxElementsInMemory to set
      • setMaxElementsOnDisk

        public void setMaxElementsOnDisk​(int maxElementsOnDisk)
        Parameters:
        maxElementsOnDisk - the maxElementsOnDisk to set
      • setInMemoryOnly

        public void setInMemoryOnly​(boolean inMemoryOnly)
        Parameters:
        inMemoryOnly - the inMemoryOnly to set
      • setName

        public void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
      • isReadIntensive

        public boolean isReadIntensive()
        Are the elements stored in the cache read more often than written ?
        Returns:
        readIntensive
      • setReadIntensive

        public void setReadIntensive​(boolean readIntensive)
        Parameters:
        readIntensive - the readIntensive to set
      • isCopyOnRead

        public boolean isCopyOnRead()
      • setCopyOnRead

        public void setCopyOnRead​(boolean copyOnRead)
      • isCopyOnWrite

        public boolean isCopyOnWrite()
      • setCopyOnWrite

        public void setCopyOnWrite​(boolean copyOnWrite)