Search in sources :

Example 1 with InfinispanCacheFactory

use of org.teiid.cache.infinispan.InfinispanCacheFactory in project teiid by teiid.

the class EmbeddedConfiguration method getCacheFactory.

public CacheFactory getCacheFactory() {
    if (this.cacheFactory == null) {
        try {
            cacheManager = new DefaultCacheManager(this.infinispanConfigFile, true);
            for (String cacheName : cacheManager.getCacheNames()) {
                if (getTransactionManager() != null) {
                    setCacheTransactionManger(cacheName);
                }
                cacheManager.startCache(cacheName);
            }
            this.cacheFactory = new InfinispanCacheFactory(cacheManager, this.getClass().getClassLoader());
        } catch (IOException e) {
            throw new TeiidRuntimeException(RuntimePlugin.Event.TEIID40100, e);
        }
    }
    return this.cacheFactory;
}
Also used : DefaultCacheManager(org.infinispan.manager.DefaultCacheManager) InfinispanCacheFactory(org.teiid.cache.infinispan.InfinispanCacheFactory) IOException(java.io.IOException) TeiidRuntimeException(org.teiid.core.TeiidRuntimeException)

Aggregations

IOException (java.io.IOException)1 DefaultCacheManager (org.infinispan.manager.DefaultCacheManager)1 InfinispanCacheFactory (org.teiid.cache.infinispan.InfinispanCacheFactory)1 TeiidRuntimeException (org.teiid.core.TeiidRuntimeException)1