Class CacheFactory


  • public class CacheFactory
    extends Object
    Provides a object cache factory class.
    Since:
    4.2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      CacheFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <K,​V>
      com.google.common.cache.Cache<K,​V>
      createObjectCache()
      Create an query object cache using the JVM configurations.
      static com.google.common.cache.Cache<String,​com.google.common.base.Optional> createObjectCache​(int cacheSize, int cacheTimeout)
      Create an query object cache using the given cache size and timeout in seconds.
      static com.google.common.cache.Cache<String,​com.google.common.base.Optional> createObjectCacheTimeHours​(int cacheSize, int cacheTimeout)
      Create an query object cache using the given cache size and timeout in hours.
      static com.google.common.cache.Cache<String,​com.google.common.base.Optional> createObjectCacheTimeHours​(int cacheSize, int cacheTimeout, com.google.common.cache.RemovalListener removalListener)
      Create an query object cache using the given cache size, timeout in hours and cache removal listener
      static <K,​V>
      com.google.common.cache.Cache<K,​V>
      createObjectCacheTimeSeconds​(int cacheTimeout, com.google.common.cache.RemovalListener<K,​V> removalListener)
      Create an query object cache using the given cache timeout in seconds and cache removal listener
    • Field Detail

      • QUERY_CACHE_TIMEOUT

        public static final String QUERY_CACHE_TIMEOUT
        The Query Cache Timeout JVM argument key.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CacheFactory

        public CacheFactory()
    • Method Detail

      • createObjectCache

        public static final <K,​V> com.google.common.cache.Cache<K,​V> createObjectCache()
        Create an query object cache using the JVM configurations.
        Returns:
        a new query object cache using the JVM configurations.
      • createObjectCache

        public static final com.google.common.cache.Cache<String,​com.google.common.base.Optional> createObjectCache​(int cacheSize,
                                                                                                                          int cacheTimeout)
        Create an query object cache using the given cache size and timeout in seconds.
        Parameters:
        cacheSize - the object cache size
        cacheTimeout - the cache timeout in seconds
        Returns:
        a new query object cache using the JVM configurations.
        Since:
        4.3.0
      • createObjectCacheTimeHours

        public static final com.google.common.cache.Cache<String,​com.google.common.base.Optional> createObjectCacheTimeHours​(int cacheSize,
                                                                                                                                   int cacheTimeout)
        Create an query object cache using the given cache size and timeout in hours.
        Parameters:
        cacheSize - the object cache size
        cacheTimeout - the cache timeout in hours
        Returns:
        a new query object cache using the JVM configurations.
        Since:
        4.3.4
      • createObjectCacheTimeSeconds

        public static final <K,​V> com.google.common.cache.Cache<K,​V> createObjectCacheTimeSeconds​(int cacheTimeout,
                                                                                                              com.google.common.cache.RemovalListener<K,​V> removalListener)
        Create an query object cache using the given cache timeout in seconds and cache removal listener
        Parameters:
        cacheTimeout - the cache timeout in seconds
        removalListener - the cache object removal listener
        Returns:
        a new query object cache using the JVM configurations
        Since:
        17.10.0
      • createObjectCacheTimeHours

        public static final com.google.common.cache.Cache<String,​com.google.common.base.Optional> createObjectCacheTimeHours​(int cacheSize,
                                                                                                                                   int cacheTimeout,
                                                                                                                                   com.google.common.cache.RemovalListener removalListener)
        Create an query object cache using the given cache size, timeout in hours and cache removal listener
        Parameters:
        cacheSize - the object cache size
        cacheTimeout - the cache timeout in hours
        removalListener - the cache object removal listener
        Returns:
        a new query object cache using the JVM configurations
        Since:
        5.0.0