use of org.infinispan.cache.impl.SimpleCacheImpl in project infinispan by infinispan.
the class SimpleCacheTest method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager() throws Exception {
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.simpleCache(true);
EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cb);
cache = AbstractDelegatingCache.unwrapCache(cm.getCache());
assertTrue(cache instanceof SimpleCacheImpl);
return cm;
}
use of org.infinispan.cache.impl.SimpleCacheImpl in project infinispan by infinispan.
the class InternalCacheFactory method createSimpleCache.
private AdvancedCache<K, V> createSimpleCache(Configuration configuration, GlobalComponentRegistry globalComponentRegistry, String cacheName) {
AdvancedCache<K, V> cache;
if (configuration.statistics().available()) {
cache = buildEncodingCache(new StatsCollectingCache<>(cacheName));
} else {
cache = buildEncodingCache(new SimpleCacheImpl<>(cacheName));
}
componentRegistry = new SimpleComponentRegistry<>(cacheName, configuration, cache, globalComponentRegistry);
basicComponentRegistry = componentRegistry.getComponent(BasicComponentRegistry.class);
basicComponentRegistry.registerAlias(Cache.class.getName(), AdvancedCache.class.getName(), AdvancedCache.class);
basicComponentRegistry.registerComponent(AdvancedCache.class, cache, false);
componentRegistry.registerComponent(new CacheJmxRegistration(), CacheJmxRegistration.class);
componentRegistry.registerComponent(new CacheMetricsRegistration(), CacheMetricsRegistration.class);
componentRegistry.registerComponent(new RollingUpgradeManager(), RollingUpgradeManager.class);
return cache;
}
Aggregations