Class CacheFactory

java.lang.Object
com.avoka.core.cayenne.CacheFactory

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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The Query Cache Size JVM argument key.
    static final String
    The Query Cache Timeout JVM argument key.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final <K, V> com.google.common.cache.Cache<K,V>
    Create an query object cache using the JVM configurations.
    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.
    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.
    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
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • QUERY_CACHE_SIZE

      public static final String QUERY_CACHE_SIZE
      The Query Cache Size JVM argument key.
      See Also:
    • QUERY_CACHE_TIMEOUT

      public static final String QUERY_CACHE_TIMEOUT
      The Query Cache Timeout JVM argument key.
      See Also:
  • Constructor Details

    • CacheFactory

      public CacheFactory()
  • Method Details

    • 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