public class MemcachedVCacheServiceSettingsBuilder
extends java.lang.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() |
| Modifier and Type | Method and Description |
|---|---|
MemcachedVCacheServiceSettingsBuilder |
begunTransactionalActivityHandler(com.atlassian.vcache.internal.BegunTransactionalActivityHandler handler)
Sets the begun transaction activity handler.
|
MemcachedVCacheServiceSettings |
build()
Returns a new
MemcachedVCacheServiceSettings instance configured using the supplied settings. |
MemcachedVCacheServiceSettingsBuilder |
clientSupplier(java.util.function.Supplier<net.spy.memcached.MemcachedClientIF> clientSupplier)
Sets the client supplier.
|
MemcachedVCacheServiceSettingsBuilder |
creationHandler(com.atlassian.vcache.internal.VCacheCreationHandler creationHandler)
Set the creation handler.
|
MemcachedVCacheServiceSettingsBuilder |
defaultsProvider(com.atlassian.vcache.internal.VCacheSettingsDefaultsProvider defaultsProvider)
Sets the defaults provider.
|
MemcachedVCacheServiceSettingsBuilder |
dontExternaliseCache(java.util.function.Function<java.lang.String,java.lang.Boolean> dontExternaliseCache)
Sets the function to determine whether an
ExternalCache should really be externalised. |
MemcachedVCacheServiceSettingsBuilder |
enableSerializationHack()
Enable the serialization hack, whereby if an
ExternalCache's values are
Serializable, then the values are not marshalled before they are passed to the delegate
Atlassian Cache. |
MemcachedVCacheServiceSettingsBuilder |
externalCacheExceptionListener(com.atlassian.vcache.internal.ExternalCacheExceptionListener externalCacheExceptionListener)
Set the external cache exception listener.
|
MemcachedVCacheServiceSettingsBuilder |
externalCacheKeyGenerator(com.atlassian.vcache.internal.core.ExternalCacheKeyGenerator externalCacheKeyGenerator)
Set the external cache key generator.
|
MemcachedVCacheServiceSettingsBuilder |
lockTimeout(java.time.Duration lockTimeout)
Change the timeout that is used when acquiring locks.
|
MemcachedVCacheServiceSettingsBuilder |
metricsCollector(com.atlassian.vcache.internal.core.metrics.MetricsCollector metricsCollector)
Sets the metrics collector.
|
MemcachedVCacheServiceSettingsBuilder |
productIdentifier(java.lang.String productIdentifier)
Equivalent to calling
externalCacheKeyGenerator(ExternalCacheKeyGenerator) passing a
Sha1ExternalCacheKeyGenerator instance created using the supplied product identifier. |
MemcachedVCacheServiceSettingsBuilder |
threadLocalContextSupplier(java.util.function.Supplier<com.atlassian.vcache.internal.RequestContext> threadLocalContextSupplier)
Sets the context supplier.
|
MemcachedVCacheServiceSettingsBuilder |
workContextContextSupplier(java.util.function.Supplier<com.atlassian.vcache.internal.RequestContext> contextSupplier)
Sets the context supplier for caches that can be thread safe.
|
public MemcachedVCacheServiceSettingsBuilder()
public MemcachedVCacheServiceSettingsBuilder clientSupplier(java.util.function.Supplier<net.spy.memcached.MemcachedClientIF> clientSupplier)
clientSupplier - the client supplier.public MemcachedVCacheServiceSettingsBuilder threadLocalContextSupplier(java.util.function.Supplier<com.atlassian.vcache.internal.RequestContext> threadLocalContextSupplier)
threadLocalContextSupplier - the context supplier.public MemcachedVCacheServiceSettingsBuilder workContextContextSupplier(java.util.function.Supplier<com.atlassian.vcache.internal.RequestContext> contextSupplier)
contextSupplier - the context supplier.public MemcachedVCacheServiceSettingsBuilder defaultsProvider(com.atlassian.vcache.internal.VCacheSettingsDefaultsProvider defaultsProvider)
defaultsProvider - the defaults provider.public MemcachedVCacheServiceSettingsBuilder creationHandler(com.atlassian.vcache.internal.VCacheCreationHandler creationHandler)
creationHandler - the creation handler.public MemcachedVCacheServiceSettingsBuilder metricsCollector(com.atlassian.vcache.internal.core.metrics.MetricsCollector metricsCollector)
DefaultMetricsCollector implementation will be
used.metricsCollector - the metrics collector.public MemcachedVCacheServiceSettingsBuilder productIdentifier(java.lang.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(com.atlassian.vcache.internal.core.ExternalCacheKeyGenerator externalCacheKeyGenerator)
externalCacheKeyGenerator - the external cache key generator.public MemcachedVCacheServiceSettingsBuilder begunTransactionalActivityHandler(com.atlassian.vcache.internal.BegunTransactionalActivityHandler handler)
handler - the begun transaction activity handler.public MemcachedVCacheServiceSettingsBuilder dontExternaliseCache(java.util.function.Function<java.lang.String,java.lang.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(java.time.Duration lockTimeout)
lockTimeout - the timeout that is used when acquiring locks.public MemcachedVCacheServiceSettingsBuilder externalCacheExceptionListener(com.atlassian.vcache.internal.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 © 2022 Atlassian. All rights reserved.