Package org.redisson.hibernate
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
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOLLECTION_DEFstatic StringCONFIG_PREFIXstatic StringENTITY_DEFstatic StringFALLBACKstatic StringMAX_ENTRIES_SUFFIXstatic StringMAX_IDLE_SUFFIXstatic StringNATURAL_ID_DEFstatic StringQUERY_DEFprotected RedissonClientredissonstatic StringREDISSON_CONFIG_PATHstatic StringTIMESTAMPS_DEFstatic StringTTL_SUFFIX
-
Constructor Summary
Constructors Constructor Description RedissonRegionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hibernate.cache.spi.CollectionRegionbuildCollectionRegion(String regionName, Properties properties, org.hibernate.cache.spi.CacheDataDescription metadata)org.hibernate.cache.spi.EntityRegionbuildEntityRegion(String regionName, Properties properties, org.hibernate.cache.spi.CacheDataDescription metadata)org.hibernate.cache.spi.NaturalIdRegionbuildNaturalIdRegion(String regionName, Properties properties, org.hibernate.cache.spi.CacheDataDescription metadata)org.hibernate.cache.spi.QueryResultsRegionbuildQueryResultsRegion(String regionName, Properties properties)org.hibernate.cache.spi.TimestampsRegionbuildTimestampsRegion(String regionName, Properties properties)protected RedissonClientcreateRedissonClient(Properties properties)protected RMapCache<Object,Object>getCache(String regionName, Properties properties, String defaultKey)org.hibernate.cache.spi.access.AccessTypegetDefaultAccessType()booleanisMinimalPutsEnabledByDefault()longnextTimestamp()voidstart(org.hibernate.boot.spi.SessionFactoryOptions settings, Properties properties)voidstop()
-
-
-
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
-
redisson
protected RedissonClient redisson
-
-
Method Detail
-
start
public void start(org.hibernate.boot.spi.SessionFactoryOptions settings, Properties properties) throws org.hibernate.cache.CacheException- Specified by:
startin interfaceorg.hibernate.cache.spi.RegionFactory- Throws:
org.hibernate.cache.CacheException
-
createRedissonClient
protected RedissonClient createRedissonClient(Properties properties)
-
stop
public void stop()
- Specified by:
stopin interfaceorg.hibernate.cache.spi.RegionFactory
-
isMinimalPutsEnabledByDefault
public boolean isMinimalPutsEnabledByDefault()
- Specified by:
isMinimalPutsEnabledByDefaultin interfaceorg.hibernate.cache.spi.RegionFactory
-
getDefaultAccessType
public org.hibernate.cache.spi.access.AccessType getDefaultAccessType()
- Specified by:
getDefaultAccessTypein interfaceorg.hibernate.cache.spi.RegionFactory
-
nextTimestamp
public long nextTimestamp()
- Specified by:
nextTimestampin interfaceorg.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:
buildEntityRegionin interfaceorg.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:
buildNaturalIdRegionin interfaceorg.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:
buildCollectionRegionin interfaceorg.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:
buildQueryResultsRegionin interfaceorg.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:
buildTimestampsRegionin interfaceorg.hibernate.cache.spi.RegionFactory- Throws:
org.hibernate.cache.CacheException
-
-