Show / Hide Table of Contents

Class AbstractEvictionPolicy

An abstract base class for custom cache eviction policies.

Inheritance
object
AbstractEvictionPolicy
Implements
IEvictionPolicy
ICacheListener
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Tangosol.Net.Cache
Assembly: Coherence.dll
Syntax
public abstract class AbstractEvictionPolicy : IEvictionPolicy, ICacheListener

Properties

Cache

Return the IConfigurableCache that uses this eviction policy.

Declaration
protected IConfigurableCache Cache { get; }
Property Value
Type Description
IConfigurableCache

The IConfigurableCache or null if a cache event has not yet been processed by this eviction policy.

Remarks

The IConfigurableCache is set the first time a cache event is processed by the eviction policy.

Name

Obtain the name of the eviction policy.

Declaration
public virtual string Name { get; }
Property Value
Type Description
string

The name of the eviction policy.

Methods

EnsureCache(CacheEventArgs)

Return the IConfigurableCache that uses this eviction policy.

Declaration
protected virtual IConfigurableCache EnsureCache(CacheEventArgs evt)
Parameters
Type Name Description
CacheEventArgs evt

The CacheEventArgs raised by the LocalCache that uses this eviction policy.

Returns
Type Description
IConfigurableCache

The LocalCache that uses this eviction policy.

Remarks

If the LocalCache property has not been intialized, it is set to the LocalCache that raised the given event.

EntryDeleted(CacheEventArgs)

Invoked when a cache entry has been deleted.

Declaration
public virtual void EntryDeleted(CacheEventArgs evt)
Parameters
Type Name Description
CacheEventArgs evt

The CacheEventArgs carrying the remove information.

EntryInserted(CacheEventArgs)

Invoked when a cache entry has been inserted.

Declaration
public virtual void EntryInserted(CacheEventArgs evt)
Parameters
Type Name Description
CacheEventArgs evt

The CacheEventArgs carrying the insert information.

EntryTouched(IConfigurableCacheEntry)

This method is called by the cache to indicate that an entry has been touched.

Declaration
public abstract void EntryTouched(IConfigurableCacheEntry entry)
Parameters
Type Name Description
IConfigurableCacheEntry entry

The IConfigurableCacheEntry that has been touched.

EntryUpdated(CacheEventArgs)

Invoked when a cache entry has been updated.

Declaration
public virtual void EntryUpdated(CacheEventArgs evt)
Parameters
Type Name Description
CacheEventArgs evt

The CacheEventArgs carrying the update information.

EntryUpdated(IConfigurableCacheEntry)

This method is called to indicate that an entry has been either inserted or updated.

Declaration
public abstract void EntryUpdated(IConfigurableCacheEntry entry)
Parameters
Type Name Description
IConfigurableCacheEntry entry

The cache entry that has been updated.

GetEntry(CacheEventArgs)

Return the cache entry associated with the given cache event.

Declaration
protected virtual IConfigurableCacheEntry GetEntry(CacheEventArgs evt)
Parameters
Type Name Description
CacheEventArgs evt

A cache event raised by the IConfigurableCache that uses this eviction policy.

Returns
Type Description
IConfigurableCacheEntry

The cache entry associated with the given event.

RequestEviction(long)

This method is called by the cache when the cache requires the eviction policy to evict entries.

Declaration
public abstract void RequestEviction(long maximum)
Parameters
Type Name Description
long maximum

The maximum number of units that should remain in the cache when the eviction is complete.

Implements

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