Open sandboxFocus

Class CachingBackendEnhancer

A base class for all cache enhancers. A CachingBackendEnhancer is a node in a chain of responsibility where the last node is the physical implementation of the CachingBackend. A CachingBackendEnhancer can add behaviors to a CachingBackend.

Inheritance
CachingBackendEnhancer
Namespace: Metalama.Patterns.Caching.Implementation
Assembly: Metalama.Patterns.Caching.Backend.dll
Syntax
public abstract class CachingBackendEnhancer : CachingBackend, IDisposable, IAsyncDisposable
Remarks

The default behavior of all methods of a CachingBackendEnhancer is to delegate the implementation to the next CachingBackend in the chain of responsibility.

Constructors

Name Description
CachingBackendEnhancer(CachingBackend, CachingBackendConfiguration?)

Initializes a new instance of the CachingBackendEnhancer class.

Properties

Name Description
UnderlyingBackend

Gets the next CachingBackend in the chain of responsibility.

Methods

Name Description
ClearAsyncCore(ClearCacheOptions, CancellationToken)

Asynchronously clears the cache. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked.

ClearCore(ClearCacheOptions)

Clears the cache. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked.

ContainsDependencyAsyncCore(string, CancellationToken)

Asynchronously determines whether the cache contains a given dependency. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

ContainsDependencyCore(string)

Determines whether the cache contains a given dependency. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

ContainsItemAsyncCore(string, CancellationToken)

Asynchronously determines whether the cache contains an item of a given key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

ContainsItemCore(string)

Determines whether the cache contains an item of a given key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

CreateFeatures()

Creates a CachingBackendFeatures object, which describes set of features implemented by the back-end. This method is invoked the first time the SupportedFeatures property is evaluated. The result is then cached.

DisposeAsyncCore(CancellationToken)

Asynchronously disposes the current CachingBackend. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked.

DisposeCore(bool, CancellationToken)

Synchronously disposes the current CachingBackend. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked.

GetItemAsyncCore(string, bool, CancellationToken)

Asynchronously gets a cache item given its key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

GetItemCore(string, bool)

Gets a cache item given its key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

InitializeCore()
InitializeCoreAsync(CancellationToken)
InvalidateDependencyAsyncCore(string, CancellationToken)

Asynchronously removes from the cache all items that have a specific dependency. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

InvalidateDependencyCore(string)

Removes from the cache all items that have a specific dependency. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

OnBackendDependencyInvalidated(object?, CacheDependencyInvalidatedEventArgs)

Method invoked when the DependencyInvalidated event of the next UnderlyingBackend in the chain of responsibility is invoked.

OnBackendItemRemoved(object?, CacheItemRemovedEventArgs)

Method invoked when the ItemRemoved event of the next UnderlyingBackend in the chain of responsibility is invoked.

RemoveItemAsyncCore(string, CancellationToken)

Asynchronously removes a cache item from the cache given its key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

RemoveItemCore(string)

Removes a cache item from the cache given its key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

SetItemAsyncCore(string, CacheItem, CancellationToken)

Asynchronously sets a cache item. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. The default implementation is to call the synchronous SetItemCore(string, CacheItem) method.

SetItemCore(string, CacheItem)

Sets a cache item. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.

Extension Methods