Class InfinispanRegionFactory
java.lang.Object
org.infinispan.hibernate.cache.v62.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
A
RegionFactory for Infinispan-backed cache
regions.- Since:
- 3.5
- Author:
- Chris Bredesen, Galder ZamarreƱo
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionDefines custom mapping for regionName -> cacheName and also DataType.key -> cacheName (for the case that you want to change the cache configuration for whole type)Defines configuration properties applied on top of configuration set in any file, by regionName or DataType.keyFields 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_SUFFIXFields inherited from interface org.hibernate.cache.spi.RegionFactory
DEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAME, DEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAME -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance using the default configuration.Create a new instance using conifguration properties inprops. -
Method Summary
Modifier and TypeMethodDescriptionorg.hibernate.cache.spi.DomainDataRegionbuildDomainDataRegion(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionConfig, org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingContext) org.hibernate.cache.spi.QueryResultsRegionbuildQueryResultsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) org.hibernate.cache.spi.TimestampsRegionbuildTimestampsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) protected org.infinispan.manager.EmbeddedCacheManagercreateCacheManager(Properties properties, org.hibernate.service.ServiceRegistry serviceRegistry) protected TimestampsRegionImplcreateTimestampsRegion(org.infinispan.AdvancedCache cache, String regionName) org.hibernate.cache.spi.CacheTransactionSynchronizationcreateTransactionContext(org.hibernate.engine.spi.SharedSessionContractImplementor session) protected org.infinispan.AdvancedCachegetCache(String cacheName, String unqualifiedRegionName, org.infinispan.hibernate.cache.commons.DataType type, Collection<String> legacyUnqualifiedNames) protected org.hibernate.cache.spi.CacheKeysFactoryorg.infinispan.manager.EmbeddedCacheManagerorg.hibernate.cache.spi.access.AccessTypeorg.infinispan.configuration.cache.ConfigurationbooleanlongvoidsetCacheManager(org.infinispan.manager.EmbeddedCacheManager manager) voidvoidstop()protected voidprotected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.cache.spi.RegionFactory
getTimeout
-
Field Details
-
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) -
configOverrides
Defines configuration properties applied on top of configuration set in any file, by regionName or DataType.key
-
-
Constructor Details
-
InfinispanRegionFactory
public InfinispanRegionFactory()Create a new instance using the default configuration. -
InfinispanRegionFactory
Create a new instance using conifguration properties inprops.- Parameters:
props- Environmental properties; currently unused.
-
-
Method Details
-
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
-
buildQueryResultsRegion
public org.hibernate.cache.spi.QueryResultsRegion buildQueryResultsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) - Specified by:
buildQueryResultsRegionin interfaceorg.hibernate.cache.spi.RegionFactory
-
buildTimestampsRegion
public org.hibernate.cache.spi.TimestampsRegion buildTimestampsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) - Specified by:
buildTimestampsRegionin 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:
isMinimalPutsEnabledByDefaultin interfaceorg.hibernate.cache.spi.RegionFactory
-
getDefaultAccessType
public org.hibernate.cache.spi.access.AccessType getDefaultAccessType()- Specified by:
getDefaultAccessTypein interfaceorg.hibernate.cache.spi.RegionFactory
-
qualify
- Specified by:
qualifyin interfaceorg.hibernate.cache.spi.RegionFactory
-
nextTimestamp
public long nextTimestamp()- Specified by:
nextTimestampin interfaceorg.hibernate.cache.spi.RegionFactory- Specified by:
nextTimestampin 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:
startin 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:
stopin 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)
-