swarmcacheprovider.java
来自「用Java实现的23个常用设计模式源代码」· Java 代码 · 共 28 行
JAVA
28 行
//$Id: SwarmCacheProvider.java,v 1.1.2.6 2003/11/24 03:25:29 oneovthafew Exp $
package net.sf.hibernate.cache;
import net.sf.swarmcache.CacheConfiguration;
import net.sf.swarmcache.CacheConfigurationManager;
import net.sf.swarmcache.CacheFactory;
import java.util.Properties;
/**
* Support for SwarmCache replicated cache. SwarmCache does not support
* locking, so strict "read-write" semantics are unsupported.
* @author Jason Carreira
*/
public class SwarmCacheProvider implements CacheProvider {
public Cache buildCache(String s, Properties properties) throws CacheException {
CacheConfiguration config = CacheConfigurationManager.getConfig(properties);
CacheFactory factory = new CacheFactory(config);
return new SwarmCache( factory.createCache(s) );
}
public long nextTimestamp() {
return System.currentTimeMillis();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?