public class LocalRegionCache extends Object implements RegionCache
RegionCache implementation based on a topic to distribute cache updates.| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentMap<Object,Expirable> |
cache |
| Constructor and Description |
|---|
LocalRegionCache(org.hibernate.cache.spi.RegionFactory regionFactory,
String name,
com.hazelcast.core.HazelcastInstance hazelcastInstance,
org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig) |
LocalRegionCache(org.hibernate.cache.spi.RegionFactory regionFactory,
String name,
com.hazelcast.core.HazelcastInstance hazelcastInstance,
org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig,
boolean withTopic) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterUpdate(Object key,
Object newValue,
Object newVersion) |
boolean |
contains(Object key) |
protected Object |
createMessage(Object key,
Object value,
Object currentVersion) |
void |
evictData() |
void |
evictData(Object key) |
Object |
get(Object key,
long txTimestamp) |
long |
getElementCountInMemory() |
String |
getName() |
org.hibernate.cache.spi.RegionFactory |
getRegionFactory() |
long |
getSizeInMemory() |
protected void |
maybeInvalidate(Object messageObject) |
long |
nextTimestamp() |
boolean |
put(Object key,
Object value,
long txTimestamp,
Object version) |
void |
unlockItem(Object key,
org.hibernate.cache.spi.access.SoftLock lock) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, destroy, getElementCountOnDiskprotected final ConcurrentMap<Object,Expirable> cache
public LocalRegionCache(org.hibernate.cache.spi.RegionFactory regionFactory,
String name,
com.hazelcast.core.HazelcastInstance hazelcastInstance,
org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig)
regionFactory - the region factoryname - the name for this region cache, which is also used to retrieve configuration/topichazelcastInstance - the HazelcastInstance to which this region cache belongs, used to retrieve
configuration and to lookup an ITopic to register a MessageListener
with (optional)regionConfig - the region configurationpublic LocalRegionCache(org.hibernate.cache.spi.RegionFactory regionFactory,
String name,
com.hazelcast.core.HazelcastInstance hazelcastInstance,
org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig,
boolean withTopic)
regionFactory - the region factoryname - the name for this region cache, which is also used to retrieve configuration/topichazelcastInstance - the HazelcastInstance to which this region cache belongs, used to retrieve
configuration and to lookup an ITopic to register a MessageListener
with if withTopic is true (optional)regionConfig - the region configurationwithTopic - true to register a MessageListener with the ITopic whose name
matches this region cache if a HazelcastInstance was provided to look
up the topic; otherwise, false not to register a listener even if an instance
was providedpublic void afterUpdate(Object key, Object newValue, Object newVersion)
afterUpdate in interface RegionCachepublic boolean contains(Object key)
contains in interface RegionCachepublic void evictData()
evictData in interface RegionCachepublic void evictData(Object key)
evictData in interface RegionCachepublic Object get(Object key, long txTimestamp)
get in interface RegionCachepublic long getElementCountInMemory()
getElementCountInMemory in interface org.hibernate.cache.spi.ExtendedStatisticsSupportpublic String getName()
getName in interface org.hibernate.cache.spi.Regionpublic org.hibernate.cache.spi.RegionFactory getRegionFactory()
getRegionFactory in interface org.hibernate.cache.spi.Regionpublic long getSizeInMemory()
getSizeInMemory in interface org.hibernate.cache.spi.ExtendedStatisticsSupportpublic boolean put(Object key, Object value, long txTimestamp, Object version)
put in interface RegionCachepublic void unlockItem(Object key, org.hibernate.cache.spi.access.SoftLock lock)
unlockItem in interface RegionCachepublic long nextTimestamp()
nextTimestamp in interface RegionCacheprotected void maybeInvalidate(Object messageObject)
Copyright © 2019. All Rights Reserved.