Top Description Fields Methods
org.hibernate.cache.spi

public Interface RegionFactory

extends Service, Stoppable
Known Direct Subinterfaces
org.hibernate.cache.RegionFactory
Known Direct Implementers
org.hibernate.cache.internal.NoCachingRegionFactory, org.hibernate.cache.spi.AbstractRegionFactory
Imports
java.util.Map, org.hibernate.boot.spi.SessionFactoryOptions, org.hibernate.cache.CacheException, org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext, .DomainDataRegionConfig, org.hibernate.cache.spi.access.AccessType, org.hibernate.engine.spi.SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.service.Service, org.hibernate.service.spi.Stoppable

Contract for building second level cache regions.

Implementors should define a constructor in one of two forms:

Use the first when we need to read config properties prior to start being called.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final String
public static final String

Method Summary

Modifier and TypeMethod and Description
public DomainDataRegion
buildDomainDataRegion(DomainDataRegionConfig
The user requested caching configuration for this Region
regionConfig
,
DomainDataRegionBuildingContext
Access to delegates useful in building the Region
buildingContext
)

Create a named Region for holding domain model data

public QueryResultsRegion
buildQueryResultsRegion(String regionName, SessionFactoryImplementor sessionFactory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public TimestampsRegion
buildTimestampsRegion(String regionName, SessionFactoryImplementor sessionFactory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public default CacheTransactionSynchronization
public AccessType
getDefaultAccessType()

Get the default access type for any "user model" data

public default long
public boolean

Returns:

True if "minimal puts" should be performed by default; false otherwise.
isMinimalPutsEnabledByDefault
()

By default should we perform "minimal puts" when using this second level cache implementation?

public long
nextTimestamp()

Generate a timestamp.

public String
qualify(String regionName)

public void
start(SessionFactoryOptions
The settings in effect.
settings
,
Map<K, V>
The available config values
configValues
)

Lifecycle callback to perform any necessary initialization of the underlying cache provider.

Inherited from org.hibernate.service.spi.Stoppable:
stop

Field Detail

DEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAMEback to summary
public static final String DEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAME
DEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAMEback to summary
public static final String DEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAME

Method Detail

buildDomainDataRegionback to summary
public DomainDataRegion buildDomainDataRegion(DomainDataRegionConfig regionConfig, DomainDataRegionBuildingContext buildingContext)

Create a named Region for holding domain model data

Parameters
regionConfig:DomainDataRegionConfig

The user requested caching configuration for this Region

buildingContext:DomainDataRegionBuildingContext

Access to delegates useful in building the Region

buildQueryResultsRegionback to summary
public QueryResultsRegion buildQueryResultsRegion(String regionName, SessionFactoryImplementor sessionFactory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

buildTimestampsRegionback to summary
public TimestampsRegion buildTimestampsRegion(String regionName, SessionFactoryImplementor sessionFactory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

createTransactionContextback to summary
public default CacheTransactionSynchronization createTransactionContext(SharedSessionContractImplementor session)
getDefaultAccessTypeback to summary
public AccessType getDefaultAccessType()

Get the default access type for any "user model" data

getTimeoutback to summary
public default long getTimeout()
isMinimalPutsEnabledByDefaultback to summary
public boolean isMinimalPutsEnabledByDefault()

By default should we perform "minimal puts" when using this second level cache implementation?

Returns:boolean

True if "minimal puts" should be performed by default; false otherwise.

nextTimestampback to summary
public 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 its SharedSessionContractImplementor#getTransactionStartTimestamp value. It is also expected that this be the value used for this's RegionFactory's CacheTransactionContext

API Note

This "timestamp" need not be related to timestamp in the Java Date/millisecond sense. It just needs to be an incrementing value

qualifyback to summary
public String qualify(String regionName)
startback to summary
public void start(SessionFactoryOptions settings, Map<K, V> configValues) throws CacheException

Lifecycle callback to perform any necessary initialization of the underlying cache provider. Called exactly once during the construction of a org.hibernate.internal.SessionFactoryImpl.

Parameters
settings:SessionFactoryOptions

The settings in effect.

configValues:Map<K, V>

The available config values

Exceptions
CacheException:
Indicates problems starting the L2 cache impl; considered as a sign to stop org.hibernate.SessionFactory building.