Package com.avoka.core.cayenne
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 String
QUERY_CACHE_SIZE
The Query Cache Size JVM argument key.static String
QUERY_CACHE_TIMEOUT
The Query Cache Timeout JVM argument key.
-
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 listenerstatic <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_SIZE
public static final String QUERY_CACHE_SIZE
The Query Cache Size JVM argument key.- See Also:
- Constant Field Values
-
QUERY_CACHE_TIMEOUT
public static final String QUERY_CACHE_TIMEOUT
The Query Cache Timeout JVM argument key.- See Also:
- Constant Field Values
-
-
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 sizecacheTimeout
- 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 sizecacheTimeout
- 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 secondsremovalListener
- 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 sizecacheTimeout
- the cache timeout in hoursremovalListener
- the cache object removal listener- Returns:
- a new query object cache using the JVM configurations
- Since:
- 5.0.0
-
-