Methods Summary |
---|
public org.hibernate.cache.Cache | buildCache(java.lang.String regionName, java.util.Properties properties)Construct and configure the Cache representation of a named cache region.
String regionPrefix = properties.getProperty("hibernate.cache.region_prefix");
if (optimistic)
{
return new OptimisticJBCCache(cache, regionName, regionPrefix);
}
else
{
return new JBCCache(cache, regionName, regionPrefix, TxUtil.getTransactionManager());
}
|
public org.jboss.cache.TreeCache | getUnderlyingCache()
return cache;
|
public boolean | isMinimalPutsEnabledByDefault()
return true;
|
public boolean | isOptimistic()
return optimistic;
|
public long | nextTimestamp()
return System.currentTimeMillis() / 100;
|
public void | start(java.util.Properties properties)Find the underlying JBoss Cache TreeCache instance.
try
{
String cacheName = (String) properties.get(HIBERNATE_CACHE_OBJECT_NAME_PROPERTY);
if (cacheName == null)
{
cacheName = DEFAULT_MBEAN_OBJECT_NAME;
}
ObjectName mbeanObjectName = new ObjectName(cacheName);
TreeCacheMBean mbean = (TreeCacheMBean) MBeanProxyExt.create(TreeCacheMBean.class, mbeanObjectName, MBeanServerLocator.locateJBoss());
cache = mbean.getInstance();
if ("OPTIMISTIC".equals(cache.getNodeLockingScheme()))
{
optimistic = true;
log.debug("JBoss Cache is configured for optimistic locking; " +
"provided Cache implementations will also implement OptimisticCache");
}
}
catch (Exception e)
{
throw new CacheException(e);
}
|
public void | stop()
|