Class CacheFactory.Builder<K,V>
java.lang.Object
com.github.benmanes.caffeine.jcache.CacheFactory.Builder<K,V>
- Enclosing class:
CacheFactory
A one-shot builder for creating a cache instance.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final javax.cache.CacheManager
(package private) final String
(package private) final CaffeineConfiguration
<K, V> (package private) final EventDispatcher
<K, V> (package private) final Executor
(package private) final javax.cache.expiry.ExpiryPolicy
(package private) final Scheduler
(package private) final JCacheStatisticsMXBean
(package private) final Ticker
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(javax.cache.CacheManager cacheManager, String cacheName, CaffeineConfiguration<K, V> config) -
Method Summary
Modifier and TypeMethodDescriptionCacheProxy
<K, V> build()
Creates a configured cache.private boolean
Configures the access expiration and returns if set.private boolean
Configures the write expiration and returns if set.private boolean
Configures the custom expiration and returns if set.private boolean
private boolean
Configures the maximum size and returns if set.private boolean
Configures the maximum weight and returns if set.private void
private boolean
Determines if the cache should operate in read through mode.private CacheProxy
<K, V> Creates a cache that does not read through on a cache miss.private CacheProxy
<K, V> Creates a cache that reads through on a cache miss.
-
Field Details
-
ticker
-
cacheName
-
executor
-
scheduler
-
cacheManager
final javax.cache.CacheManager cacheManager -
expiryPolicy
final javax.cache.expiry.ExpiryPolicy expiryPolicy -
dispatcher
-
statistics
-
caffeine
-
config
-
-
Constructor Details
-
Builder
Builder(javax.cache.CacheManager cacheManager, String cacheName, CaffeineConfiguration<K, V> config)
-
-
Method Details
-
build
Creates a configured cache. -
isReadThrough
private boolean isReadThrough()Determines if the cache should operate in read through mode. -
newCacheProxy
Creates a cache that does not read through on a cache miss. -
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()
-