|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
public class SingletonEhCacheRegionFactory
A singleton EhCacheRegionFactory implementation.
Field Summary | |
---|---|
protected EhcacheAccessStrategyFactory |
accessStrategyFactory
EhcacheAccessStrategyFactory for creating various access strategies |
protected net.sf.ehcache.CacheManager |
manager
Ehcache CacheManager that supplied Ehcache instances for this Hibernate RegionFactory. |
protected ProviderMBeanRegistrationHelper |
mbeanRegistrationHelper
MBean registration helper class instance for Ehcache Hibernate MBeans. |
static String |
NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
The Hibernate system property specifying the location of the ehcache configuration file name. |
protected Settings |
settings
Settings object for the Hibernate persistence unit. |
Constructor Summary | |
---|---|
SingletonEhCacheRegionFactory(Properties prop)
Returns a representation of the singleton EhCacheRegionFactory |
Method Summary | |
---|---|
CollectionRegion |
buildCollectionRegion(String regionName,
Properties properties,
CacheDataDescription metadata)
Build a cache region specialized for storing collection data. |
EntityRegion |
buildEntityRegion(String regionName,
Properties properties,
CacheDataDescription metadata)
Build a cache region specialized for storing entity data. |
NaturalIdRegion |
buildNaturalIdRegion(String regionName,
Properties properties,
CacheDataDescription metadata)
Build a cache region specialized for storing NaturalId to Primary Key mappings. |
QueryResultsRegion |
buildQueryResultsRegion(String regionName,
Properties properties)
Build a cache region specialized for storing query results |
TimestampsRegion |
buildTimestampsRegion(String regionName,
Properties properties)
Build a cache region specialized for storing update-timestamps data. |
AccessType |
getDefaultAccessType()
Default access-type used when the configured using JPA 2.0 config. |
boolean |
isMinimalPutsEnabledByDefault()
Whether to optimize for minimals puts or minimal gets. |
protected URL |
loadResource(String configurationResourceName)
Load a resource from the classpath. |
long |
nextTimestamp()
Generate a timestamp. |
void |
setClassLoaderService(ClassLoaderService classLoaderService)
|
void |
start(Settings settings,
Properties properties)
Lifecycle callback to perform any necessary initialization of the underlying cache implementation(s). |
void |
stop()
Lifecycle callback to perform any necessary cleanup of the underlying cache implementation(s). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
protected final ProviderMBeanRegistrationHelper mbeanRegistrationHelper
protected volatile net.sf.ehcache.CacheManager manager
protected Settings settings
protected final EhcacheAccessStrategyFactory accessStrategyFactory
EhcacheAccessStrategyFactory
for creating various access strategies
Constructor Detail |
---|
public SingletonEhCacheRegionFactory(Properties prop)
Method Detail |
---|
public void start(Settings settings, Properties properties) throws CacheException
SessionFactoryImpl
.
settings
- The settings in effect.properties
- The defined cfg properties
CacheException
- Indicates problems starting the L2 cache impl;
considered as a sign to stop SessionFactory
building.public void stop()
SessionFactory.close()
.
public boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault
in interface RegionFactory
public long nextTimestamp()
nextTimestamp
in interface RegionFactory
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException
buildEntityRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.metadata
- Information regarding the type of data to be cached
CacheException
- Indicates problems building the region.public NaturalIdRegion buildNaturalIdRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException
RegionFactory
buildNaturalIdRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.metadata
- Information regarding the type of data to be cached
CacheException
- Indicates problems building the region.public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException
buildCollectionRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.metadata
- Information regarding the type of data to be cached
CacheException
- Indicates problems building the region.public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties) throws CacheException
buildQueryResultsRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.
CacheException
- Indicates problems building the region.public void setClassLoaderService(ClassLoaderService classLoaderService)
public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException
buildTimestampsRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.
CacheException
- Indicates problems building the region.protected URL loadResource(String configurationResourceName)
public AccessType getDefaultAccessType()
@Cacheable(true)
to be attached to an
entity without any access type or usage qualification.
We are conservative here in specifying AccessType.READ_WRITE
so as to follow the mantra of "do no harm".
This is a Hibernate 3.5 method.
getDefaultAccessType
in interface RegionFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |