Class CacheSyncDependency
A client application can have more than one cache instances initialized. CacheSyncDependency keeps the items present in one cache synchronized with the items present in another cache.
Inheritance
Namespace:
Assembly: Alachisoft.NCache.Web.dll
Syntax
[Serializable]
public class CacheSyncDependency : ICompactSerializable
Remarks
You can add items with CacheSyncDependency to your application's cache with the Add(String, Object) and Insert(String, Object) methods.
When you add an item to an application's Cache object with CacheSyncDependency, it monitors the remote cache (the cache you want your local cache to be synchronized with) for changes. As soon as an item is updated in or removed from the remote cache this change is automatically updated in the local cache if the CacheSyncDependency was provided with the cache items. This helps you keep your local cache synchronized with the remote cache all the time.
Name | Description |
---|---|
CacheSyncDependency(String, String) | Initializes a new instance of the CacheSyncDependency with the specified parameters. Internally it tries to initialize the remote cache. If the cache can not be initialized, it throws the exception describing the cause of failure. The remote cache must be running as outproc even if it is on the same machine. The information to connect to the remote cache instance (like server-name and server-port) are picked from the 'client.ncconf'. |
CacheSyncDependency(String, String, String, Byte[]) | Initializes a new instance of the CacheSyncDependency with the specified parameters. Internally it tries to initialize the remote cache. If the cache can not be initialized, it throws the exception describing the cause of failure. The remote cache must be running as outproc even if it is on the same machine. The information to connect to the remote cache instance (like server-name and server-port) are picked from the 'client.ncconf'. |
CacheSyncDependency(String, String, String, Int32) | Initializes a new instance of the CacheSyncDependency with the specified parameters. Internally it tries to initialize the remote cache. If the cache can not be initialized, it throws the exception describing the cause of failure. The remote cache must be running as outproc even if it is on the same machine. |
CacheSyncDependency(String, String, String, Int32, String, Byte[]) | Initializes a new instance of the CacheSyncDependency with the specified parameters. Internally it tries to initialize the remote cache. If the cache can not be initialized, it throws the exception describing the cause of failure. The remote cache must be running as outproc even if it is on the same machine. |
Name | Description |
---|---|
CacheId | The unique Id of the remote cache |
Key | The key of the item in the remote cache with which the local cache item needs to be synchronized. |
Password | Specifies the user authorization password. |
Port | The server port that is used by the clients to connect to the server. |
Server | The name of the server where the remote cache is running. |
UserId | Specifies the User Id for user authorization. |
Name | Description |
---|---|
Deserialize(IO.CompactReader) | Load the state from the passed reader object. |
Serialize(IO.CompactWriter) | Save the state to the passed reader object. |