All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alachisoft.ncache.client.ClientCacheSyncMode Maven / Gradle / Ivy

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.alachisoft.ncache.client;


/**
 * Gets/Sets Enumeration to specify how the Client cache is synchronized with the cluster caches through events.
 */
public enum ClientCacheSyncMode {

    /**
     * In "Pessimistic" mode of synchronization, client cache always checks for the "version" of the cached item before returning it to the application.
     */
    Pessimistic,

    /**
     * It is possible that client caches are not synchronized with clustered cache for a small period of time. If during this time users gets an item from the client cache, he may get an old version. This is the "Optimistic" mode of synchronization.
     */
    Optimistic;
    /**
     * retreives the enum constant of the specified value, if exists.
     * @param value enum constant index
     * @return enum constant
     */
    public static ClientCacheSyncMode forValue(int value) {
        return values()[value];
    }
     /**
     * Order is important in enums.By using getValue() method, each enum constant index can be found, just like array index.
     * @return enum constant index
     */
    public int getValue() {
        return this.ordinal();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy