Provides access to a collection of cached objects that is identified by a provided
cache name. The GetCache(String) method must be used to
instantiate a NamedCache collection.
Inheritance Hierarchy
Soss.ClientCacheFactory
Namespace: Soss.Client
Assembly: soss_namedcache (in soss_namedcache.dll) Version: 6.2.0.0
Syntax
The CacheFactory type exposes the following members.
Methods
Name | Description | |
---|---|---|
GetCache |
Create a cache using the default application id.
| |
GetCache(String) |
Creates a NamedCache instance, associating the collection with the provided string identifier.
| |
GetCache(UInt32) |
Creates a NamedCache instance, associating the collection with the provided application ID.
| |
GetCache(StateServerKey) |
Creates a named cache using the application id extracted from a StateServerKey instance.
|
Events
Name | Description | |
---|---|---|
NamedCacheCreated |
An event that fires when a new NamedCache is created by the CacheFactory before its first use. You may hook this event to initialize
NamedCache settings before the cache's first use.
|
Remarks
Examples
using System; using Soss.Client; class Program { static void Main(string[] args) { // Use the cache factory to access a named cache in the StateServer object store: NamedCache cache = CacheFactory.GetCache("namedCache"); // Add an object to the cache: cache.Add("key", "This is an object in the named cache."); // Read and lock the object in the server: cache.Retrieve("key", true); // Update and unlock: cache.Update("key", "This is an update to the object", true); // Remove from the cache: cache.Remove("key"); } }
See Also