public abstract class CacheFactory extends Object
CacheBuilder, used to build a
The default implementation uses a Guava cache, which is only valid within the current JVM and cannot be shared across cluster nodes.
Applications can provide their own Guava implementation, that delegates to a cache that is compatible with clusters. To do so, they must change the
CacheFactory at initialization time, using the following code:
CacheFactory.setInstance(new MyClusterCacheFactory());As the main use for this cache factory is to delegate to cluster compatible implementations, it requires all cache keys and values to be
|Constructor and Description|
|Modifier and Type||Method and Description|
Creates a synchronous cache builder.
Returns the current cache factory instance.
Replaces the current cache factory with the given one.
public static CacheFactory getInstance()
Default instance uses a standard Guava cache which is only valid within the current JVM.
public static void setInstance(CacheFactory cacheFactory)
cacheFactory- the new cache factory
public abstract <V extends Serializable> CacheBuilder<V> builder()
This builder must guarantee that the caches it creates are synchronous, meaning when a cache is updated on a cluster node, it must not release the thread until all cluster nodes are notified of the new value.
V- the base value type for all caches created by this builder