Show / Hide Table of Contents

Interface IConfigurableCache

An extension to the ICache interface that supports runtime configuration and monitoring of various caching properties.

Inherited Members
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
Namespace: Tangosol.Net.Cache
Assembly: Coherence.dll
Syntax
public interface IConfigurableCache : ICache, IDictionary, ICollection, IEnumerable

Properties

EvictionPolicy

Get or set the eviction policy used by the cache.

Declaration
IEvictionPolicy EvictionPolicy { get; }
Property Value
Type Description
IEvictionPolicy

The eviction policy used by the cache.

ExpiryDelay

Get or set the default "time to live" for each individual cache entry.

Declaration
int ExpiryDelay { get; set; }
Property Value
Type Description
int

The number of milliseconds that a cache entry value will live, or zero if cache entries are never automatically expired.

Remarks

Change of this property does not affect the already-scheduled expiry of existing entries.

FlushDelay

Get or set the delay between cache flushes. A cache flush evicts entries that have expired.

Declaration
int FlushDelay { get; set; }
Property Value
Type Description
int

The number of milliseconds between cache flushes, or zero which signifies that the cache never flushes.

Remarks

This value is used by cache implementations that periodically evict entries that have expired; this value has no meaning for cache implementations that aggressively evict entries as they expire.

HighUnits

Get or set the limit of the cache size in units. The cache will prune itself automatically once it reaches its maximum unit level. This is often referred to as the "high water mark" of the cache.

Declaration
long HighUnits { get; set; }
Property Value
Type Description
long

The limit of the cache size in units.

LowUnits

Get or set the point to which the cache will shrink when it prunes. This is often referred to as a "low water mark" of the cache. If the cache incrementally prunes, then this setting will have no effect.

Declaration
long LowUnits { get; set; }
Property Value
Type Description
long

The number of units that the cache prunes to.

UnitCalculator

Get or set the unit calculator used by the cache.

Declaration
IUnitCalculator UnitCalculator { get; set; }
Property Value
Type Description
IUnitCalculator

The unit calculator used by the cache.

Units

Determine the number of units that the cache currently stores.

Declaration
long Units { get; }
Property Value
Type Description
long

The current size of the cache in units.

Methods

Evict()

Evict all entries from the cache that are no longer valid, and potentially prune the cache size if the cache is size-limited and its size is above the caching low water mark.

Declaration
void Evict()

Evict(object)

Evict a specified key from the cache, as if it had expired from the cache. If the key is not in the cache, then the method has no effect.

Declaration
void Evict(object oKey)
Parameters
Type Name Description
object oKey

The key to evict from the cache.

EvictAll(ICollection)

Evict the specified keys from the cache, as if they had each expired from the cache.

Declaration
void EvictAll(ICollection colKeys)
Parameters
Type Name Description
ICollection colKeys

A collection of keys to evict from the cache.

Remarks

The result of this method is defined to be semantically the same as the following implementation:

foreach (Object oKey in colKeys)
{
    Evict(oKey);
}

GetCacheEntry(object)

Locate a cache entry in the cache based on its key.

Declaration
IConfigurableCacheEntry GetCacheEntry(object key)
Parameters
Type Name Description
object key

The key object to search for.

Returns
Type Description
IConfigurableCacheEntry

The entry or null.

In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.