All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.cache.infinispan.impl.BaseGeneralDataRegion Maven / Gradle / Ivy

There is a newer version: 5.6.15.Final
Show newest version
package org.hibernate.cache.infinispan.impl;

import javax.transaction.TransactionManager;

import org.hibernate.cache.CacheException;
import org.hibernate.cache.infinispan.util.Caches;
import org.hibernate.cache.spi.GeneralDataRegion;
import org.hibernate.cache.spi.RegionFactory;
import org.infinispan.AdvancedCache;

/**
 * Support for Infinispan {@link GeneralDataRegion} implementors.
 * 
 * @author Chris Bredesen
 * @author Galder Zamarreño
 * @since 3.5
 */
public abstract class BaseGeneralDataRegion extends BaseRegion implements GeneralDataRegion {

   private final AdvancedCache putCache;

   public BaseGeneralDataRegion(AdvancedCache cache, String name,
         RegionFactory factory) {
      super(cache, name, factory);
      this.putCache = Caches.ignoreReturnValuesCache(cache);
   }

   public void evict(Object key) throws CacheException {
      cache.evict(key);
   }

   public void evictAll() throws CacheException {
      cache.clear();
   }

   public Object get(Object key) throws CacheException {
      return cache.get(key);
   }

   public void put(Object key, Object value) throws CacheException {
      putCache.put(key, value);
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy