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

TwoLayerCachingBackendEnhancer Class

A CachingBackendEnhancer that adds a local (fast) MemoryCachingBackend to a remote (slower) cache. This class is typically instantiate in the back-end factory method. You should normally not use this class unless you develop a custom caching back-end.

Inheritance
TwoLayerCachingBackendEnhancer
Implements
IDisposable
Namespace: PostSharp.Patterns.Caching.Backends
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public sealed class TwoLayerCachingBackendEnhancer : CachingBackendEnhancer

Constructors

Name Description
TwoLayerCachingBackendEnhancer(CachingBackend, MemoryCachingBackend)

Initializes a new TwoLayerCachingBackendEnhancer.

Properties

Name Description
LocalCache

Gets the in-memory local cache.

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.