Search in sources :

Example 1 with SimpleCacheImpl

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;
}
Also used : SimpleCacheImpl(org.infinispan.cache.impl.SimpleCacheImpl) ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager)

Example 2 with SimpleCacheImpl

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;
}
Also used : SimpleCacheImpl(org.infinispan.cache.impl.SimpleCacheImpl) RollingUpgradeManager(org.infinispan.upgrade.RollingUpgradeManager) BasicComponentRegistry(org.infinispan.factories.impl.BasicComponentRegistry) StatsCollectingCache(org.infinispan.cache.impl.StatsCollectingCache) CacheJmxRegistration(org.infinispan.jmx.CacheJmxRegistration) AbstractDelegatingAdvancedCache(org.infinispan.cache.impl.AbstractDelegatingAdvancedCache) AdvancedCache(org.infinispan.AdvancedCache) CacheMetricsRegistration(org.infinispan.metrics.impl.CacheMetricsRegistration) Cache(org.infinispan.Cache) StatsCollectingCache(org.infinispan.cache.impl.StatsCollectingCache) AbstractDelegatingAdvancedCache(org.infinispan.cache.impl.AbstractDelegatingAdvancedCache) AdvancedCache(org.infinispan.AdvancedCache) EncoderCache(org.infinispan.cache.impl.EncoderCache)

Aggregations

SimpleCacheImpl (org.infinispan.cache.impl.SimpleCacheImpl)2 AdvancedCache (org.infinispan.AdvancedCache)1 Cache (org.infinispan.Cache)1 AbstractDelegatingAdvancedCache (org.infinispan.cache.impl.AbstractDelegatingAdvancedCache)1 EncoderCache (org.infinispan.cache.impl.EncoderCache)1 StatsCollectingCache (org.infinispan.cache.impl.StatsCollectingCache)1 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)1 BasicComponentRegistry (org.infinispan.factories.impl.BasicComponentRegistry)1 CacheJmxRegistration (org.infinispan.jmx.CacheJmxRegistration)1 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)1 CacheMetricsRegistration (org.infinispan.metrics.impl.CacheMetricsRegistration)1 RollingUpgradeManager (org.infinispan.upgrade.RollingUpgradeManager)1