public abstract class AbstractVCacheService extends Object implements VCacheFactory, VCacheManagement, VCacheLifecycleManager
| Modifier and Type | Field and Description |
|---|---|
protected ExternalCacheKeyGenerator |
externalCacheKeyGenerator |
protected MetricsCollector |
metricsCollector |
protected Supplier<RequestContext> |
threadLocalContextSupplier |
protected TransactionControlManager |
transactionControlManager |
protected Supplier<RequestContext> |
workContextContextSupplier |
| Constructor and Description |
|---|
AbstractVCacheService(Supplier<RequestContext> threadLocalContextSupplier,
Supplier<RequestContext> workContextContextSupplier,
VCacheSettingsDefaultsProvider defaultsProvider,
VCacheCreationHandler creationHandler,
MetricsCollector metricsCollector,
ExternalCacheKeyGenerator externalCacheKeyGenerator,
BegunTransactionalActivityHandler begunTransactionalActivityHandler) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,ExternalCacheDetails> |
allExternalCacheDetails() |
Map<String,JvmCacheDetails> |
allJvmCacheDetails() |
Map<String,RequestCacheDetails> |
allRequestCacheDetails() |
protected abstract <V> DirectExternalCache<V> |
createDirectExternalCache(String name,
ExternalCacheSettings settings,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling,
boolean valueSerializable)
Creates a
DirectExternalCache with the supplied parameters. |
protected abstract <K,V> JvmCache<K,V> |
createJvmCache(String name,
JvmCacheSettings settings)
Creates a
JvmCache with the supplied parameters. |
protected abstract <V> StableReadExternalCache<V> |
createStableReadExternalCache(String name,
ExternalCacheSettings settings,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling,
boolean valueSerializable)
Creates a
StableReadExternalCache with the supplied parameters. |
protected abstract <V> TransactionalExternalCache<V> |
createTransactionalExternalCache(String name,
ExternalCacheSettings settings,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling,
boolean valueSerializable)
Creates a
TransactionalExternalCache with the supplied parameters. |
<V> DirectExternalCache<V> |
getDirectExternalCache(String name,
Marshaller<V> valueMarshaller,
ExternalCacheSettings settings)
Obtains a
DirectExternalCache with the specified details. |
<V> DirectExternalCache<V> |
getDirectExternalCache(String name,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling,
ExternalCacheSettings settings)
Obtains a
DirectExternalCache with the specified details. |
<K,V> JvmCache<K,V> |
getJvmCache(String name,
JvmCacheSettings settings)
Obtains a
JvmCache with the specified details. |
<K,V> RequestCache<K,V> |
getRequestCache(String name)
Obtains a
RequestCache with the specified details. |
<V> StableReadExternalCache<V> |
getStableReadExternalCache(String name,
Marshaller<V> valueMarshaller,
ExternalCacheSettings settings)
Obtains a
StableReadExternalCache with the specified details. |
<V> StableReadExternalCache<V> |
getStableReadExternalCache(String name,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling,
ExternalCacheSettings settings)
Obtains a
StableReadExternalCache with the specified details. |
<V> TransactionalExternalCache<V> |
getTransactionalExternalCache(String name,
Marshaller<V> valueMarshaller,
ExternalCacheSettings settings)
Obtains a
TransactionalExternalCache with the specified details. |
<V> TransactionalExternalCache<V> |
getTransactionalExternalCache(String name,
com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling,
ExternalCacheSettings settings)
Obtains a
TransactionalExternalCache with the specified details. |
protected abstract org.slf4j.Logger |
log()
Returns the logger for the implementation service.
|
RequestMetrics |
metrics(RequestContext context)
Return the cache metrics for the supplied context.
|
Set<String> |
transactionDiscard(RequestContext context)
Discard the
TransactionalExternalCache's that are associated with the
supplied context. |
void |
transactionSync(RequestContext context)
Synchronise the
TransactionalExternalCache's that are associated with the
supplied context. |
protected final Supplier<RequestContext> workContextContextSupplier
protected final Supplier<RequestContext> threadLocalContextSupplier
protected final TransactionControlManager transactionControlManager
protected final MetricsCollector metricsCollector
protected final ExternalCacheKeyGenerator externalCacheKeyGenerator
public AbstractVCacheService(Supplier<RequestContext> threadLocalContextSupplier, Supplier<RequestContext> workContextContextSupplier, VCacheSettingsDefaultsProvider defaultsProvider, VCacheCreationHandler creationHandler, MetricsCollector metricsCollector, ExternalCacheKeyGenerator externalCacheKeyGenerator, BegunTransactionalActivityHandler begunTransactionalActivityHandler)
protected abstract org.slf4j.Logger log()
protected abstract <K,V> JvmCache<K,V> createJvmCache(String name, JvmCacheSettings settings)
JvmCache with the supplied parameters.K - the key typeV - the value typename - the name of the cachesettings - the setting for the cacheJvmCacheprotected abstract <V> TransactionalExternalCache<V> createTransactionalExternalCache(String name, ExternalCacheSettings settings, com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling, boolean valueSerializable)
TransactionalExternalCache with the supplied parameters.V - the value typename - the name of the cachesettings - the settings for the cachevalueMarshalling - the marshalling pair for valuesvalueSerializable - whether the values are SerializableTransactionalExternalCacheprotected abstract <V> StableReadExternalCache<V> createStableReadExternalCache(String name, ExternalCacheSettings settings, com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling, boolean valueSerializable)
StableReadExternalCache with the supplied parameters.V - the value typename - the name of the cachesettings - the settings for the cachevalueMarshalling - the marshalling pair for valuesvalueSerializable - whether the values are SerializableStableReadExternalCacheprotected abstract <V> DirectExternalCache<V> createDirectExternalCache(String name, ExternalCacheSettings settings, com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling, boolean valueSerializable)
DirectExternalCache with the supplied parameters.V - the value typename - the name of the cachesettings - the settings for the cachevalueMarshalling - the marshalling pair for valuesvalueSerializable - whether the values are SerializableDirectExternalCachepublic <K,V> JvmCache<K,V> getJvmCache(String name, JvmCacheSettings settings)
VCacheFactoryJvmCache with the specified details.
Note: multiple calls to this method will always return the instance created on the first invocation. As such, any changes in the supplied settings will be ignored.
getJvmCache in interface VCacheFactoryK - the key typeV - the value typename - the name of the cachesettings - the settings for the cacheJvmCache with the specified detailspublic <K,V> RequestCache<K,V> getRequestCache(String name)
VCacheFactoryRequestCache with the specified details.
Note: multiple calls to this method will always return the instance created on the first invocation.
getRequestCache in interface VCacheFactoryK - the key typeV - the value typename - the name of the cacheRequestCache with the specified detailspublic <V> TransactionalExternalCache<V> getTransactionalExternalCache(String name, com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling, ExternalCacheSettings settings)
VCacheFactoryTransactionalExternalCache with the specified details.
Note: each call to this method will return a new instance using the specified settings. However, the existing data stored in the external cache will remain. It is not expected in a production configuration that this method will be called multiple times, but is allowed is a development configuration.
getTransactionalExternalCache in interface VCacheFactoryV - the value typename - the name of the cachevalueMarshalling - the marshaller for the values.settings - the settings for the cacheTransactionalExternalCache with the specified detailspublic <V> TransactionalExternalCache<V> getTransactionalExternalCache(String name, Marshaller<V> valueMarshaller, ExternalCacheSettings settings)
VCacheFactoryTransactionalExternalCache with the specified details.
Note: each call to this method will return a new instance using the specified settings. However, the existing data stored in the external cache will remain. It is not expected in a production configuration that this method will be called multiple times, but is allowed is a development configuration.
getTransactionalExternalCache in interface VCacheFactoryV - the value typename - the name of the cachevalueMarshaller - the marshaller for the values.
See MarshallerFactory for provided implementations.settings - the settings for the cacheTransactionalExternalCache with the specified detailspublic <V> StableReadExternalCache<V> getStableReadExternalCache(String name, com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling, ExternalCacheSettings settings)
VCacheFactoryStableReadExternalCache with the specified details.
Note: each call to this method will return a new instance using the specified settings. However, the existing data stored in the external cache will remain. It is not expected in a production configuration that this method will be called multiple times, but is allowed is a development configuration.
getStableReadExternalCache in interface VCacheFactoryV - the value typename - the name of the cachevalueMarshalling - the marshalling pair for the values.settings - the settings for the cacheStableReadExternalCache with the specified detailspublic <V> StableReadExternalCache<V> getStableReadExternalCache(String name, Marshaller<V> valueMarshaller, ExternalCacheSettings settings)
VCacheFactoryStableReadExternalCache with the specified details.
Note: each call to this method will return a new instance using the specified settings. However, the existing data stored in the external cache will remain. It is not expected in a production configuration that this method will be called multiple times, but is allowed is a development configuration.
getStableReadExternalCache in interface VCacheFactoryV - the value typename - the name of the cachevalueMarshaller - the marshaller for the values.
See MarshallerFactory for provided implementations.settings - the settings for the cacheStableReadExternalCache with the specified detailspublic <V> DirectExternalCache<V> getDirectExternalCache(String name, com.atlassian.marshalling.api.MarshallingPair<V> valueMarshalling, ExternalCacheSettings settings)
VCacheFactoryDirectExternalCache with the specified details.
Note: each call to this method will return a new instance using the specified settings. However, the existing data stored in the external cache will remain. It is not expected in a production configuration that this method will be called multiple times, but is allowed is a development configuration.
getDirectExternalCache in interface VCacheFactoryV - the value typename - the name of the cachevalueMarshalling - the marshalling pair to be used for marshalling.settings - the settings for the cacheDirectExternalCache with the specified detailspublic <V> DirectExternalCache<V> getDirectExternalCache(String name, Marshaller<V> valueMarshaller, ExternalCacheSettings settings)
VCacheFactoryDirectExternalCache with the specified details.
Note: each call to this method will return a new instance using the specified settings. However, the existing data stored in the external cache will remain. It is not expected in a production configuration that this method will be called multiple times, but is allowed is a development configuration.
getDirectExternalCache in interface VCacheFactoryV - the value typename - the name of the cachevalueMarshaller - the marshaller for the values.
See MarshallerFactory for provided implementations.settings - the settings for the cacheDirectExternalCache with the specified detailspublic void transactionSync(RequestContext context)
VCacheLifecycleManagerTransactionalExternalCache's that are associated with the
supplied context.transactionSync in interface VCacheLifecycleManagercontext - the request context to synchronise.public Set<String> transactionDiscard(RequestContext context)
VCacheLifecycleManagerTransactionalExternalCache's that are associated with the
supplied context.transactionDiscard in interface VCacheLifecycleManagercontext - the request context to discard.public RequestMetrics metrics(RequestContext context)
VCacheLifecycleManagermetrics in interface VCacheLifecycleManagercontext - the request context to obtain metrics for.public Map<String,JvmCacheDetails> allJvmCacheDetails()
allJvmCacheDetails in interface VCacheManagementpublic Map<String,RequestCacheDetails> allRequestCacheDetails()
allRequestCacheDetails in interface VCacheManagementpublic Map<String,ExternalCacheDetails> allExternalCacheDetails()
allExternalCacheDetails in interface VCacheManagementCopyright © 2016 Atlassian. All rights reserved.