Class CacheFactory.Builder<K,V>
- java.lang.Object
-
- com.github.benmanes.caffeine.jcache.CacheFactory.Builder<K,V>
-
- Enclosing class:
- CacheFactory
private static final class CacheFactory.Builder<K,V> extends java.lang.ObjectA one-shot builder for creating a cache instance.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.cache.CacheManagercacheManager(package private) java.lang.StringcacheName(package private) Caffeine<java.lang.Object,java.lang.Object>caffeine(package private) CaffeineConfiguration<K,V>config(package private) EventDispatcher<K,V>dispatcher(package private) java.util.concurrent.Executorexecutor(package private) javax.cache.expiry.ExpiryPolicyexpiryPolicy(package private) Schedulerscheduler(package private) JCacheStatisticsMXBeanstatistics(package private) Tickerticker
-
Constructor Summary
Constructors Constructor Description Builder(javax.cache.CacheManager cacheManager, java.lang.String cacheName, CaffeineConfiguration<K,V> config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheProxy<K,V>build()Creates a configured cache.private booleanconfigureExpireAfterAccess()Configures the access expiration and returns if set.private booleanconfigureExpireAfterWrite()Configures the write expiration and returns if set.private booleanconfigureExpireVariably()Configures the custom expiration and returns if set.private booleanconfigureJCacheExpiry()private booleanconfigureMaximumSize()Configures the maximum size and returns if set.private booleanconfigureMaximumWeight()Configures the maximum weight and returns if set.private voidconfigureRefreshAfterWrite()private booleanisReadThrough()Determines if the cache should operate in read through mode.private CacheProxy<K,V>newCacheProxy()Creates a cache that does not read through on a cache miss.private CacheProxy<K,V>newLoadingCacheProxy()Creates a cache that reads through on a cache miss.
-
-
-
Field Detail
-
ticker
final Ticker ticker
-
cacheName
final java.lang.String cacheName
-
executor
final java.util.concurrent.Executor executor
-
scheduler
final Scheduler scheduler
-
cacheManager
final javax.cache.CacheManager cacheManager
-
expiryPolicy
final javax.cache.expiry.ExpiryPolicy expiryPolicy
-
dispatcher
final EventDispatcher<K,V> dispatcher
-
statistics
final JCacheStatisticsMXBean statistics
-
caffeine
final Caffeine<java.lang.Object,java.lang.Object> caffeine
-
config
final CaffeineConfiguration<K,V> config
-
-
Constructor Detail
-
Builder
Builder(javax.cache.CacheManager cacheManager, java.lang.String cacheName, CaffeineConfiguration<K,V> config)
-
-
Method Detail
-
build
public CacheProxy<K,V> build()
Creates a configured cache.
-
isReadThrough
private boolean isReadThrough()
Determines if the cache should operate in read through mode.
-
newCacheProxy
private CacheProxy<K,V> newCacheProxy()
Creates a cache that does not read through on a cache miss.
-
newLoadingCacheProxy
private CacheProxy<K,V> newLoadingCacheProxy()
Creates a cache that reads through on a cache miss.
-
configureMaximumSize
private boolean configureMaximumSize()
Configures the maximum size and returns if set.
-
configureMaximumWeight
private boolean configureMaximumWeight()
Configures the maximum weight and returns if set.
-
configureExpireAfterWrite
private boolean configureExpireAfterWrite()
Configures the write expiration and returns if set.
-
configureExpireAfterAccess
private boolean configureExpireAfterAccess()
Configures the access expiration and returns if set.
-
configureExpireVariably
private boolean configureExpireVariably()
Configures the custom expiration and returns if set.
-
configureJCacheExpiry
private boolean configureJCacheExpiry()
-
configureRefreshAfterWrite
private void configureRefreshAfterWrite()
-
-