SHOP.COM Cache System 介绍
这是SHOP.COM 网站所使用的对象缓存系统,主要特性包括如下几个方面:
示例代码:
List<ScclientManager> clientSet = new ArrayList<ScclientManager>(); ScclientFactory clientFactory = ShopComCacheFactory.getClientFactory(); ScclientContext context = clientFactory.newContext(); context.address(new InetSocketAddress(/*address 1*/, /*port number 1*/)); ScclientManager manager = clientFactory.newClientManager(context); clientSet.add(manager); // add additional managers for each cache server myCache = new SCCache(new SCMultiManager(clientSet)); // see if your object is in the cache MyObject obj = (MyObject)myCache.get(new SCDataBlock(myKey)); // if it's not, allocate it and add it to the cache if ( obj == null ) { obj = new MyObject(); myCache.put(new SCDataBlock(myKey, obj)); }
SHOP.COM Cache System 官网
http://code.google.com/p/sccache/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。