swarmcacheprovider.java

来自「人力资源管理系统主要包括:人员管理、招聘管理、培训管理、奖惩管理和薪金管理五大管」· Java 代码 · 共 28 行

JAVA
28
字号
//$Id: SwarmCacheProvider.java,v 1.1.2.7 2004/02/04 18:56:44 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() / 100;
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?