PostSharpAPI ReferencePost­Sharp.​Patterns.​Caching.​ImplementationCaching­Backend­Enhancer
Open sandboxFocus

CachingBackendEnhancer Class

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.

Implements
IDisposable
Namespace: PostSharp.Patterns.Caching.Implementation
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public abstract class CachingBackendEnhancer : CachingBackend
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)

Initializes a new CachingBackendEnhancer.

Properties

Name Description
UnderlyingBackend

Gets the next CachingBackend in the chain of responsibility.

Methods

Name Description
ClearAsyncCore(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()

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(Boolean)

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, Boolean, 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, Boolean)

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.

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.