⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swarmcacheprovider.java

📁 用Java实现的23个常用设计模式源代码
💻 JAVA
字号:
//$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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -