public class MemcachedVCacheServiceSettingsBuilder extends Object
MemcachedVCacheServiceSettings instances.
All settings must be set before build() can be called, except for
metricsCollector(MetricsCollector), begunTransactionalActivityHandler(BegunTransactionalActivityHandler)
and dontExternaliseCache(Function). See their Javadoc for the defaults used.
Either externalCacheKeyGenerator(ExternalCacheKeyGenerator) or productIdentifier(String) must be
called.
| Constructor and Description |
|---|
MemcachedVCacheServiceSettingsBuilder() |
public MemcachedVCacheServiceSettingsBuilder()
public MemcachedVCacheServiceSettingsBuilder clientSupplier(Supplier<net.spy.memcached.MemcachedClientIF> clientSupplier)
clientSupplier - the client supplier.public MemcachedVCacheServiceSettingsBuilder threadLocalContextSupplier(Supplier<RequestContext> threadLocalContextSupplier)
threadLocalContextSupplier - the context supplier.public MemcachedVCacheServiceSettingsBuilder workContextContextSupplier(Supplier<RequestContext> contextSupplier)
contextSupplier - the context supplier.public MemcachedVCacheServiceSettingsBuilder defaultsProvider(VCacheSettingsDefaultsProvider defaultsProvider)
defaultsProvider - the defaults provider.public MemcachedVCacheServiceSettingsBuilder creationHandler(VCacheCreationHandler creationHandler)
creationHandler - the creation handler.public MemcachedVCacheServiceSettingsBuilder metricsCollector(MetricsCollector metricsCollector)
DefaultMetricsCollector implementation will be
used.metricsCollector - the metrics collector.public MemcachedVCacheServiceSettingsBuilder productIdentifier(String productIdentifier)
externalCacheKeyGenerator(ExternalCacheKeyGenerator) passing a
Sha1ExternalCacheKeyGenerator instance created using the supplied product identifier.productIdentifier - the product identifier to use with the Sha1ExternalCacheKeyGenerator.public MemcachedVCacheServiceSettingsBuilder externalCacheKeyGenerator(ExternalCacheKeyGenerator externalCacheKeyGenerator)
externalCacheKeyGenerator - the external cache key generator.public MemcachedVCacheServiceSettingsBuilder begunTransactionalActivityHandler(BegunTransactionalActivityHandler handler)
handler - the begun transaction activity handler.public MemcachedVCacheServiceSettingsBuilder dontExternaliseCache(Function<String,Boolean> dontExternaliseCache)
ExternalCache should really be externalised.
If the supplied function returns true for a cache, then an in-memory implementation will be used.
If not set, then a default implementation is provided that will externalise all ExternalCache's.
nothing.
Note: this function is provided to allow for an orderly migration of external caches from being in-memory to be stored in Memcached.
dontExternaliseCache - the function to determine whether an ExternalCache
should really be externalised.public MemcachedVCacheServiceSettingsBuilder enableSerializationHack()
ExternalCache's values are
Serializable, then the values are not marshalled before they are passed to the delegate
Atlassian Cache. This is to allow for performance optimisations.public MemcachedVCacheServiceSettingsBuilder lockTimeout(Duration lockTimeout)
lockTimeout - the timeout that is used when acquiring locks.public MemcachedVCacheServiceSettingsBuilder externalCacheExceptionListener(ExternalCacheExceptionListener externalCacheExceptionListener)
externalCacheExceptionListener - the external cache exception listener.public MemcachedVCacheServiceSettings build()
MemcachedVCacheServiceSettings instance configured using the supplied settings.MemcachedVCacheServiceSettings instance configured using the supplied settings.Copyright © 2019 Atlassian. All rights reserved.