Skip to main content

Infinispan

added in: v0.1.0

Description

This provider uses Infinispan in local, volatile mode to fulfill the Xanthic Cache contract.

Out of the box, Infinispan's distributed or scattered cache options are not (yet) supported.

Note: Infinispan itself depends on Caffeine, so one can achieve a smaller binary by using Caffeine instead, if not also using other features of Infinispan.

Installation

build.gradle
dependencies {
implementation 'io.github.xanthic.cache:cache-provider-infinispan'
}

Usage

Default

CacheApiSettings.getInstance().setDefaultCacheProvider(new InfinispanProvider());

Cache<String, Integer> cache = CacheApi.create(spec -> {
// if spec.provider is not set the default cache provider will be used
});

Spec

Cache<String, Integer> cache = CacheApi.create(spec -> {
spec.provider(new InfinispanProvider());
});