1 22 package org.jboss.ejb3.entity; 23 24 import java.util.Properties ; 25 26 import org.hibernate.cache.Cache; 27 import org.hibernate.cache.CacheException; 28 import org.hibernate.cache.CacheProvider; 29 30 36 public class TreeCacheProviderHook implements CacheProvider 37 { 38 private TransactionalCacheFactory cacheFactory; 39 40 49 public Cache buildCache(String regionName, Properties properties) throws CacheException 50 { 51 return cacheFactory.buildCache(regionName, properties); 53 } 54 55 public boolean isMinimalPutsEnabledByDefault() 56 { 57 return false; 58 } 59 60 public long nextTimestamp() 61 { 62 return System.currentTimeMillis() / 100; 63 } 64 65 72 public void start(Properties properties) 73 { 74 cacheFactory = TransactionalCacheFactory.getFactory(properties); 75 } 86 87 public void stop() 88 { 89 } 90 91 } 92 | Popular Tags |