Class BaseCacheManager<TCacheValue>
Inheritance
BaseCacheManager<TCacheValue>
Namespace:CacheManager.Core
Assembly:CacheManager.Core.dll
Syntax
public sealed class BaseCacheManager<TCacheValue> : BaseCache<TCacheValue>, ICacheManager<TCacheValue>, ICache<TCacheValue>, IDisposable
Type Parameters
Name |
Description |
TCacheValue |
The type of the cache value.
|
Constructors
|
Improve this Doc
View Source
BaseCacheManager(ICacheManagerConfiguration)
Initializes a new instance of the BaseCacheManager<TCacheValue> class
using the specified configuration.
If the name of the configuration is defined, the cache manager will
use it. Otherwise a random string will be generated.
Declaration
public BaseCacheManager(ICacheManagerConfiguration configuration)
Parameters
Type |
Name |
Description |
ICacheManagerConfiguration |
configuration |
The configuration which defines the structure and complexity of the cache manager.
|
Exceptions
Properties
|
Improve this Doc
View Source
Backplane
Gets the configured cache backplane.
Declaration
public CacheBackplane Backplane { get; }
Property Value
|
Improve this Doc
View Source
CacheHandles
Declaration
public IEnumerable<BaseCacheHandle<TCacheValue>> CacheHandles { get; }
Property Value
Implements
|
Improve this Doc
View Source
Configuration
Declaration
public IReadOnlyCacheManagerConfiguration Configuration { get; }
Property Value
Implements
|
Improve this Doc
View Source
Logger
Declaration
protected override ILogger Logger { get; }
Property Value
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.Logger
|
Improve this Doc
View Source
Name
Declaration
public string Name { get; }
Property Value
Type |
Description |
String |
The name of the cache.
|
Implements
Methods
|
Improve this Doc
View Source
AddInternal(CacheItem<TCacheValue>)
Declaration
protected override bool AddInternal(CacheItem<TCacheValue> item)
Parameters
Type |
Name |
Description |
CacheItem<TCacheValue> |
item |
|
Returns
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.AddInternal(CacheManager.Core.CacheItem<TCacheValue>)
|
Improve this Doc
View Source
AddOrUpdate(CacheItem<TCacheValue>, Func<TCacheValue, TCacheValue>)
Declaration
public TCacheValue AddOrUpdate(CacheItem<TCacheValue> addItem, Func<TCacheValue, TCacheValue> updateValue)
Parameters
Type |
Name |
Description |
CacheItem<TCacheValue> |
addItem |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
AddOrUpdate(CacheItem<TCacheValue>, Func<TCacheValue, TCacheValue>, Int32)
Declaration
public TCacheValue AddOrUpdate(CacheItem<TCacheValue> addItem, Func<TCacheValue, TCacheValue> updateValue, int maxRetries)
Parameters
Type |
Name |
Description |
CacheItem<TCacheValue> |
addItem |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Int32 |
maxRetries |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
AddOrUpdate(String, TCacheValue, Func<TCacheValue, TCacheValue>)
Declaration
public TCacheValue AddOrUpdate(string key, TCacheValue addValue, Func<TCacheValue, TCacheValue> updateValue)
Parameters
Type |
Name |
Description |
String |
key |
|
TCacheValue |
addValue |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
AddOrUpdate(String, TCacheValue, Func<TCacheValue, TCacheValue>, Int32)
Declaration
public TCacheValue AddOrUpdate(string key, TCacheValue addValue, Func<TCacheValue, TCacheValue> updateValue, int maxRetries)
Parameters
Type |
Name |
Description |
String |
key |
|
TCacheValue |
addValue |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Int32 |
maxRetries |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
AddOrUpdate(String, String, TCacheValue, Func<TCacheValue, TCacheValue>)
Declaration
public TCacheValue AddOrUpdate(string key, string region, TCacheValue addValue, Func<TCacheValue, TCacheValue> updateValue)
Parameters
Type |
Name |
Description |
String |
key |
|
String |
region |
|
TCacheValue |
addValue |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
AddOrUpdate(String, String, TCacheValue, Func<TCacheValue, TCacheValue>, Int32)
Declaration
public TCacheValue AddOrUpdate(string key, string region, TCacheValue addValue, Func<TCacheValue, TCacheValue> updateValue, int maxRetries)
Parameters
Type |
Name |
Description |
String |
key |
|
String |
region |
|
TCacheValue |
addValue |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Int32 |
maxRetries |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
Clear()
Declaration
public override void Clear()
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.Clear()
Implements
|
Improve this Doc
View Source
ClearRegion(String)
Declaration
public override void ClearRegion(string region)
Parameters
Type |
Name |
Description |
String |
region |
|
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.ClearRegion(System.String)
Implements
|
Improve this Doc
View Source
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposeManaged)
Parameters
Type |
Name |
Description |
Boolean |
disposeManaged |
|
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.Dispose(System.Boolean)
|
Improve this Doc
View Source
Exists(String)
Declaration
public override bool Exists(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.Exists(System.String)
Implements
|
Improve this Doc
View Source
Exists(String, String)
Declaration
public override bool Exists(string key, string region)
Parameters
Returns
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.Exists(System.String, System.String)
Implements
|
Improve this Doc
View Source
Expire(String, ExpirationMode, TimeSpan)
Declaration
public void Expire(string key, ExpirationMode mode, TimeSpan timeout)
Parameters
Implements
|
Improve this Doc
View Source
Expire(String, DateTimeOffset)
Declaration
public void Expire(string key, DateTimeOffset absoluteExpiration)
Parameters
Implements
|
Improve this Doc
View Source
Expire(String, String, ExpirationMode, TimeSpan)
Declaration
public void Expire(string key, string region, ExpirationMode mode, TimeSpan timeout)
Parameters
Implements
|
Improve this Doc
View Source
Expire(String, String, DateTimeOffset)
Declaration
public void Expire(string key, string region, DateTimeOffset absoluteExpiration)
Parameters
Implements
|
Improve this Doc
View Source
Expire(String, String, TimeSpan)
Declaration
public void Expire(string key, string region, TimeSpan slidingExpiration)
Parameters
Implements
|
Improve this Doc
View Source
Expire(String, TimeSpan)
Declaration
public void Expire(string key, TimeSpan slidingExpiration)
Parameters
Implements
|
Improve this Doc
View Source
GetCacheItemInternal(String)
Declaration
protected override CacheItem<TCacheValue> GetCacheItemInternal(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.GetCacheItemInternal(System.String)
|
Improve this Doc
View Source
GetCacheItemInternal(String, String)
Declaration
protected override CacheItem<TCacheValue> GetCacheItemInternal(string key, string region)
Parameters
Returns
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.GetCacheItemInternal(System.String, System.String)
|
Improve this Doc
View Source
GetOrAdd(String, TCacheValue)
Declaration
public TCacheValue GetOrAdd(string key, TCacheValue value)
Parameters
Type |
Name |
Description |
String |
key |
|
TCacheValue |
value |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
GetOrAdd(String, Func<String, TCacheValue>)
Declaration
public TCacheValue GetOrAdd(string key, Func<string, TCacheValue> valueFactory)
Parameters
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
GetOrAdd(String, String, TCacheValue)
Declaration
public TCacheValue GetOrAdd(string key, string region, TCacheValue value)
Parameters
Type |
Name |
Description |
String |
key |
|
String |
region |
|
TCacheValue |
value |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
GetOrAdd(String, String, Func<String, String, TCacheValue>)
Declaration
public TCacheValue GetOrAdd(string key, string region, Func<string, string, TCacheValue> valueFactory)
Parameters
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
PutInternal(CacheItem<TCacheValue>)
Declaration
protected override void PutInternal(CacheItem<TCacheValue> item)
Parameters
Type |
Name |
Description |
CacheItem<TCacheValue> |
item |
|
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.PutInternal(CacheManager.Core.CacheItem<TCacheValue>)
|
Improve this Doc
View Source
RemoveExpiration(String)
Declaration
public void RemoveExpiration(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Implements
|
Improve this Doc
View Source
RemoveExpiration(String, String)
Declaration
public void RemoveExpiration(string key, string region)
Parameters
Implements
|
Improve this Doc
View Source
RemoveInternal(String)
Declaration
protected override bool RemoveInternal(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.RemoveInternal(System.String)
|
Improve this Doc
View Source
RemoveInternal(String, String)
Declaration
protected override bool RemoveInternal(string key, string region)
Parameters
Returns
Overrides
CacheManager.Core.Internal.BaseCache<TCacheValue>.RemoveInternal(System.String, System.String)
|
Improve this Doc
View Source
ToString()
Returns a String that represents this instance.
Declaration
public override string ToString()
Returns
Type |
Description |
String |
A String that represents this instance.
|
Overrides
|
Improve this Doc
View Source
TryGetOrAdd(String, Func<String, TCacheValue>, out TCacheValue)
Declaration
public bool TryGetOrAdd(string key, Func<string, TCacheValue> valueFactory, out TCacheValue value)
Parameters
Type |
Name |
Description |
String |
key |
|
Func<String, TCacheValue> |
valueFactory |
|
TCacheValue |
value |
|
Returns
Implements
|
Improve this Doc
View Source
TryGetOrAdd(String, String, Func<String, String, TCacheValue>, out TCacheValue)
Declaration
public bool TryGetOrAdd(string key, string region, Func<string, string, TCacheValue> valueFactory, out TCacheValue value)
Parameters
Returns
Implements
|
Improve this Doc
View Source
TryUpdate(String, Func<TCacheValue, TCacheValue>, out TCacheValue)
Declaration
public bool TryUpdate(string key, Func<TCacheValue, TCacheValue> updateValue, out TCacheValue value)
Parameters
Type |
Name |
Description |
String |
key |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
TCacheValue |
value |
|
Returns
Implements
|
Improve this Doc
View Source
TryUpdate(String, Func<TCacheValue, TCacheValue>, Int32, out TCacheValue)
Declaration
public bool TryUpdate(string key, Func<TCacheValue, TCacheValue> updateValue, int maxRetries, out TCacheValue value)
Parameters
Type |
Name |
Description |
String |
key |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Int32 |
maxRetries |
|
TCacheValue |
value |
|
Returns
Implements
|
Improve this Doc
View Source
TryUpdate(String, String, Func<TCacheValue, TCacheValue>, out TCacheValue)
Declaration
public bool TryUpdate(string key, string region, Func<TCacheValue, TCacheValue> updateValue, out TCacheValue value)
Parameters
Type |
Name |
Description |
String |
key |
|
String |
region |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
TCacheValue |
value |
|
Returns
Implements
|
Improve this Doc
View Source
TryUpdate(String, String, Func<TCacheValue, TCacheValue>, Int32, out TCacheValue)
Declaration
public bool TryUpdate(string key, string region, Func<TCacheValue, TCacheValue> updateValue, int maxRetries, out TCacheValue value)
Parameters
Type |
Name |
Description |
String |
key |
|
String |
region |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Int32 |
maxRetries |
|
TCacheValue |
value |
|
Returns
Implements
|
Improve this Doc
View Source
Update(String, Func<TCacheValue, TCacheValue>)
Declaration
public TCacheValue Update(string key, Func<TCacheValue, TCacheValue> updateValue)
Parameters
Type |
Name |
Description |
String |
key |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
Update(String, Func<TCacheValue, TCacheValue>, Int32)
Declaration
public TCacheValue Update(string key, Func<TCacheValue, TCacheValue> updateValue, int maxRetries)
Parameters
Type |
Name |
Description |
String |
key |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Int32 |
maxRetries |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
Update(String, String, Func<TCacheValue, TCacheValue>)
Declaration
public TCacheValue Update(string key, string region, Func<TCacheValue, TCacheValue> updateValue)
Parameters
Type |
Name |
Description |
String |
key |
|
String |
region |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
|
Improve this Doc
View Source
Update(String, String, Func<TCacheValue, TCacheValue>, Int32)
Declaration
public TCacheValue Update(string key, string region, Func<TCacheValue, TCacheValue> updateValue, int maxRetries)
Parameters
Type |
Name |
Description |
String |
key |
|
String |
region |
|
Func<TCacheValue, TCacheValue> |
updateValue |
|
Int32 |
maxRetries |
|
Returns
Type |
Description |
TCacheValue |
|
Implements
Events
|
Improve this Doc
View Source
OnAdd
Declaration
public event EventHandler<CacheActionEventArgs> OnAdd
Event Type
Implements
|
Improve this Doc
View Source
OnClear
Declaration
public event EventHandler<CacheClearEventArgs> OnClear
Event Type
Implements
|
Improve this Doc
View Source
OnClearRegion
Declaration
public event EventHandler<CacheClearRegionEventArgs> OnClearRegion
Event Type
Implements
|
Improve this Doc
View Source
OnGet
Declaration
public event EventHandler<CacheActionEventArgs> OnGet
Event Type
Implements
|
Improve this Doc
View Source
OnPut
Declaration
public event EventHandler<CacheActionEventArgs> OnPut
Event Type
Implements
|
Improve this Doc
View Source
OnRemove
Declaration
public event EventHandler<CacheActionEventArgs> OnRemove
Event Type
Implements
|
Improve this Doc
View Source
OnRemoveByHandle
Declaration
public event EventHandler<CacheItemRemovedEventArgs> OnRemoveByHandle
Event Type
Implements
|
Improve this Doc
View Source
OnUpdate
Declaration
public event EventHandler<CacheActionEventArgs> OnUpdate
Event Type
Implements