01: /*
02: * Created on Dec 19, 2004 by pjacob
03: *
04: */
05: package com.whirlycott.cache.hibernate;
06:
07: import java.util.Properties;
08:
09: import org.apache.commons.logging.Log;
10: import org.apache.commons.logging.LogFactory;
11:
12: import com.whirlycott.cache.Messages;
13:
14: import net.sf.hibernate.cache.Cache;
15: import net.sf.hibernate.cache.CacheException;
16: import net.sf.hibernate.cache.CacheProvider;
17: import net.sf.hibernate.cache.Timestamper;
18:
19: /**
20: * @author pjacob
21: *
22: */
23: public class WhirlycacheProvider implements CacheProvider {
24:
25: /**
26: * Logger.
27: */
28: private static final Log log = LogFactory
29: .getLog(WhirlycacheProvider.class);
30:
31: /*
32: * (non-Javadoc)
33: *
34: * @see net.sf.hibernate.cache.CacheProvider#buildCache(java.lang.String,
35: * java.util.Properties)
36: */
37: public Cache buildCache(final String _name, final Properties _props)
38: throws CacheException {
39: log
40: .debug(Messages
41: .getString("WhirlycacheProvider.building_cache") + _name); //$NON-NLS-1$
42: return new WhirlycachePlugin(_name);
43: }
44:
45: /*
46: * (non-Javadoc)
47: *
48: * @see net.sf.hibernate.cache.CacheProvider#nextTimestamp()
49: */
50: public long nextTimestamp() {
51: return Timestamper.next();
52: }
53:
54: }
|