Class CacheConfigurationImpl

    • Field Detail

      • readThrough

        protected boolean readThrough
        read through
      • writeThrough

        protected boolean writeThrough
        write through
      • statisticsEnabled

        protected boolean statisticsEnabled
        statistics enabled
      • storeByValue

        protected boolean storeByValue
        store by value
      • isolationLevel

        protected IsolationLevel isolationLevel
        isolation level
      • transactionMode

        protected Mode transactionMode
        transaction mode
    • Constructor Detail

      • CacheConfigurationImpl

        public CacheConfigurationImpl()
      • CacheConfigurationImpl

        public CacheConfigurationImpl​(boolean readThrough,
                                      boolean writeThrough,
                                      boolean storeByValue,
                                      boolean statisticsEnabled,
                                      IsolationLevel isolationLevel,
                                      Mode transactionMode,
                                      CacheConfiguration.Duration[] timeToLive)
    • Method Detail

      • isReadThrough

        public boolean isReadThrough()
        Whether the cache is a read-through cache. A CacheLoader should be configured for read through caches which is called by the cache for what without the loader would have been misses on Cache.get(Object) and {@link Cache#getAll(java.util.Set}.

        Default value is false.

        Specified by:
        isReadThrough in interface CacheConfiguration
        Returns:
        true if the cache is read-through
      • isWriteThrough

        public boolean isWriteThrough()
        Whether the cache is a write-through cache. If so a CacheWriter should be configured.

        Default value is false.

        Specified by:
        isWriteThrough in interface CacheConfiguration
        Returns:
        true if the cache is write-through
      • isStoreByValue

        public boolean isStoreByValue()
        Whether storeByValue (true) or storeByReference (false). When true, both keys and values are stored by value.

        When false, both keys and values are stored by reference. Caches stored by reference are capable of mutation by any threads holding the reference. The effects are:

        • if the key is mutated, then the key may not be retrievable or removable
        • if the value is mutated, then all threads in the JVM can potentially observe those mutations, subject to the normal Java Memory Model rules.
        Storage by reference only applies to the local heap. If an entry is moved off heap it will need to be transformed into a representation. Any mutations that occur after transformation may not be reflected in the cache.

        The default value is true.

        When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.

        Specified by:
        isStoreByValue in interface CacheConfiguration
        Returns:
        true if the cache is store by value
      • isStatisticsEnabled

        public boolean isStatisticsEnabled()
        Checks whether statistics collection is enabled in this cache.

        The default value is false.

        Specified by:
        isStatisticsEnabled in interface CacheConfiguration
        Returns:
        true if statistics collection is enabled
      • setStatisticsEnabled

        public void setStatisticsEnabled​(boolean enableStatistics)
        Sets whether statistics gathering is enabled on this cache. This may be changed at runtime.
        Specified by:
        setStatisticsEnabled in interface CacheConfiguration
        Parameters:
        enableStatistics - true to enable statistics, false to disable.
      • isTransactionEnabled

        public boolean isTransactionEnabled()
        Checks whether transaction are enabled for this cache.

        Default value is false.

        Specified by:
        isTransactionEnabled in interface CacheConfiguration
        Returns:
        true if transaction are enabled
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object