@PublicApi public class CacheSettingsBuilder extends Object
CacheSettings instances.| Constructor and Description |
|---|
CacheSettingsBuilder()
Constructor
|
CacheSettingsBuilder(CacheSettings settings)
Constructor that initializes the builder with the settings from a
CacheSettings instance |
| Modifier and Type | Method and Description |
|---|---|
CacheSettings |
build() |
CacheSettingsBuilder |
expireAfterAccess(long expireAfter,
TimeUnit timeUnit)
Set a hint for the cache regarding how long entries should be held in the cache.
|
CacheSettingsBuilder |
expireAfterWrite(long expireAfter,
TimeUnit timeUnit)
Set a hint for the cache regarding how long entries should be held in the cache.
|
CacheSettingsBuilder |
flushable()
Indicates that this cache can be flushed by the cache manager when desired.
|
CacheSettingsBuilder |
local()
Indicates that this cache should be local to the node (JVM) where the cache is created.
|
CacheSettingsBuilder |
maxEntries(int maxEntries)
Indicates that this cache can have a maximum number of entries.
|
CacheSettingsBuilder |
remote()
Indicates that this cache should be clustered in a clustered deployment.
|
CacheSettingsBuilder |
replicateAsynchronously()
Indicates that in a clustered environment with replicated caches, this
cache should replicate asynchronously.
|
CacheSettingsBuilder |
replicateSynchronously()
Indicates that in a clustered environment with replicated caches, this
cache should replicate synchronously.
|
CacheSettingsBuilder |
replicateViaCopy()
Indicates that in a clustered environment with replicated caches, this
cache should replicate put and update operations by copying the relevant
key and value across the wire (requiring both of them to be
Serializable). |
CacheSettingsBuilder |
replicateViaInvalidation()
Indicates that in a clustered environment with replicated caches, this
cache should replicate by sending only the key across the wire, for invalidation by
the other nodes in the cluster; this requires only the key to be
Serializable. |
CacheSettingsBuilder |
statisticsDisabled()
Indicates that this cache should not record statistics.
|
CacheSettingsBuilder |
statisticsEnabled()
Indicates that this cache should record statistics.
|
CacheSettingsBuilder |
unflushable()
Indicates that this cache cannot be flushed by the cache manager when desired.
|
public CacheSettingsBuilder()
public CacheSettingsBuilder(CacheSettings settings)
CacheSettings instancesettings - the instance to initialize the builder with@Nonnull public CacheSettings build()
CacheSettings instance with@Nonnull public CacheSettingsBuilder expireAfterAccess(long expireAfter, @Nonnull TimeUnit timeUnit)
expireAfter - Time to retain entries for since their last access.timeUnit - The TimeUnit for the time@Nonnull public CacheSettingsBuilder expireAfterWrite(long expireAfter, @Nonnull TimeUnit timeUnit)
expireAfter - Time to retain entries from when they were created.timeUnit - The TimeUnit for the time@Nonnull public CacheSettingsBuilder flushable()
@Nonnull public CacheSettingsBuilder unflushable()
@Nonnull public CacheSettingsBuilder maxEntries(int maxEntries)
maxEntries - The maximum number of entries. Must be greater than zero.@Nonnull public CacheSettingsBuilder replicateAsynchronously()
@Nonnull public CacheSettingsBuilder replicateSynchronously()
replicateAsynchronously@Nonnull public CacheSettingsBuilder replicateViaCopy()
Serializable).
replicateViaInvalidation()@Nonnull public CacheSettingsBuilder replicateViaInvalidation()
Serializable.
replicateViaCopy@Nonnull public CacheSettingsBuilder local()
@Nonnull public CacheSettingsBuilder remote()
public CacheSettingsBuilder statisticsEnabled()
public CacheSettingsBuilder statisticsDisabled()
Copyright © 2018 Atlassian. All rights reserved.