Package org.hibernate.cache.spi
Interface RegionFactory
-
- All Known Subinterfaces:
RegionFactory
- All Known Implementing Classes:
AbstractRegionFactory,CachingRegionFactory,RegionFactoryTemplate
public interface RegionFactory extends Service, Stoppable
Contract for building second level cache regions. Implementors should define a constructor in one of two forms:- MyRegionFactoryImpl(
Properties) - MyRegionFactoryImpl()
start(org.hibernate.boot.spi.SessionFactoryOptions, java.util.Map)being called.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAMEstatic java.lang.StringDEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DomainDataRegionbuildDomainDataRegion(DomainDataRegionConfig regionConfig, DomainDataRegionBuildingContext buildingContext)Create a named Region for holding domain model dataQueryResultsRegionbuildQueryResultsRegion(java.lang.String regionName, SessionFactoryImplementor sessionFactory)TimestampsRegionbuildTimestampsRegion(java.lang.String regionName, SessionFactoryImplementor sessionFactory)default CacheTransactionSynchronizationcreateTransactionContext(SharedSessionContractImplementor session)AccessTypegetDefaultAccessType()Get the default access type for any "user model" datadefault longgetTimeout()booleanisMinimalPutsEnabledByDefault()By default should we perform "minimal puts" when using this second level cache implementation?longnextTimestamp()Generate a timestamp.java.lang.Stringqualify(java.lang.String regionName)voidstart(SessionFactoryOptions settings, java.util.Map configValues)Lifecycle callback to perform any necessary initialization of the underlying cache provider.
-
-
-
Field Detail
-
DEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAME
static final java.lang.String DEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAME
- See Also:
- Constant Field Values
-
DEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAME
static final java.lang.String DEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
void start(SessionFactoryOptions settings, java.util.Map configValues) throws CacheException
Lifecycle callback to perform any necessary initialization of the underlying cache provider. Called exactly once during the construction of aSessionFactoryImpl.- Parameters:
settings- The settings in effect.configValues- The available config values- Throws:
CacheException- Indicates problems starting the L2 cache impl; considered as a sign to stopSessionFactorybuilding.
-
isMinimalPutsEnabledByDefault
boolean isMinimalPutsEnabledByDefault()
By default should we perform "minimal puts" when using this second level cache implementation?- Returns:
- True if "minimal puts" should be performed by default; false otherwise.
-
getDefaultAccessType
AccessType getDefaultAccessType()
Get the default access type for any "user model" data
-
qualify
java.lang.String qualify(java.lang.String regionName)
-
createTransactionContext
default CacheTransactionSynchronization createTransactionContext(SharedSessionContractImplementor session)
-
nextTimestamp
long nextTimestamp()
Generate a timestamp. This value is generally used for purpose of locking/unlocking cache content depending upon the access-strategy being used. The intended consumer of this method is the Session to manage itsSharedSessionContractImplementor.getTransactionStartTimestamp()value. It is also expected that this be the value used for this's RegionFactory's CacheTransactionContext
-
getTimeout
default long getTimeout()
-
buildDomainDataRegion
DomainDataRegion buildDomainDataRegion(DomainDataRegionConfig regionConfig, DomainDataRegionBuildingContext buildingContext)
Create a named Region for holding domain model data- Parameters:
regionConfig- The user requested caching configuration for this RegionbuildingContext- Access to delegates useful in building the Region
-
buildQueryResultsRegion
QueryResultsRegion buildQueryResultsRegion(java.lang.String regionName, SessionFactoryImplementor sessionFactory)
-
buildTimestampsRegion
TimestampsRegion buildTimestampsRegion(java.lang.String regionName, SessionFactoryImplementor sessionFactory)
-
-