org.hibernate.cache.jbc2
public class: JBossCacheRegionFactory [javadoc |
source]
java.lang.Object
org.hibernate.cache.jbc2.JBossCacheRegionFactory
All Implemented Interfaces:
RegionFactory
Direct Known Subclasses:
JndiSharedJBossCacheRegionFactory, MultiplexedJBossCacheRegionFactory, JndiMultiplexedJBossCacheRegionFactory, SharedJBossCacheRegionFactory
RegionFactory that uses one or more JBoss Cache instances for
caching entities, collections, queries and timestamps. How the factory
obtains a reference to the needed JBoss Cache instance(s) is determined
by the injected
CacheInstanceManager .
By default uses SharedCacheInstanceManager as its
CacheInstanceManager .
Basically, this uses a single shared JBoss Cache for entities, collections,
queries and timestamps. The JBoss Cache instance is created by the
JBC DefaultCacheFactory using the resource identified by the
JndiSharedCacheInstanceManager#CACHE_RESOURCE_PROP
configuration property.
Also exposes an overloaded constructor that allows injection of different
CacheInstanceManager implementations.
- author:
Steve - Ebersole
- author:
Brian - Stansberry
| Method from org.hibernate.cache.jbc2.JBossCacheRegionFactory Detail: |
public CollectionRegion buildCollectionRegion(String regionName,
Properties properties,
CacheDataDescription metadata) throws CacheException {
return new CollectionRegionImpl(cacheInstanceManager.getCollectionCacheInstance(), regionName,
getRegionPrefix(properties), metadata);
}
|
public EntityRegion buildEntityRegion(String regionName,
Properties properties,
CacheDataDescription metadata) throws CacheException {
return new EntityRegionImpl(cacheInstanceManager.getEntityCacheInstance(), regionName,
getRegionPrefix(properties), metadata);
}
|
public QueryResultsRegion buildQueryResultsRegion(String regionName,
Properties properties) throws CacheException {
return new QueryResultsRegionImpl(cacheInstanceManager.getQueryCacheInstance(), regionName,
getRegionPrefix(properties), properties);
}
|
public TimestampsRegion buildTimestampsRegion(String regionName,
Properties properties) throws CacheException {
return new TimestampsRegionImpl(cacheInstanceManager.getTimestampsCacheInstance(), regionName,
getRegionPrefix(properties), properties);
}
|
public CacheInstanceManager getCacheInstanceManager() {
return cacheInstanceManager;
}
|
public static String getRegionPrefix(Properties properties) {
return PropertiesHelper.getString(Environment.CACHE_REGION_PREFIX, properties, null);
}
|
public boolean isMinimalPutsEnabledByDefault() {
return true;
}
|
public long nextTimestamp() {
return System.currentTimeMillis() / 100;
}
|
public void start(Settings settings,
Properties properties) throws CacheException {
if (cacheInstanceManager == null) {
cacheInstanceManager = new SharedCacheInstanceManager();
}
cacheInstanceManager.start(settings, properties);
}
|
public void stop() {
if (cacheInstanceManager != null) {
cacheInstanceManager.stop();
}
}
|