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.RegionFactoryTemplateHibernate 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_DEFprotected booleanfallbackstatic StringFALLBACKstatic StringMAX_ENTRIES_SUFFIXstatic StringMAX_IDLE_SUFFIXstatic StringNATURAL_ID_DEFstatic StringQUERY_DEFstatic 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.DomainDataRegionbuildDomainDataRegion(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingContext)protected org.hibernate.cache.spi.support.DomainDataStorageAccesscreateDomainDataStorageAccess(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingContext)protected org.hibernate.cache.spi.support.StorageAccesscreateQueryResultsRegionStorageAccess(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)protected RedissonClientcreateRedissonClient(Map properties)protected org.hibernate.cache.spi.support.StorageAccesscreateTimestampsRegionStorageAccess(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)protected RMapCache<Object,Object>getCache(String regionName, Map properties, String defaultKey)org.hibernate.cache.spi.access.AccessTypegetDefaultAccessType()protected org.hibernate.cache.spi.CacheKeysFactorygetImplicitCacheKeysFactory()booleanisMinimalPutsEnabledByDefault()longnextTimestamp()protected voidprepareForUse(org.hibernate.boot.spi.SessionFactoryOptions settings, Map properties)protected voidreleaseFromUse()-
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:
getImplicitCacheKeysFactoryin 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:
prepareForUsein classorg.hibernate.cache.spi.AbstractRegionFactory- Throws:
org.hibernate.cache.CacheException
-
createRedissonClient
protected RedissonClient createRedissonClient(Map properties)
-
releaseFromUse
protected void releaseFromUse()
- Specified by:
releaseFromUsein classorg.hibernate.cache.spi.AbstractRegionFactory
-
isMinimalPutsEnabledByDefault
public boolean isMinimalPutsEnabledByDefault()
- Specified by:
isMinimalPutsEnabledByDefaultin interfaceorg.hibernate.cache.spi.RegionFactory- Overrides:
isMinimalPutsEnabledByDefaultin classorg.hibernate.cache.spi.AbstractRegionFactory
-
getDefaultAccessType
public org.hibernate.cache.spi.access.AccessType getDefaultAccessType()
- Specified by:
getDefaultAccessTypein interfaceorg.hibernate.cache.spi.RegionFactory- Overrides:
getDefaultAccessTypein classorg.hibernate.cache.spi.AbstractRegionFactory
-
nextTimestamp
public long nextTimestamp()
- Specified by:
nextTimestampin interfaceorg.hibernate.cache.spi.RegionFactory- Overrides:
nextTimestampin 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:
buildDomainDataRegionin interfaceorg.hibernate.cache.spi.RegionFactory- Overrides:
buildDomainDataRegionin 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:
createDomainDataStorageAccessin 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:
createQueryResultsRegionStorageAccessin 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:
createTimestampsRegionStorageAccessin classorg.hibernate.cache.spi.support.RegionFactoryTemplate
-
-