Java集成各种cache组件 multicache4j
<p>multicache4j用于为Java集成各种cache组件: </p> <ul> <li>方便集成各种remote cache </li> <ul> <li>memcached (支持组件spymemcached) </li> <li>memcacheq (支持组件spymemcached) </li> <li>memcachedb (支持组件spymemcached) </li> <li>ttserver (支持组件spymemcached, ttserverclient) </li> <li>redis (支持组件jedis) </li> </ul> <li>方便集成各种local cache </li> <ul> <li>ehcache </li> </ul> <li>基于对象池技术管理客户端连接对象,网络断开能够自动重连 </li> <li>基于<a href="/misc/goto?guid=4959499893313561577" rel="nofollow">Pattern Mapping</a>进行哈希映射 </li> <li>支持remote cache和local cache的混合缓存 </li> <li>支持local cache的单独使用 </li> </ul> <ul> <li>multi cache (remote + local, or remote , or local):混合使用远程与本地Cache </li> </ul> <blockquote> 适用场景:单点应用+集群Cache <pre class="prettyprint"><span class="typ">MultiCacheFactory</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">().</span><span class="kwd">set</span><span class="pun">(</span><span class="str">"foo"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"bar"</span><span class="pun">);</span><span class="pln"> </span><span class="typ"> MultiCacheFactory</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">().</span><span class="kwd">get</span><span class="pun">(</span><span class="str">"foo"</span><span class="pun">);</span></pre> </blockquote> <ul> <li>remote cache:单独使用远程Cache </li> </ul> <blockquote> 适用场景:多点应用+集群Cache <pre class="prettyprint"><span class="typ">RemoteCacheFactory</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">().</span><span class="kwd">set</span><span class="pun">(</span><span class="str">"foo"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"bar"</span><span class="pun">);</span><span class="pln"> </span><span class="typ"> RemoteCacheFactory</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">().</span><span class="kwd">get</span><span class="pun">(</span><span class="str">"foo"</span><span class="pun">);</span><span class="pln"> </span><span class="typ"> RemoteCacheFactory</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">().</span><span class="kwd">del</span><span class="pun">(</span><span class="str">"foo"</span><span class="pun">);</span></pre> </blockquote> <ul> <li>local cache:单独使用本地Cache </li> </ul> <blockquote> 适用场景:单点应用/多点应用 <pre class="prettyprint"><span class="typ">LocalCacheFactory</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">().</span><span class="kwd">set</span><span class="pun">(</span><span class="str">"foo"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"bar"</span><span class="pun">);</span><span class="pln"> </span><span class="typ"> LocalCacheFactory</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">().</span><span class="kwd">get</span><span class="pun">(</span><span class="str">"foo"</span><span class="pun">);</span></pre> </blockquote> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1324813123124" target="_blank">http://www.open-open.com/lib/view/home/1324813123124</a></p>
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!