Search in sources :

Example 1 with InfinispanProxyManager

use of io.github.bucket4j.grid.infinispan.InfinispanProxyManager in project bucket4j-spring-boot-starter by MarcGiffing.

the class InfinispanJCacheCacheResolver method resolve.

public ProxyManager<String> resolve(String cacheName) {
    Cache<Object, Object> cache = cacheContainer.getCache(cacheName);
    if (cache == null) {
        throw new JCacheNotFoundException(cacheName);
    }
    FunctionalMapImpl functionalMap = FunctionalMapImpl.create(cache.getAdvancedCache());
    return new InfinispanProxyManager<>(ReadWriteMapImpl.create(functionalMap));
}
Also used : FunctionalMapImpl(org.infinispan.functional.impl.FunctionalMapImpl) JCacheNotFoundException(com.giffing.bucket4j.spring.boot.starter.exception.JCacheNotFoundException) InfinispanProxyManager(io.github.bucket4j.grid.infinispan.InfinispanProxyManager)

Aggregations

JCacheNotFoundException (com.giffing.bucket4j.spring.boot.starter.exception.JCacheNotFoundException)1 InfinispanProxyManager (io.github.bucket4j.grid.infinispan.InfinispanProxyManager)1 FunctionalMapImpl (org.infinispan.functional.impl.FunctionalMapImpl)1