public class Caches extends Object
Modifier and Type | Method and Description |
---|---|
static <K,V> Map<K,V> |
getClusteredCache(String name)
Constructs a clustered Cache.
|
static <K,V> Map<K,V> |
getClusteredCache(String name,
int capacity,
long lifespan)
Constructs a clustered Cache.
|
public static <K,V> Map<K,V> getClusteredCache(String name)
The operations clear() and remove(K) are propagated within the cluster. The operation put(K,V) is propagated within the cluster if the result of put (the previous value) is not null. Please note that a local put operation is propagated exactly like a remove operation (the caches on the remote node will remove the entry).
In a non-clustered environment, there is virtually no overhead compared to a local map.
K
- the type of the keysV
- the type of the valuesname
- the name of the cachepublic static <K,V> Map<K,V> getClusteredCache(String name, int capacity, long lifespan)
The operations clear() and remove(K) are propagated within the cluster. The operation put(K,V) is propagated within the cluster if the result of put (the previous value) is not null. Please note that a local put operation is propagated exactly like a remove operation (the caches on the remote node will remove the entry).
In a non-clustered environment, there is virtually no overhead compared to a local map.
K
- the type of the keysV
- the type of the valuesname
- the name of the cachecapacity
- the maximum count of elements in the cache. if the value is less than 1, the cache has unlimited capacitylifespan
- the maximum amount of milliseconds an cache entry is 'valid'. if the value is less than 1, elements have no lifespan restriction@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.