DataCache.AddItemLevelCallback Method (String, DataCacheOperations, DataCacheNotificationCallback, String)

Adds a cache notification callback for cache operations occurring on one specific item that is stored in region.

Namespace: Microsoft.ApplicationServer.Caching
Assembly: Microsoft.ApplicationServer.Caching.Client (in microsoft.applicationserver.caching.client.dll)

Usage

'Usage
Dim instance As DataCache
Dim key As String
Dim filter As DataCacheOperations
Dim clientCallback As DataCacheNotificationCallback
Dim region As String
Dim returnValue As DataCacheNotificationDescriptor

returnValue = instance.AddItemLevelCallback(key, filter, clientCallback, region)

Syntax

'Declaration
Public MustOverride Function AddItemLevelCallback ( _
    key As String, _
    filter As DataCacheOperations, _
    clientCallback As DataCacheNotificationCallback, _
    region As String _
) As DataCacheNotificationDescriptor
public abstract DataCacheNotificationDescriptor AddItemLevelCallback (
    string key,
    DataCacheOperations filter,
    DataCacheNotificationCallback clientCallback,
    string region
)
public:
virtual DataCacheNotificationDescriptor^ AddItemLevelCallback (
    String^ key, 
    DataCacheOperations filter, 
    DataCacheNotificationCallback^ clientCallback, 
    String^ region
) abstract
public abstract DataCacheNotificationDescriptor AddItemLevelCallback (
    String key, 
    DataCacheOperations filter, 
    DataCacheNotificationCallback clientCallback, 
    String region
)
public abstract function AddItemLevelCallback (
    key : String, 
    filter : DataCacheOperations, 
    clientCallback : DataCacheNotificationCallback, 
    region : String
) : DataCacheNotificationDescriptor

Parameters

  • key
    The key used to store the object in the cache.
  • filter
    The type of cache operation(s) that will trigger cache notifications.
  • clientCallback
    The name of the method you want to invoke when these notifications occur.
  • region
    The name of the region where the object is stored.

Return Value

A DataCacheNotificationDescriptor object used to identify the cache notification callback.

Remarks

Only item operations AddItem, ReplaceItem, and RemoveItem can trigger cache notifications with item-level callbacks. Specifying region operations in the filter parameter will cause an exception.

Use the DataCacheOperations enumeration in the filter parameter to specify what type of item operations you want to trigger cache notifications. Select more than one enumeration by separating the enumerations with the binary OR operator to perform a bitwise OR. To do this, use the | character in C#, and the Or operator in Visual Basic.

The clientCallback method you invoke with the cache notification must accept the same parameters as the DataCacheNotificationCallback delegate.

For more information about using this method, see How to: Add a Cache Notification Callback. For more information about cache notifications, see Cache Notifications.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Visual Studio 2010 and later, .NET Framework 4

Target Platforms

Windows 7; Windows Server 2008 R2; Windows Server 2008 Service Pack 2; Windows Vista Service Pack 2

See Also

Reference

DataCache Class
DataCache Members
Microsoft.ApplicationServer.Caching Namespace

  ff425062(v=azure.10).md 2011-08-26