FileDocCategorySizeDatePackage
JndiBoundTreeCacheProvider.javaAPI DocHibernate 3.2.51901Tue Mar 15 23:01:18 GMT 2005org.hibernate.cache

JndiBoundTreeCacheProvider

public class JndiBoundTreeCacheProvider extends AbstractJndiBoundCacheProvider
Support for JBossCache (TreeCache), where the cache instance is available via JNDI lookup.
author
Steve Ebersole

Fields Summary
private TransactionManager
transactionManager
Constructors Summary
Methods Summary
public CachebuildCache(java.lang.String regionName, java.util.Properties properties)
Construct a Cache representing the "region" within in the underlying cache provider.

param
regionName the name of the cache region
param
properties configuration settings
throws
CacheException

		return new TreeCache( getTreeCacheInstance(), regionName, transactionManager );
	
public org.jboss.cache.TreeCachegetTreeCacheInstance()

		return ( org.jboss.cache.TreeCache ) super.getCache();
	
public booleanisMinimalPutsEnabledByDefault()
By default, should minimal-puts mode be enabled when using this cache.

Since TreeCache is a clusterable cache and we are only getting a reference the instance from JNDI, safest to assume a clustered setup and return true here.

return
True.

		return true;
	
public longnextTimestamp()
Generate a timestamp

		return System.currentTimeMillis() / 100;
	
public voidprepare(java.util.Properties properties)

		TransactionManagerLookup transactionManagerLookup = TransactionManagerLookupFactory.getTransactionManagerLookup(properties);
		if (transactionManagerLookup!=null) {
			transactionManager = transactionManagerLookup.getTransactionManager(properties);
		}