FileDocCategorySizeDatePackage
SwarmCacheProvider.javaAPI DocHibernate 3.2.51691Sat Feb 12 00:19:50 GMT 2005org.hibernate.cache

SwarmCacheProvider

public class SwarmCacheProvider extends Object implements CacheProvider
Support for SwarmCache replicated cache. SwarmCache does not support locking, so strict "read-write" semantics are unsupported.
author
Jason Carreira

Fields Summary
private net.sf.swarmcache.CacheFactory
factory
Constructors Summary
Methods Summary
public CachebuildCache(java.lang.String regionName, java.util.Properties properties)

        ObjectCache cache = factory.createCache(regionName);
        if (cache==null) {
	        throw new CacheException("SwarmCache did not create a cache: " + regionName);
        }
        return new SwarmCache(cache, regionName);
    
public booleanisMinimalPutsEnabledByDefault()

		return true;
	
public longnextTimestamp()

        return System.currentTimeMillis() / 100;
    
public voidstart(java.util.Properties properties)
Callback to perform any necessary initialization of the underlying cache implementation during SessionFactory construction.

param
properties current configuration settings.

        CacheConfiguration config = CacheConfigurationManager.getConfig(properties);
        factory = new CacheFactory(config);
	
public voidstop()
Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close().

		if (factory != null) {
			factory.shutdown();
			factory = null;
		}