Eksportuj (0) Drukuj
Rozwiń wszystko
EN
Ta zawartość nie jest dostępna w wymaganym języku. Wersja w języku angielskim znajduje się tutaj.
Ten temat nie został jeszcze oceniony - Oceń ten temat

DataCacheNotificationCallback Delegate

Represents a callback method that is to be invoked by a cache notification when one or more cache operations take place. Applies only to the server versions of AppFabric.

Namespace:  Microsoft.ApplicationServer.Caching
Assembly:  Microsoft.ApplicationServer.Caching.Client (in Microsoft.ApplicationServer.Caching.Client.dll)
public delegate void DataCacheNotificationCallback(
	string cacheName,
	string regionName,
	string key,
	DataCacheItemVersion version,
	DataCacheOperations cacheOperation,
	DataCacheNotificationDescriptor nd
)

Parameters

cacheName
Type: System..::..String
regionName
Type: System..::..String
The name of the region associated with the cache operation. A zero-length string indicates that a specific region is not associated with the cache operation.
key
Type: System..::..String
The name of the key associated with the cache operation. A zero-length string indicates that a specific cached item is not associated with the cache operation.
version
Type: Microsoft.ApplicationServer.Caching..::..DataCacheItemVersion
The DataCacheItemVersion of the cached object associated with the cache operation that triggered the notification. A null version indicates that a specific cached item is not associated with the cache operation.
cacheOperation
Type: Microsoft.ApplicationServer.Caching..::..DataCacheOperations
The DataCacheOperations enumeration specifying which cache event triggered the cache notification.
nd
Type: Microsoft.ApplicationServer.Caching..::..DataCacheNotificationDescriptor
The DataCacheNotificationDescriptor object associated with the cache notification that invoked the delegate method.

Adding a cache notification callback requires two steps. First, create a method that should be invoked when a cache notification is triggered by one or more cache operations. The method you invoke with the cache notifications must accept the same parameters as the DataCacheNotificationCallback delegate. Second, add a callback using one of the three available methods from the DataCache object: AddCacheLevelCallback(DataCacheOperation, DataCacheNotificationCallback), AddRegionLevelCallback(String, DataCacheOperation, DataCacheNotificationCallback), or [Override:Microsoft.ApplicationServer.Caching.DataCache.AddItemLevelCallback].

NoteNote

In order for your application to use notifications, you need to enable them on a named cache. In Microsoft AppFabric 1.1 for Windows Server Caching, use the notificationsEnabled parameter with the New-Cache or Set-CacheConfig Windows PowerShell commands. In Windows Azure Caching, enable notifications in the Caching configuration of the role that hosts the cache.

The DataCacheNotificationDescriptor object passed to the delegate method with the nd parameter can be used to unsubscribe from the cache notification. For more information, see .

Czy oceniasz te materiały jako pomocne?
(Pozostało znaków: 1500)
Dziękujemy za opinię.

Zawartość społeczności

Dodaj
Pokaż:
© 2014 Microsoft. Wszelkie prawa zastrzeżone.