All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xson.web.cache.helper.MemcachedHelper Maven / Gradle / Ivy

Go to download

xco-web is an easy to use control layer framework, is part of the SOA system, using xml language to describe the controller.

The newest version!
package org.xson.web.cache.helper;

import java.util.Map;

import org.xson.web.Container;
import org.xson.web.cache.MemcachedCache;
import org.xson.web.cache.vo.CacheVo;

import com.whalin.MemCached.MemCachedClient;

public class MemcachedHelper {

	/**
	 * 从系统容器中获取MemcachedCache实例
	 * 
	 * @param cacheId
	 * @return
	 */
	public static MemCachedClient getMemcachedCache(String cacheId) {
		Map cacheVoMap = Container.getInstance().getCacheVoMap();
		CacheVo cacheVo = cacheVoMap.get(cacheId);
		if (null != cacheVo) {
			MemcachedCache memcachedCache = (MemcachedCache) cacheVo.getCache();
			return memcachedCache.getCachedClient();
		}
		return null;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy