kr.pe.kwonnam.hibernate4memcached.util.MemcachedTimestamper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate4-memcached-core Show documentation
Show all versions of hibernate4-memcached-core Show documentation
hibernate4 memcached L2 cache implementation.
package kr.pe.kwonnam.hibernate4memcached.util;
import kr.pe.kwonnam.hibernate4memcached.memcached.MemcachedAdapter;
import org.hibernate.cfg.Settings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Generates increasing identifier for {@link org.hibernate.cache.spi.RegionFactory#nextTimestamp()}.
*
* @author KwonNam Son ([email protected])
*/
public class MemcachedTimestamper {
private Logger log = LoggerFactory.getLogger(MemcachedTimestamper.class);
private Settings settings;
private OverridableReadOnlyProperties properties;
private MemcachedAdapter memcachedAdapter;
public MemcachedTimestamper() {
// do nothing;
}
public MemcachedTimestamper(Settings settings, OverridableReadOnlyProperties properties, MemcachedAdapter memcachedAdapter) {
this.settings = settings;
this.properties = properties;
this.memcachedAdapter = memcachedAdapter;
log.debug("timestamper initialized.");
}
public long next() {
return System.currentTimeMillis();
}
}