Show / Hide Table of Contents

Interface INamedCache

An INamedCache is an ICache that adds lifecycle management, event support, concurrency control, the ability to query cache content, and entry-targeted processing and aggregating operations.

Inherited Members
IObservableCache.AddCacheListener(ICacheListener)
IObservableCache.RemoveCacheListener(ICacheListener)
IObservableCache.AddCacheListener(ICacheListener, object, bool)
IObservableCache.RemoveCacheListener(ICacheListener, object)
IObservableCache.AddCacheListener(ICacheListener, IFilter, bool)
IObservableCache.RemoveCacheListener(ICacheListener, IFilter)
IConcurrentCache.Lock(object, long)
IConcurrentCache.Lock(object)
IConcurrentCache.Unlock(object)
IQueryCache.GetKeys(IFilter)
IQueryCache.GetValues(IFilter)
IQueryCache.GetValues(IFilter, IComparer)
IQueryCache.GetEntries(IFilter)
IQueryCache.GetEntries(IFilter, IComparer)
IQueryCache.AddIndex(IValueExtractor, bool, IComparer)
IQueryCache.RemoveIndex(IValueExtractor)
IInvocableCache.Invoke(object, IEntryProcessor)
IInvocableCache.InvokeAll(ICollection, IEntryProcessor)
IInvocableCache.InvokeAll(IFilter, IEntryProcessor)
IInvocableCache.Aggregate(ICollection, IEntryAggregator)
IInvocableCache.Aggregate(IFilter, IEntryAggregator)
ICache.GetAll(ICollection)
ICache.Insert(object, object)
ICache.Insert(object, object, long)
ICache.InsertAll(IDictionary)
ICache.Entries
ICache.GetEnumerator()
IDictionary.Add(object, object)
IDictionary.Clear()
IDictionary.Contains(object)
IDictionary.Remove(object)
IDictionary.IsFixedSize
IDictionary.IsReadOnly
IDictionary.this[object]
IDictionary.Keys
IDictionary.Values
ICollection.CopyTo(Array, int)
ICollection.Count
ICollection.IsSynchronized
ICollection.SyncRoot
IDisposable.Dispose()
Namespace: Tangosol.Net
Assembly: Coherence.dll
Syntax
public interface INamedCache : IObservableCache, IConcurrentCache, IQueryCache, IInvocableCache, ICache, IDictionary, ICollection, IEnumerable, IDisposable
Remarks

Cached resources are expected to be managed in memory, and are typically composed of data that are stored persistently in a database, or data that have been assembled or calculated at some significant cost, thus these resources are referred to as cached.

Properties

CacheName

Gets the cache name.

Declaration
string CacheName { get; }
Property Value
Type Description
string

The cache name.

CacheService

Gets the ICacheService that this INamedCache is a part of.

Declaration
ICacheService CacheService { get; }
Property Value
Type Description
ICacheService

The cache service this INamedCache is a part of.

IsActive

Specifies whether or not the INamedCache is active.

Declaration
bool IsActive { get; }
Property Value
Type Description
bool

true if the INamedCache is active; false otherwise.

Methods

Destroy()

Release and destroy this instance of INamedCache.

Declaration
void Destroy()
Remarks

Warning: This method is used to completely destroy the specified cache across the cluster. All references in the entire cluster to this cache will be invalidated, the cached data will be cleared, and all resources will be released.

Caches should be destroyed by the same mechansim in which they were obtained. For example:

  • new Cache() - cache.Destroy()
  • CacheFactory.GetCache() - CacheFactory.DestroyCache()
  • ConfigurableCacheFactory.EnsureCache() - ConfigurableCacheFactory.DestroyCache()
Except for the case where the application code expicitly allocated the cache, this method should not be called by application code.

Release()

Release local resources associated with this instance of INamedCache.

Declaration
void Release()
Remarks

Releasing a cache makes it no longer usable, but does not affect the cache itself. In other words, all other references to the cache will still be valid, and the cache data is not affected by releasing the reference. Any attempt to use this reference afterword will result in an exception.

Caches should be released by the same mechansim in which they were obtained. For example:

  • new Cache() - cache.Release()
  • CacheFactory.GetCache() - CacheFactory.ReleaseCache()
  • ConfigurableCacheFactory.EnsureCache() - ConfigurableCacheFactory.ReleaseCache()
Except for the case where the application code expicitly allocated the cache, this method should not be called by application code.

Truncate()

Removes all mappings from this map.

Declaration
void Truncate()
Remarks

Note: the removal of entries caused by this truncate operation will not be observable.

View()

Construct a view of this INamedCache.

Declaration
ViewBuilder View()
Returns
Type Description
ViewBuilder

A local view for this INamedCache

Extension Methods

InvocableCacheEx.GetOrDefault(IInvocableCache, object, object)
InvocableCacheEx.InsertIfAbsent(IInvocableCache, object, object)
InvocableCacheEx.Remove(IInvocableCache, object, object)
InvocableCacheEx.Replace(IInvocableCache, object, object)
InvocableCacheEx.Replace(IInvocableCache, object, object, object)
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.