Class CacheBackplane
In CacheManager, a cache backplane is used to keep in process and distributed caches in
sync.
If the cache manager runs inside multiple nodes or applications accessing the
same distributed cache, and an in process cache is configured to be in front of the
distributed cache handle. All Get calls will hit the in process cache.
Now when an
item gets removed for example by one client, all other clients still have that cache item
available in the in process cache.
This could lead to errors and unexpected behavior,
therefore a cache backplane will send a message to all other cache clients to also remove
that item.
The same mechanism will apply to any Update, Put, Remove, Clear or ClearRegion call of the cache.
Inherited Members
Namespace:CacheManager.Core.Internal
Assembly:CacheManager.Core.dll
Syntax
public abstract class CacheBackplane : IDisposable
Constructors
| Improve this Doc View SourceCacheBackplane(ICacheManagerConfiguration)
Initializes a new instance of the CacheBackplane class.
Declaration
protected CacheBackplane(ICacheManagerConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
ICacheManagerConfiguration | configuration | The cache manager configuration. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If configuration is null. |
Properties
| Improve this Doc View SourceCacheConfiguration
Gets the cache configuration.
Declaration
public ICacheManagerConfiguration CacheConfiguration { get; }
Property Value
Type | Description |
---|---|
ICacheManagerConfiguration | The cache configuration. |
ConfigurationKey
Gets the name of the configuration to be used.
The key might be used to find cache vendor specific configuration.
Declaration
public string ConfigurationKey { get; }
Property Value
Type | Description |
---|---|
String | The configuration key. |
Methods
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Implements
| Improve this Doc View SourceDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool managed)
Parameters
Type | Name | Description |
---|---|---|
Boolean | managed |
|
Finalize()
Finalizes an instance of the CacheBackplane class.
Declaration
protected void Finalize()
NotifyChange(String, CacheItemChangedEventAction)
Notifies other cache clients about a changed cache key.
Declaration
public abstract void NotifyChange(string key, CacheItemChangedEventAction action)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
CacheItemChangedEventAction | action | The action. |
NotifyChange(String, String, CacheItemChangedEventAction)
Notifies other cache clients about a changed cache key.
Declaration
public abstract void NotifyChange(string key, string region, CacheItemChangedEventAction action)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
String | region | The region. |
CacheItemChangedEventAction | action | The action. |
NotifyClear()
Notifies other cache clients about a cache clear.
Declaration
public abstract void NotifyClear()
NotifyClearRegion(String)
Notifies other cache clients about a cache clear region call.
Declaration
public abstract void NotifyClearRegion(string region)
Parameters
Type | Name | Description |
---|---|---|
String | region | The region. |
NotifyRemove(String)
Notifies other cache clients about a removed cache key.
Declaration
public abstract void NotifyRemove(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
NotifyRemove(String, String)
Notifies other cache clients about a removed cache key.
Declaration
public abstract void NotifyRemove(string key, string region)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
String | region | The region. |
TriggerChanged(String, CacheItemChangedEventAction)
Sends a changed message for the given key.
Declaration
protected void TriggerChanged(string key, CacheItemChangedEventAction action)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
CacheItemChangedEventAction | action | The action. |
TriggerChanged(String, String, CacheItemChangedEventAction)
Sends a changed message for the given key in region.
Declaration
protected void TriggerChanged(string key, string region, CacheItemChangedEventAction action)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
String | region | The region. |
CacheItemChangedEventAction | action | The action. |
TriggerCleared()
Sends a cache cleared message.
Declaration
protected void TriggerCleared()
TriggerClearedRegion(String)
Sends a region cleared message for the given region.
Declaration
protected void TriggerClearedRegion(string region)
Parameters
Type | Name | Description |
---|---|---|
String | region | The region. |
TriggerRemoved(String)
Sends a removed message for the given key.
Declaration
protected void TriggerRemoved(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key |
TriggerRemoved(String, String)
Sends a removed message for the given key in region.
Declaration
protected void TriggerRemoved(string key, string region)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
String | region | The region. |