org.hibernate.cache
public class: SwarmCacheProvider [javadoc |
source]
java.lang.Object
org.hibernate.cache.SwarmCacheProvider
All Implemented Interfaces:
CacheProvider
Support for SwarmCache replicated cache. SwarmCache does not support
locking, so strict "read-write" semantics are unsupported.
| Method from org.hibernate.cache.SwarmCacheProvider Detail: |
public Cache buildCache(String regionName,
Properties properties) throws CacheException {
ObjectCache cache = factory.createCache(regionName);
if (cache==null) {
throw new CacheException("SwarmCache did not create a cache: " + regionName);
}
return new SwarmCache(cache, regionName);
}
|
public boolean isMinimalPutsEnabledByDefault() {
return true;
}
|
public long nextTimestamp() {
return System.currentTimeMillis() / 100;
}
|
public void start(Properties properties) throws CacheException {
CacheConfiguration config = CacheConfigurationManager.getConfig(properties);
factory = new CacheFactory(config);
}
Callback to perform any necessary initialization of the underlying cache implementation
during SessionFactory construction. |
public void stop() {
if (factory != null) {
factory.shutdown();
factory = null;
}
}
Callback to perform any necessary cleanup of the underlying cache implementation
during SessionFactory.close(). |