java.lang.Object
com.hazelcast.hibernate.local.LocalRegionCache
- All Implemented Interfaces:
RegionCache,org.hibernate.cache.spi.ExtendedStatisticsSupport,org.hibernate.cache.spi.Region
- Direct Known Subclasses:
TimestampsRegionCache
Local only
RegionCache implementation based on a topic to distribute cache updates.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interfaceGeneric representation of eviction-related configuration -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLocalRegionCache(org.hibernate.cache.spi.RegionFactory regionFactory, String name, com.hazelcast.core.HazelcastInstance hazelcastInstance, org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, boolean withTopic, LocalRegionCache.EvictionConfig evictionConfig, FreeHeapBasedCacheEvictor freeHeapBasedCacheEvictor) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterUpdate(Object key, Object newValue, Object newVersion) static LocalRegionCache.Builderbuilder()booleanprotected ObjectcreateMessage(Object key, Object value, Object currentVersion) voiddestroy()voidvoidlonggetName()org.hibernate.cache.spi.RegionFactorylongprotected voidmaybeInvalidate(Object messageObject) longbooleanvoidunlockItem(Object key, org.hibernate.cache.spi.access.SoftLock lock) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hazelcast.hibernate.RegionCache
clear, getElementCountOnDisk
-
Field Details
-
cache
-
-
Constructor Details
-
LocalRegionCache
protected LocalRegionCache(org.hibernate.cache.spi.RegionFactory regionFactory, String name, com.hazelcast.core.HazelcastInstance hazelcastInstance, org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, boolean withTopic, LocalRegionCache.EvictionConfig evictionConfig, FreeHeapBasedCacheEvictor freeHeapBasedCacheEvictor) - Parameters:
regionFactory- the region factoryname- the name for this region cache, which is also used to retrieve configuration/topichazelcastInstance- theHazelcastInstanceto which this region cache belongs, used to retrieve configuration and to lookup anITopicto register aMessageListenerwith ifwithTopicistrue(optional)regionConfig- the region configurationwithTopic-trueto register aMessageListenerwith theITopicwhose name matches this region cache if aHazelcastInstancewas provided to look up the topic; otherwise,falsenot to register a listener even if an instance was providedevictionConfig- provides the parameters which should be used when evicting entries from the cache; if null, this will be derived from the HazelcastMapConfig; if the MapConfig cannot be resolved, this will use defaults.freeHeapBasedCacheEvictor- performs the free-heap-based eviction
-
-
Method Details
-
builder
-
afterUpdate
- Specified by:
afterUpdatein interfaceRegionCache
-
contains
- Specified by:
containsin interfaceRegionCache
-
evictData
public void evictData()- Specified by:
evictDatain interfaceRegionCache
-
evictData
- Specified by:
evictDatain interfaceRegionCache
-
get
- Specified by:
getin interfaceRegionCache
-
getElementCountInMemory
public long getElementCountInMemory()- Specified by:
getElementCountInMemoryin interfaceorg.hibernate.cache.spi.ExtendedStatisticsSupport
-
getName
- Specified by:
getNamein interfaceorg.hibernate.cache.spi.Region
-
getRegionFactory
public org.hibernate.cache.spi.RegionFactory getRegionFactory()- Specified by:
getRegionFactoryin interfaceorg.hibernate.cache.spi.Region
-
getSizeInMemory
public long getSizeInMemory()- Specified by:
getSizeInMemoryin interfaceorg.hibernate.cache.spi.ExtendedStatisticsSupport
-
put
- Specified by:
putin interfaceRegionCache
-
unlockItem
- Specified by:
unlockItemin interfaceRegionCache
-
nextTimestamp
public long nextTimestamp()- Specified by:
nextTimestampin interfaceRegionCache
-
createMessage
-
maybeInvalidate
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.hibernate.cache.spi.Region- Specified by:
destroyin interfaceRegionCache
-