co.com.bancolombia.binstash.CentralizedCacheFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bin-stash-centralized Show documentation
Show all versions of bin-stash-centralized Show documentation
Caching data in memory and/or a centralized cache to build a two tier stage cache.
package co.com.bancolombia.binstash;
import co.com.bancolombia.binstash.model.api.MapCache;
import co.com.bancolombia.binstash.model.api.ObjectCache;
import co.com.bancolombia.binstash.model.api.Stash;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class CentralizedCacheFactory {
private final Stash centralizedStash;
private final ObjectMapper objectMapper;
public ObjectCache newObjectCache() {
return new SingleTierObjectCacheUseCase<>(this.centralizedStash,
new SerializatorHelper<>(objectMapper));
}
public MapCache newMapCache() {
return new SingleTierMapCacheUseCase(this.centralizedStash);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy