VENTES: 1-800-867-1389
EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

DataCache Class

The object that is used by cache-enabled applications for storing and retrieving objects from the cache. An instance of this object is referred to as the cache client.

System..::..Object
  Microsoft.ApplicationServer.Caching..::..DataCache

Namespace:  Microsoft.ApplicationServer.Caching
Assembly:  Microsoft.ApplicationServer.Caching.Client (in Microsoft.ApplicationServer.Caching.Client.dll)

public sealed class DataCache

The DataCache type exposes the following members.

  NameDescription
Public methodDataCache()()()()Creates a DataCache that accesses the "default" cache; uses settings in the "default" cache client configuration.
Public methodDataCache(String)Creates a DataCache that accesses the specified cache name; uses settings in the "default" cache client configuration.
Public methodDataCache(String, String)Creates a DataCache that accesses the specified cache name; uses settings in the named cache client configuration.
Top

  NameDescription
Public propertyItemAllows for the use of array notation to access cached objects.
Public propertyNameThe name of the cache associated with the DataCache object.
Top

  NameDescription
Public methodAdd(String, Object)Adds an object to the cache.
Public methodAdd(String, Object, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds an object to the cache. This method enables associating tags with the cached object. Applies only to the server versions of AppFabric.
Public methodAdd(String, Object, String)Adds an object to a region in the cache. Applies only to the server versions of AppFabric.
Public methodAdd(String, Object, TimeSpan)Adds an object to the cache. This method provides the ability to specify when the object should be expired.
Public methodAdd(String, Object, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds an object to a region in the cache. This method enables association of tags with objects in the cache. Applies only to the server versions of AppFabric.
Public methodAdd(String, Object, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds an object to the cache. This method enables associating tags with the cached object and specifying when the object should be expired. Applies only to the server versions of AppFabric.
Public methodAdd(String, Object, TimeSpan, String)Adds an object to a region in the cache. This method provides the ability to specify when the object should be expired. Applies only to the server versions of AppFabric.
Public methodAdd(String, Object, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds an object to a region in the cache. This method enables associating tags with the cached object and specifying when the object should be expired. Applies only to the server versions of AppFabric.
Public methodAddCacheLevelBulkCallbackAdds a bulk cache notification callback for cache operations occurring on all regions and items. Applies only to the server versions of AppFabric.
Public methodAddCacheLevelCallbackAdds a cache notification callback for cache operations occurring on all regions and items. Applies only to the server versions of AppFabric.
Public methodAddFailureNotificationCallbackAdds a failure notification callback, for notifications indicating that a client has missed one or more cache notifications. Applies only to the server versions of AppFabric.
Public methodAddItemLevelCallback(String, DataCacheOperations, DataCacheNotificationCallback)Adds a cache notification callback for cache operations occurring on one specific item that is not stored in a region. Applies only to the server versions of AppFabric.
Public methodAddItemLevelCallback(String, DataCacheOperations, DataCacheNotificationCallback, String)Adds a cache notification callback for cache operations occurring on one specific item that is stored in region. Applies only to the server versions of AppFabric.
Public methodAddRegionLevelCallbackAdds a cache notification callback for cache operations occurring on one specific region. Applies only to the server versions of AppFabric.
Public methodAppend(String, String)Concatenates a string to a string object stored in the cache.
Public methodAppend(String, String, String)Concatenates a string to a string object stored in the cache in the specified region.
Public methodBulkGet(IEnumerable<(Of <<'(String>)>>))Gets all of the objects associated with the specified keys across all system regions. This method does not search user-defined regions.
Public methodBulkGet(IEnumerable<(Of <<'(String>)>>), String)Returns objects for the specified keys from the specified region of the cache. Applies only to the server versions of AppFabric.
Public methodClearRemoves all objects from the cache associated with the DataCache object.
Public methodClearRegionDeletes all objects in the specified region. Applies only to the server versions of AppFabric.
Public methodCreateRegionCreates a region. Applies only to the server versions of AppFabric.
Public methodDecrement(String, Int64, Int64)Decrements a long value stored in the cache.
Public methodDecrement(String, Int64, Int64, String)Decrements a long value stored in the cache in the specified region.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGet(String)Gets an object from the cache using the specified key.
Public methodGet(String, DataCacheItemVersion%)Gets an object from the cache using the specified key. You may also provide the version to obtain a specific version of a key, if that version is still the most current in the cache.
Public methodGet(String, String)Gets an object from the specified region by using the specified key. Applies only to the server versions of AppFabric.
Public methodGet(String, DataCacheItemVersion%, String)Gets an object from the specified region by using the specified key. You may also provide the version to obtain the specific version of a key, if that version is still the most current in the region. Applies only to the server versions of AppFabric.
Public methodGetAndLock(String, TimeSpan, DataCacheLockHandle%)Locks the key if the key is present and it is not locked and returns the object corresponding to the key.
Public methodGetAndLock(String, TimeSpan, DataCacheLockHandle%, Boolean)Lock the key if key is present and it is not locked by any clients and returns the object corresponding to the key.
Public methodGetAndLock(String, TimeSpan, DataCacheLockHandle%, String)Locks the key if the key is present and is not locked and returns the object corresponding to the key. For objects stored in regions. Applies only to the server versions of AppFabric.
Public methodGetAndLock(String, TimeSpan, DataCacheLockHandle%, String, Boolean)Lock the key if key is present and it is not locked by any clients and returns the object corresponding to the key. For objects stored in regions. Applies only to the server versions of AppFabric.
Public methodGetCacheItem(String)Gets a DataCacheItem object to retrieve all information associated with your cached object in the cluster.
Public methodGetCacheItem(String, String)Gets a DataCacheItem object to retrieve all information associated with your cached object in the cluster. For objects stored in regions. Applies only to the server versions of AppFabric.
Public methodGetHashCode (Inherited from Object.)
Public methodGetIfNewer(String, DataCacheItemVersion%)Gets an object from the cache, but only if a newer version of the object resides in the cache.
Public methodGetIfNewer(String, DataCacheItemVersion%, String)Gets an object from the specified region, but only if a newer version of the object resides in the region. Applies only to the server versions of AppFabric.
Public methodGetObjectsByAllTagsGets an enumerable list of all cached objects in the specified region that have all the same tags in common. Applies only to the server versions of AppFabric.
Public methodGetObjectsByAnyTagGets an enumerable list of all cached objects in the specified region that have any of the same tags in common. Applies only to the server versions of AppFabric.
Public methodGetObjectsByTagGets an enumerable list of all cached objects in the specified region that have the specified tag. Applies only to the server versions of AppFabric.
Public methodGetObjectsInRegionGets an enumerable list of all cached objects in the specified region. Applies only to the server versions of AppFabric.
Public methodGetSystemRegionNameReturns the system region name for the specified key. Applies only to the server versions of AppFabric.
Public methodGetSystemRegionsUsed to determine the default regions for the cache. Applies only to the server versions of AppFabric.
Public methodGetType (Inherited from Object.)
Public methodIncrement(String, Int64, Int64)Increments a long value stored in the cache.
Public methodIncrement(String, Int64, Int64, String)Increments a long value stored in the cache in the specified region.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodPrepend(String, String)Prepends a string to a string object stored in the cache.
Public methodPrepend(String, String, String)Prepends a string to a string object stored in the cache in the specified region.
Public methodPut(String, Object)Adds or replaces an object in the cache.
Public methodPut(String, Object, DataCacheItemVersion)Adds or replaces an object in the cache if it is at the specified version.
Public methodPut(String, Object, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds or replaces an object in the cache. Associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, String)Adds or replaces an object in the specified region. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, TimeSpan)Adds or replaces an object in the cache. Specifies the timeout value of the cached object.
Public methodPut(String, Object, DataCacheItemVersion, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds or replaces an object in the cache if it is at the specified version. Associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, DataCacheItemVersion, String)Adds or replaces an object in the specified region if it is at the specified version. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, DataCacheItemVersion, TimeSpan)Adds or replaces an object in the cache if it is at the specified version. Specifies the timeout value of the cached object.
Public methodPut(String, Object, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds or replaces an object in the specified region. Associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds or replaces an object in the cache. Specifies the timeout value and associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, TimeSpan, String)Adds or replaces an object in the specified region. Specifies the timeout value of the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, DataCacheItemVersion, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds or replaces an object in the specified region if it is at the specified version. Associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, DataCacheItemVersion, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>))Adds or replaces an object in the cache if it is at the specified version. Specifies the timeout value and associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, DataCacheItemVersion, TimeSpan, String)Adds or replaces an object in the specified region if it is at the specified version. Specifies the timeout value of the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds or replaces an object in the specified region. Specifies the timeout value and associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPut(String, Object, DataCacheItemVersion, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Adds or replaces an object in the specified region if it is at the specified version. Specifies the timeout value and associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle)Replaces and unlocks an object in the cache.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, IEnumerable<(Of <<'(DataCacheTag>)>>))Replaces and unlocks an object in the cache. Associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, String)Replaces and unlocks an object in the specified region. Applies only to the server versions of AppFabric.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan)Replaces and unlocks an object in the cache. Specifies the timeout value of the cached object.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Replaces and unlocks an object in the specified region. Associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>))Replaces and unlocks an object in the cache. Specifies the timeout value and associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan, String)Replaces and unlocks an object in the specified region. Specifies the timeout value of the cached object. Applies only to the server versions of AppFabric.
Public methodPutAndUnlock(String, Object, DataCacheLockHandle, TimeSpan, IEnumerable<(Of <<'(DataCacheTag>)>>), String)Replaces and unlocks an object in the specified region. Specifies the timeout value and associates tags with the cached object. Applies only to the server versions of AppFabric.
Public methodRemove(String)Removes an object from the cache.
Public methodRemove(String, DataCacheItemVersion)Removes an object with a specific version from the cache.
Public methodRemove(String, DataCacheLockHandle)Removes an object from the cache with an associated lock handle.
Public methodRemove(String, String)Removes an object from the cache in a region. Applies only to the server versions of AppFabric.
Public methodRemove(String, DataCacheItemVersion, String)Removes an object with a specific version from the cache in a region. Applies only to the server versions of AppFabric.
Public methodRemove(String, DataCacheLockHandle, String)Removes an object from the cache with an associated lock handle in a region. Applies only to the server versions of AppFabric.
Public methodRemoveCallbackRemoves a cache notification callback. Applies only to the server versions of AppFabric.
Public methodRemoveRegionDeletes a region. All cached objects inside the region are also removed. Applies only to the server versions of AppFabric.
Public methodResetObjectTimeout(String, TimeSpan)Resets the object timeout value, defining how long objects reside in the cache before expiring. The value specified for the object overrides the default settings for the cache.
Public methodResetObjectTimeout(String, TimeSpan, String)Resets the object timeout value, defining how long objects reside in the region before expiring. The value specified for the object overrides the default settings for the cache.
Public methodToString (Inherited from Object.)
Public methodUnlock(String, DataCacheLockHandle)Releases objects locked in the cache. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object.
Public methodUnlock(String, DataCacheLockHandle, String)Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Applies only to the server versions of AppFabric.
Public methodUnlock(String, DataCacheLockHandle, TimeSpan)Releases objects locked in the cache. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object.
Public methodUnlock(String, DataCacheLockHandle, TimeSpan, String)Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object. Applies only to the server versions of AppFabric.
Top

  NameDescription
Public eventCacheOperationCompletedInfrastructure. Internal.
Public eventCacheOperationStartedInfrastructure. Internal.
Top

There are multiple options for cache clients, which are specified in the application configuration settings. For more information, see Developing Cache Clients (Windows Azure AppFabric Caching).

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Cela vous a-t-il été utile ?
(1500 caractères restants)
Merci pour vos suggestions.
Afficher:
© 2014 Microsoft