org.infinispan.hotrod.near.DefaultNearCacheFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-hotrod-jakarta Show documentation
Show all versions of infinispan-hotrod-jakarta Show documentation
Infinispan Hot Rod Client Jakarta EE
The newest version!
package org.infinispan.hotrod.near;
import java.util.function.Consumer;
import org.infinispan.api.common.CacheEntry;
import org.infinispan.hotrod.configuration.NearCache;
import org.infinispan.hotrod.configuration.NearCacheConfiguration;
import org.infinispan.hotrod.configuration.NearCacheFactory;
/**
* @since 14.0
**/
public class DefaultNearCacheFactory implements NearCacheFactory {
public static final DefaultNearCacheFactory INSTANCE = new DefaultNearCacheFactory();
@Override
public NearCache createNearCache(NearCacheConfiguration config, Consumer> removedConsumer) {
return config.maxEntries() > 0
? BoundedConcurrentMapNearCache.create(config, removedConsumer)
: ConcurrentMapNearCache.create();
}
@Override
public String toString() {
return "DefaultNearCacheFactory{}";
}
}