Package com.avoka.core.cayenne
Class CacheFactory
java.lang.Object
com.avoka.core.cayenne.CacheFactory
Provides a object cache factory class.
- Since:
- 4.2.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 listenerstatic 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
-
Field Details
-
QUERY_CACHE_SIZE
The Query Cache Size JVM argument key.- See Also:
-
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 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
-