Package org.redisson.hibernate
Class RedissonRegionFactory
- java.lang.Object
-
- org.hibernate.cache.spi.AbstractRegionFactory
-
- org.hibernate.cache.spi.support.RegionFactoryTemplate
-
- org.redisson.hibernate.RedissonRegionFactory
-
- All Implemented Interfaces:
Serializable
,org.hibernate.cache.spi.RegionFactory
,org.hibernate.service.Service
,org.hibernate.service.spi.Stoppable
- Direct Known Subclasses:
JndiRedissonRegionFactory
public class RedissonRegionFactory extends org.hibernate.cache.spi.support.RegionFactoryTemplate
Hibernate Cache region factory based on Redisson. Creates own Redisson instance during region start.- Author:
- Nikita Koksharov
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
COLLECTION_DEF
static String
CONFIG_PREFIX
static String
ENTITY_DEF
protected boolean
fallback
static String
FALLBACK
static String
MAX_ENTRIES_SUFFIX
static String
MAX_IDLE_SUFFIX
static String
NATURAL_ID_DEF
static String
QUERY_DEF
static String
REDISSON_CONFIG_PATH
static String
TIMESTAMPS_DEF
static String
TTL_SUFFIX
-
Constructor Summary
Constructors Constructor Description RedissonRegionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hibernate.cache.spi.DomainDataRegion
buildDomainDataRegion(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingContext)
protected org.hibernate.cache.spi.support.DomainDataStorageAccess
createDomainDataStorageAccess(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingContext)
protected org.hibernate.cache.spi.support.StorageAccess
createQueryResultsRegionStorageAccess(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
protected RedissonClient
createRedissonClient(Map properties)
protected org.hibernate.cache.spi.support.StorageAccess
createTimestampsRegionStorageAccess(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
protected RMapCache<Object,Object>
getCache(String regionName, Map properties, String defaultKey)
org.hibernate.cache.spi.access.AccessType
getDefaultAccessType()
protected org.hibernate.cache.spi.CacheKeysFactory
getImplicitCacheKeysFactory()
boolean
isMinimalPutsEnabledByDefault()
long
nextTimestamp()
protected void
prepareForUse(org.hibernate.boot.spi.SessionFactoryOptions settings, Map properties)
protected void
releaseFromUse()
-
Methods inherited from class org.hibernate.cache.spi.support.RegionFactoryTemplate
buildQueryResultsRegion, buildTimestampsRegion
-
-
-
-
Field Detail
-
QUERY_DEF
public static final String QUERY_DEF
- See Also:
- Constant Field Values
-
COLLECTION_DEF
public static final String COLLECTION_DEF
- See Also:
- Constant Field Values
-
ENTITY_DEF
public static final String ENTITY_DEF
- See Also:
- Constant Field Values
-
NATURAL_ID_DEF
public static final String NATURAL_ID_DEF
- See Also:
- Constant Field Values
-
TIMESTAMPS_DEF
public static final String TIMESTAMPS_DEF
- See Also:
- Constant Field Values
-
MAX_ENTRIES_SUFFIX
public static final String MAX_ENTRIES_SUFFIX
- See Also:
- Constant Field Values
-
TTL_SUFFIX
public static final String TTL_SUFFIX
- See Also:
- Constant Field Values
-
MAX_IDLE_SUFFIX
public static final String MAX_IDLE_SUFFIX
- See Also:
- Constant Field Values
-
CONFIG_PREFIX
public static final String CONFIG_PREFIX
- See Also:
- Constant Field Values
-
REDISSON_CONFIG_PATH
public static final String REDISSON_CONFIG_PATH
- See Also:
- Constant Field Values
-
FALLBACK
public static final String FALLBACK
- See Also:
- Constant Field Values
-
fallback
protected boolean fallback
-
-
Method Detail
-
getImplicitCacheKeysFactory
protected org.hibernate.cache.spi.CacheKeysFactory getImplicitCacheKeysFactory()
- Overrides:
getImplicitCacheKeysFactory
in classorg.hibernate.cache.spi.support.RegionFactoryTemplate
-
prepareForUse
protected void prepareForUse(org.hibernate.boot.spi.SessionFactoryOptions settings, Map properties) throws org.hibernate.cache.CacheException
- Specified by:
prepareForUse
in classorg.hibernate.cache.spi.AbstractRegionFactory
- Throws:
org.hibernate.cache.CacheException
-
createRedissonClient
protected RedissonClient createRedissonClient(Map properties)
-
releaseFromUse
protected void releaseFromUse()
- Specified by:
releaseFromUse
in classorg.hibernate.cache.spi.AbstractRegionFactory
-
isMinimalPutsEnabledByDefault
public boolean isMinimalPutsEnabledByDefault()
- Specified by:
isMinimalPutsEnabledByDefault
in interfaceorg.hibernate.cache.spi.RegionFactory
- Overrides:
isMinimalPutsEnabledByDefault
in classorg.hibernate.cache.spi.AbstractRegionFactory
-
getDefaultAccessType
public org.hibernate.cache.spi.access.AccessType getDefaultAccessType()
- Specified by:
getDefaultAccessType
in interfaceorg.hibernate.cache.spi.RegionFactory
- Overrides:
getDefaultAccessType
in classorg.hibernate.cache.spi.AbstractRegionFactory
-
nextTimestamp
public long nextTimestamp()
- Specified by:
nextTimestamp
in interfaceorg.hibernate.cache.spi.RegionFactory
- Overrides:
nextTimestamp
in classorg.hibernate.cache.spi.AbstractRegionFactory
-
buildDomainDataRegion
public org.hibernate.cache.spi.DomainDataRegion buildDomainDataRegion(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingContext)
- Specified by:
buildDomainDataRegion
in interfaceorg.hibernate.cache.spi.RegionFactory
- Overrides:
buildDomainDataRegion
in classorg.hibernate.cache.spi.support.RegionFactoryTemplate
-
createDomainDataStorageAccess
protected org.hibernate.cache.spi.support.DomainDataStorageAccess createDomainDataStorageAccess(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingContext)
- Overrides:
createDomainDataStorageAccess
in classorg.hibernate.cache.spi.support.RegionFactoryTemplate
-
createQueryResultsRegionStorageAccess
protected org.hibernate.cache.spi.support.StorageAccess createQueryResultsRegionStorageAccess(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
- Specified by:
createQueryResultsRegionStorageAccess
in classorg.hibernate.cache.spi.support.RegionFactoryTemplate
-
createTimestampsRegionStorageAccess
protected org.hibernate.cache.spi.support.StorageAccess createTimestampsRegionStorageAccess(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
- Specified by:
createTimestampsRegionStorageAccess
in classorg.hibernate.cache.spi.support.RegionFactoryTemplate
-
-