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
Assembly: Alachisoft.NCache.Client.dll
Syntax
[Serializable]
public class CacheSyncDependency : ICompactSerializable
Remarks
You can add items with the CacheSyncDependency to your application's cache using the ICache interface and the Insert method.
When you add an item to an application's ICache 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.
Constructors
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 file. |
CacheSyncDependency(String, String, ServerInfo) | 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, ServerInfo, Credentials) | 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, 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. |
Properties
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. |
Methods
Name | Description |
---|---|
Deserialize(CompactReader) | Loads the state from the passed reader object. |
Serialize(CompactWriter) | Saves the state to the passed reader object. |