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
- Gradle
- Gradle - Kotlin DSL
- Maven
build.gradle
dependencies {
implementation 'io.github.xanthic.cache:cache-provider-infinispan'
}
build.gradle.kts
dependencies {
implementation("io.github.xanthic.cache:cache-provider-infinispan")
}
pom.xml
<dependency>
<groupId>io.github.xanthic.cache</groupId>
<artifactId>cache-provider-infinispan</artifactId>
</dependency>
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());
});