Class RedissonRegionFactory

java.lang.Object
org.redisson.hibernate.RedissonRegionFactory
All Implemented Interfaces:
Serializable, org.hibernate.cache.spi.RegionFactory, org.hibernate.service.Service
Direct Known Subclasses:
JndiRedissonRegionFactory, RedissonRegionNativeFactory

public class RedissonRegionFactory extends Object implements org.hibernate.cache.spi.RegionFactory
Hibernate Cache region factory based on Redisson. Creates own Redisson instance during region start.
Author:
Nikita Koksharov
See Also:
  • Field Details

  • Constructor Details

    • RedissonRegionFactory

      public RedissonRegionFactory()
  • Method Details

    • start

      public void start(org.hibernate.cfg.Settings settings, Properties properties) throws org.hibernate.cache.CacheException
      Specified by:
      start in interface org.hibernate.cache.spi.RegionFactory
      Throws:
      org.hibernate.cache.CacheException
    • createRedissonClient

      protected RedissonClient createRedissonClient(Properties properties)
    • stop

      public void stop()
      Specified by:
      stop in interface org.hibernate.cache.spi.RegionFactory
    • isMinimalPutsEnabledByDefault

      public boolean isMinimalPutsEnabledByDefault()
      Specified by:
      isMinimalPutsEnabledByDefault in interface org.hibernate.cache.spi.RegionFactory
    • getDefaultAccessType

      public org.hibernate.cache.spi.access.AccessType getDefaultAccessType()
      Specified by:
      getDefaultAccessType in interface org.hibernate.cache.spi.RegionFactory
    • nextTimestamp

      public long nextTimestamp()
      Specified by:
      nextTimestamp in interface org.hibernate.cache.spi.RegionFactory
    • buildEntityRegion

      public org.hibernate.cache.spi.EntityRegion buildEntityRegion(String regionName, Properties properties, org.hibernate.cache.spi.CacheDataDescription metadata) throws org.hibernate.cache.CacheException
      Specified by:
      buildEntityRegion in interface org.hibernate.cache.spi.RegionFactory
      Throws:
      org.hibernate.cache.CacheException
    • buildNaturalIdRegion

      public org.hibernate.cache.spi.NaturalIdRegion buildNaturalIdRegion(String regionName, Properties properties, org.hibernate.cache.spi.CacheDataDescription metadata) throws org.hibernate.cache.CacheException
      Specified by:
      buildNaturalIdRegion in interface org.hibernate.cache.spi.RegionFactory
      Throws:
      org.hibernate.cache.CacheException
    • buildCollectionRegion

      public org.hibernate.cache.spi.CollectionRegion buildCollectionRegion(String regionName, Properties properties, org.hibernate.cache.spi.CacheDataDescription metadata) throws org.hibernate.cache.CacheException
      Specified by:
      buildCollectionRegion in interface org.hibernate.cache.spi.RegionFactory
      Throws:
      org.hibernate.cache.CacheException
    • buildQueryResultsRegion

      public org.hibernate.cache.spi.QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties) throws org.hibernate.cache.CacheException
      Specified by:
      buildQueryResultsRegion in interface org.hibernate.cache.spi.RegionFactory
      Throws:
      org.hibernate.cache.CacheException
    • buildTimestampsRegion

      public org.hibernate.cache.spi.TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws org.hibernate.cache.CacheException
      Specified by:
      buildTimestampsRegion in interface org.hibernate.cache.spi.RegionFactory
      Throws:
      org.hibernate.cache.CacheException
    • getCache

      protected RMapCache<Object,Object> getCache(String regionName, Properties properties, String defaultKey)