Class InfinispanRegionFactory
- java.lang.Object
-
- org.infinispan.hibernate.cache.v53.InfinispanRegionFactory
-
- All Implemented Interfaces:
Serializable
,org.hibernate.cache.spi.RegionFactory
,org.hibernate.service.Service
,org.hibernate.service.spi.Stoppable
,org.infinispan.hibernate.cache.commons.TimeSource
,org.infinispan.hibernate.cache.spi.InfinispanProperties
public class InfinispanRegionFactory extends Object implements org.hibernate.cache.spi.RegionFactory, org.infinispan.hibernate.cache.commons.TimeSource, org.infinispan.hibernate.cache.spi.InfinispanProperties
ARegionFactory
for Infinispan-backed cache regions.- Since:
- 3.5
- Author:
- Chris Bredesen, Galder ZamarreƱo
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>
baseConfigurations
Defines custom mapping for regionName -> cacheName and also DataType.key -> cacheName (for the case that you want to change the cache configuration for whole type)protected Map<String,org.infinispan.configuration.cache.ConfigurationBuilder>
configOverrides
Defines configuration properties applied on top of configuration set in any file, by regionName or DataType.key-
Fields inherited from interface org.infinispan.hibernate.cache.spi.InfinispanProperties
CACHE_MANAGER_RESOURCE_PROP, COLLECTION, COLLECTION_CACHE_RESOURCE_PROP, CONFIG_SUFFIX, DEF_ENTITY_RESOURCE, DEF_INFINISPAN_CONFIG_RESOURCE, DEF_PENDING_PUTS_RESOURCE, DEF_QUERY_RESOURCE, DEF_TIMESTAMPS_RESOURCE, DEF_USE_SYNCHRONIZATION, DEPRECATED_MAX_ENTRIES_SUFFIX, DEPRECATED_STRATEGY_SUFFIX, DEPRECATED_WAKE_UP_INTERVAL_SUFFIX, ENTITY, ENTITY_CACHE_RESOURCE_PROP, IMMUTABLE_ENTITY, IMMUTABLE_ENTITY_CACHE_RESOURCE_PROP, INFINISPAN_CONFIG_LOCAL_RESOURCE, INFINISPAN_CONFIG_RESOURCE_PROP, INFINISPAN_GLOBAL_STATISTICS_PROP, INFINISPAN_USE_SYNCHRONIZATION_PROP, LIFESPAN_SUFFIX, MAX_IDLE_SUFFIX, NATURAL_ID, NATURAL_ID_CACHE_RESOURCE_PROP, PENDING_PUTS, PENDING_PUTS_CACHE_NAME, PENDING_PUTS_CACHE_RESOURCE_PROP, PREFIX, QUERY, QUERY_CACHE_RESOURCE_PROP, SIZE_SUFFIX, TIMESTAMPS, TIMESTAMPS_CACHE_RESOURCE_PROP, WAKE_UP_INTERVAL_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description InfinispanRegionFactory()
Create a new instance using the default configuration.InfinispanRegionFactory(Properties props)
Create a new instance using conifguration properties inprops
.
-
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)
org.hibernate.cache.spi.QueryResultsRegion
buildQueryResultsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
org.hibernate.cache.spi.TimestampsRegion
buildTimestampsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
protected org.infinispan.manager.EmbeddedCacheManager
createCacheManager(Properties properties, org.hibernate.service.ServiceRegistry serviceRegistry)
protected TimestampsRegionImpl
createTimestampsRegion(org.infinispan.AdvancedCache cache, String regionName)
org.hibernate.cache.spi.CacheTransactionSynchronization
createTransactionContext(org.hibernate.engine.spi.SharedSessionContractImplementor session)
protected org.infinispan.AdvancedCache
getCache(String cacheName, String unqualifiedRegionName, org.infinispan.hibernate.cache.commons.DataType type, Collection<String> legacyUnqualifiedNames)
protected org.hibernate.cache.spi.CacheKeysFactory
getCacheKeysFactory()
org.infinispan.manager.EmbeddedCacheManager
getCacheManager()
org.hibernate.cache.spi.access.AccessType
getDefaultAccessType()
org.infinispan.configuration.cache.Configuration
getPendingPutsCacheConfiguration()
boolean
isMinimalPutsEnabledByDefault()
long
nextTimestamp()
String
qualify(String regionName)
void
setCacheManager(org.infinispan.manager.EmbeddedCacheManager manager)
void
start(org.hibernate.boot.spi.SessionFactoryOptions settings, Map configValues)
void
stop()
protected void
stopCacheManager()
protected void
stopCacheRegions()
-
-
-
Constructor Detail
-
InfinispanRegionFactory
public InfinispanRegionFactory()
Create a new instance using the default configuration.
-
InfinispanRegionFactory
public InfinispanRegionFactory(Properties props)
Create a new instance using conifguration properties inprops
.- Parameters:
props
- Environmental properties; currently unused.
-
-
Method Detail
-
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
-
buildQueryResultsRegion
public org.hibernate.cache.spi.QueryResultsRegion buildQueryResultsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
- Specified by:
buildQueryResultsRegion
in interfaceorg.hibernate.cache.spi.RegionFactory
-
buildTimestampsRegion
public org.hibernate.cache.spi.TimestampsRegion buildTimestampsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
- Specified by:
buildTimestampsRegion
in interfaceorg.hibernate.cache.spi.RegionFactory
-
createTimestampsRegion
protected TimestampsRegionImpl createTimestampsRegion(org.infinispan.AdvancedCache cache, String regionName)
-
getPendingPutsCacheConfiguration
public org.infinispan.configuration.cache.Configuration getPendingPutsCacheConfiguration()
-
getCacheKeysFactory
protected org.hibernate.cache.spi.CacheKeysFactory getCacheKeysFactory()
-
isMinimalPutsEnabledByDefault
public boolean isMinimalPutsEnabledByDefault()
- Specified by:
isMinimalPutsEnabledByDefault
in interfaceorg.hibernate.cache.spi.RegionFactory
-
getDefaultAccessType
public org.hibernate.cache.spi.access.AccessType getDefaultAccessType()
- Specified by:
getDefaultAccessType
in interfaceorg.hibernate.cache.spi.RegionFactory
-
qualify
public String qualify(String regionName)
- Specified by:
qualify
in interfaceorg.hibernate.cache.spi.RegionFactory
-
createTransactionContext
public org.hibernate.cache.spi.CacheTransactionSynchronization createTransactionContext(org.hibernate.engine.spi.SharedSessionContractImplementor session)
- Specified by:
createTransactionContext
in interfaceorg.hibernate.cache.spi.RegionFactory
-
nextTimestamp
public long nextTimestamp()
- Specified by:
nextTimestamp
in interfaceorg.hibernate.cache.spi.RegionFactory
- Specified by:
nextTimestamp
in interfaceorg.infinispan.hibernate.cache.commons.TimeSource
-
setCacheManager
public void setCacheManager(org.infinispan.manager.EmbeddedCacheManager manager)
-
getCacheManager
public org.infinispan.manager.EmbeddedCacheManager getCacheManager()
-
start
public void start(org.hibernate.boot.spi.SessionFactoryOptions settings, Map configValues) throws org.hibernate.cache.CacheException
- Specified by:
start
in interfaceorg.hibernate.cache.spi.RegionFactory
- Throws:
org.hibernate.cache.CacheException
-
createCacheManager
protected org.infinispan.manager.EmbeddedCacheManager createCacheManager(Properties properties, org.hibernate.service.ServiceRegistry serviceRegistry)
-
stop
public void stop()
- Specified by:
stop
in interfaceorg.hibernate.service.spi.Stoppable
-
stopCacheRegions
protected void stopCacheRegions()
-
stopCacheManager
protected void stopCacheManager()
-
getCache
protected org.infinispan.AdvancedCache getCache(String cacheName, String unqualifiedRegionName, org.infinispan.hibernate.cache.commons.DataType type, Collection<String> legacyUnqualifiedNames)
-
-