Package com.alachisoft.ncache.client
Enum ClientCacheSyncMode
- java.lang.Object
-
- java.lang.Enum<ClientCacheSyncMode>
-
- com.alachisoft.ncache.client.ClientCacheSyncMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ClientCacheSyncMode>
public enum ClientCacheSyncMode extends java.lang.Enum<ClientCacheSyncMode>
Gets/Sets Enumeration to specify how the Client cache is synchronized with the cluster caches through events.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description Optimistic
It is possible that client caches are not synchronized with clustered cache for a small period of time.Pessimistic
In "Pessimistic" mode of synchronization, client cache always checks for the "version" of the cached item before returning it to the application.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientCacheSyncMode
forValue(int value)
retreives the enum constant of the specified value, if exists.int
getValue()
Order is important in enums.By using getValue() method, each enum constant index can be found, just like array index.static ClientCacheSyncMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ClientCacheSyncMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
Pessimistic
public static final ClientCacheSyncMode Pessimistic
In "Pessimistic" mode of synchronization, client cache always checks for the "version" of the cached item before returning it to the application.
-
Optimistic
public static final ClientCacheSyncMode Optimistic
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.
-
-
Method Detail
-
values
public static ClientCacheSyncMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ClientCacheSyncMode c : ClientCacheSyncMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ClientCacheSyncMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
forValue
public static ClientCacheSyncMode forValue(int value)
retreives the enum constant of the specified value, if exists.- Parameters:
value
- enum constant index- Returns:
- enum constant
-
getValue
public int getValue()
Order is important in enums.By using getValue() method, each enum constant index can be found, just like array index.- Returns:
- enum constant index
-
-