From: <one...@us...> - 2003-02-02 00:29:09
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache In directory sc8-pr-cvs1:/tmp/cvs-serv18747/net/sf/hibernate/cache Modified Files: Cache.java CacheTest.java JCSCache.java Log Message: added support for configuring caching in .cfg.xml much saner collection role naming improved logging during startup Index: Cache.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/Cache.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Cache.java 5 Jan 2003 02:11:20 -0000 1.3 --- Cache.java 2 Feb 2003 00:29:06 -0000 1.4 *************** *** 28,36 **** public void setTimeout(int timeout); /** ! * Set the persistent class to be cached ! * @param clazz * @throws CacheException */ ! public void setClass(String clazz) throws CacheException; } --- 28,36 ---- public void setTimeout(int timeout); /** ! * Set the cache region name ! * @param regionName * @throws CacheException */ ! public void setRegion(String regionName) throws CacheException; } Index: CacheTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/CacheTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CacheTest.java 27 Jan 2003 13:20:16 -0000 1.4 --- CacheTest.java 2 Feb 2003 00:29:06 -0000 1.5 *************** *** 12,16 **** public void testCaches() throws Exception { doTestCache( new JCSCache() ); - doTestCache( new HashBelt() ); } --- 12,15 ---- *************** *** 25,29 **** Thread.sleep(15); ! cache.setClass( String.class.getName() ); cache.setTimeout(1000); CacheConcurrencyStrategy ccs = new ReadWriteCache(cache); --- 24,28 ---- Thread.sleep(15); ! cache.setRegion( String.class.getName() ); cache.setTimeout(1000); CacheConcurrencyStrategy ccs = new ReadWriteCache(cache); *************** *** 125,135 **** assertTrue( ccs.get("foo", longLongAfter).equals("baz") ); - - if ( cache instanceof HashBelt ) { - Thread.sleep(2000); - assertTrue( ccs.get("foo", longLongAfter)==null ); } - - } } --- 124,128 ---- Index: JCSCache.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/JCSCache.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JCSCache.java 5 Jan 2003 02:11:20 -0000 1.3 --- JCSCache.java 2 Feb 2003 00:29:06 -0000 1.4 *************** *** 17,24 **** public JCSCache() {} ! public void setClass(String clazz) throws CacheException { try { ! region = JCS.getInstance(clazz); } catch (org.apache.jcs.access.exception.CacheException e) { --- 17,24 ---- public JCSCache() {} ! public void setRegion(String regionName) throws CacheException { try { ! region = JCS.getInstance(regionName); } catch (org.apache.jcs.access.exception.CacheException e) { |