锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲理论电影在线观看,亚洲一区二区久久,亚洲精彩视频在线观看http://m.tkk7.com/paulwong/category/50662.htmlzh-cnSat, 24 Aug 2019 00:16:02 GMTSat, 24 Aug 2019 00:16:02 GMT60SPRING CACHE涔婥oncurrentMapCacheManager鏀歸?/title><link>http://m.tkk7.com/paulwong/archive/2015/02/25/423034.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 25 Feb 2015 08:34:00 GMT</pubDate><guid>http://m.tkk7.com/paulwong/archive/2015/02/25/423034.html</guid><wfw:comment>http://m.tkk7.com/paulwong/comments/423034.html</wfw:comment><comments>http://m.tkk7.com/paulwong/archive/2015/02/25/423034.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/paulwong/comments/commentRss/423034.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/paulwong/services/trackbacks/423034.html</trackback:ping><description><![CDATA[ConcurrentMapCacheManager鍙互浣滀負涓縐嶇紦瀛樻柟妗堬紝浣嗕笉鑳借緗繃鏈燂紝鏈澶х紦瀛樻潯鐩瓑錛岄渶榪涜鏀歸犮?br /> <ol> <li>pom.xml涓姞鍏ヤ緷璧栧寘<br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->        <span style="color: #0000FF; "><</span><span style="color: #800000; ">dependency</span><span style="color: #0000FF; ">></span><br />            <span style="color: #0000FF; "><</span><span style="color: #800000; ">groupId</span><span style="color: #0000FF; ">></span>com.google.guava<span style="color: #0000FF; "></</span><span style="color: #800000; ">groupId</span><span style="color: #0000FF; ">></span><br />            <span style="color: #0000FF; "><</span><span style="color: #800000; ">artifactId</span><span style="color: #0000FF; ">></span>guava<span style="color: #0000FF; "></</span><span style="color: #800000; ">artifactId</span><span style="color: #0000FF; ">></span><br />            <span style="color: #0000FF; "><</span><span style="color: #800000; ">version</span><span style="color: #0000FF; ">></span>18.0<span style="color: #0000FF; "></</span><span style="color: #800000; ">version</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "></</span><span style="color: #800000; ">dependency</span><span style="color: #0000FF; ">></span></div> <br /> </li> <li>鏀歸燙acheManager錛孧yConcurrentMapCacheManager<br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">package</span> com.paul.common.cache;<br /><span style="color: #008000; ">/*</span><span style="color: #008000; "><br /> * Copyright 2002-2014 the original author or authors.<br /> *<br /> * Licensed under the Apache License, Version 2.0 (the "License");<br /> * you may not use this file except in compliance with the License.<br /> * You may obtain a copy of the License at<br /> *<br /> *      </span><span style="color: #008000; text-decoration: underline; ">http://www.apache.org/licenses/LICENSE-2.0</span><span style="color: #008000; "><br /> *<br /> * Unless required by applicable law or agreed to in writing, software<br /> * distributed under the License is distributed on an "AS IS" BASIS,<br /> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br /> * See the License for the specific language governing permissions and<br /> * limitations under the License.<br /> </span><span style="color: #008000; ">*/</span><br /><br /><span style="color: #0000FF; ">import</span> java.util.Collection;<br /><span style="color: #0000FF; ">import</span> java.util.Collections;<br /><span style="color: #0000FF; ">import</span> java.util.Map;<br /><span style="color: #0000FF; ">import</span> java.util.concurrent.ConcurrentHashMap;<br /><span style="color: #0000FF; ">import</span> java.util.concurrent.ConcurrentMap;<br /><span style="color: #0000FF; ">import</span> java.util.concurrent.TimeUnit;<br /><br /><span style="color: #0000FF; ">import</span> org.springframework.cache.Cache;<br /><span style="color: #0000FF; ">import</span> org.springframework.cache.CacheManager;<br /><span style="color: #0000FF; ">import</span> org.springframework.cache.concurrent.ConcurrentMapCache;<br /><br /><span style="color: #0000FF; ">import</span> com.google.common.cache.CacheBuilder;<br /><br /><span style="color: #008000; ">/**</span><span style="color: #008000; "><br /> * {</span><span style="color: #808080; ">@link</span><span style="color: #008000; "> CacheManager} implementation that lazily builds {</span><span style="color: #808080; ">@link</span><span style="color: #008000; "> ConcurrentMapCache}<br /> * instances for each {</span><span style="color: #808080; ">@link</span><span style="color: #008000; "> #getCache} request. Also supports a 'static' mode where<br /> * the set of cache names is pre-defined through {</span><span style="color: #808080; ">@link</span><span style="color: #008000; "> #setCacheNames}, with no<br /> * dynamic creation of further cache regions at runtime.<br /> *<br /> * <p>Note: This is by no means a sophisticated CacheManager; it comes with no<br /> * cache configuration options. However, it may be useful for testing or simple<br /> * caching scenarios. For advanced local caching needs, consider<br /> * {</span><span style="color: #808080; ">@link</span><span style="color: #008000; "> org.springframework.cache.guava.GuavaCacheManager} or<br /> * {</span><span style="color: #808080; ">@link</span><span style="color: #008000; "> org.springframework.cache.ehcache.EhCacheCacheManager}.<br /> *<br /> * </span><span style="color: #808080; ">@author</span><span style="color: #008000; "> Juergen Hoeller<br /> * </span><span style="color: #808080; ">@since</span><span style="color: #008000; "> 3.1<br /> * </span><span style="color: #808080; ">@see</span><span style="color: #008000; "> ConcurrentMapCache<br /> </span><span style="color: #008000; ">*/</span><br /><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> MyConcurrentMapCacheManager <span style="color: #0000FF; ">implements</span> CacheManager {<br /><br />    <span style="color: #0000FF; ">private</span> <span style="color: #0000FF; ">final</span> ConcurrentMap<String, Cache> cacheMap = <span style="color: #0000FF; ">new</span> ConcurrentHashMap<String, Cache>(16);<br /><br />    <span style="color: #0000FF; ">private</span> <span style="color: #0000FF; ">boolean</span> dynamic = <span style="color: #0000FF; ">true</span>;<br /><br />    <span style="color: #0000FF; ">private</span> <span style="color: #0000FF; ">boolean</span> allowNullValues = <span style="color: #0000FF; ">true</span>;<br />    <br />    <span style="color: #0000FF; ">private</span> <span style="color: #0000FF; ">long</span> expireTime = 30;<br />    <br />    <span style="color: #0000FF; ">private</span> <span style="color: #0000FF; ">long</span> maximumSize = 100;<br /><br /><br />    <span style="color: #008000; ">/**</span><span style="color: #008000; "><br />     * Construct a dynamic ConcurrentMapCacheManager,<br />     * lazily creating cache instances as they are being requested.<br />     </span><span style="color: #008000; ">*/</span><br />    <span style="color: #0000FF; ">public</span> MyConcurrentMapCacheManager() {<br />    }<br /><br />    <span style="color: #008000; ">/**</span><span style="color: #008000; "><br />     * Construct a static ConcurrentMapCacheManager,<br />     * managing caches for the specified cache names only.<br />     </span><span style="color: #008000; ">*/</span><br />    <span style="color: #0000FF; ">public</span> MyConcurrentMapCacheManager(<span style="color: #0000FF; ">long</span> expireTime, <span style="color: #0000FF; ">long</span> maximumSize) {<br />        <span style="color: #0000FF; ">if</span>(expireTime > 0)<br />            <span style="color: #0000FF; ">this</span>.expireTime = expireTime;<br />        <span style="color: #0000FF; ">if</span>(maximumSize > 0)<br />            <span style="color: #0000FF; ">this</span>.maximumSize = maximumSize;<br />    }<br /><br /><br />    <span style="color: #008000; ">/**</span><span style="color: #008000; "><br />     * Specify the set of cache names for this CacheManager's 'static' mode.<br />     * <p>The number of caches and their names will be fixed after a call to this method,<br />     * with no creation of further cache regions at runtime.<br />     * <p>Calling this with a {</span><span style="color: #808080; ">@code</span><span style="color: #008000; "> null} collection argument resets the<br />     * mode to 'dynamic', allowing for further creation of caches again.<br />     </span><span style="color: #008000; ">*/</span><br />    <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">void</span> setCacheNames(Collection<String> cacheNames) {<br />        <span style="color: #0000FF; ">if</span> (cacheNames != <span style="color: #0000FF; ">null</span>) {<br />            <span style="color: #0000FF; ">for</span> (String name : cacheNames) {<br />                <span style="color: #0000FF; ">this</span>.cacheMap.put(name, createConcurrentMapCache(name));<br />            }<br />            <span style="color: #0000FF; ">this</span>.dynamic = <span style="color: #0000FF; ">false</span>;<br />        }<br />        <span style="color: #0000FF; ">else</span> {<br />            <span style="color: #0000FF; ">this</span>.dynamic = <span style="color: #0000FF; ">true</span>;<br />        }<br />    }<br /><br />    <span style="color: #008000; ">/**</span><span style="color: #008000; "><br />     * Specify whether to accept and convert {</span><span style="color: #808080; ">@code</span><span style="color: #008000; "> null} values for all caches<br />     * in this cache manager.<br />     * <p>Default is "true", despite ConcurrentHashMap itself not supporting {</span><span style="color: #808080; ">@code</span><span style="color: #008000; "> null}<br />     * values. An internal holder object will be used to store user-level {</span><span style="color: #808080; ">@code</span><span style="color: #008000; "> null}s.<br />     * <p>Note: A change of the null-value setting will reset all existing caches,<br />     * if any, to reconfigure them with the new null-value requirement.<br />     </span><span style="color: #008000; ">*/</span><br />    <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">void</span> setAllowNullValues(<span style="color: #0000FF; ">boolean</span> allowNullValues) {<br />        <span style="color: #0000FF; ">if</span> (allowNullValues != <span style="color: #0000FF; ">this</span>.allowNullValues) {<br />            <span style="color: #0000FF; ">this</span>.allowNullValues = allowNullValues;<br />            <span style="color: #008000; ">//</span><span style="color: #008000; "> Need to recreate all Cache instances with the new null-value configuration<img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span style="color: #008000; "><br /></span>            <span style="color: #0000FF; ">for</span> (Map.Entry<String, Cache> entry : <span style="color: #0000FF; ">this</span>.cacheMap.entrySet()) {<br />                entry.setValue(createConcurrentMapCache(entry.getKey()));<br />            }<br />        }<br />    }<br /><br />    <span style="color: #008000; ">/**</span><span style="color: #008000; "><br />     * Return whether this cache manager accepts and converts {</span><span style="color: #808080; ">@code</span><span style="color: #008000; "> null} values<br />     * for all of its caches.<br />     </span><span style="color: #008000; ">*/</span><br />    <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">boolean</span> isAllowNullValues() {<br />        <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">this</span>.allowNullValues;<br />    }<br /><br /><br />    @Override<br />    <span style="color: #0000FF; ">public</span> Collection<String> getCacheNames() {<br />        <span style="color: #0000FF; ">return</span> Collections.unmodifiableSet(<span style="color: #0000FF; ">this</span>.cacheMap.keySet());<br />    }<br /><br />    @Override<br />    <span style="color: #0000FF; ">public</span> Cache getCache(String name) {<br />        Cache cache = <span style="color: #0000FF; ">this</span>.cacheMap.get(name);<br />        <span style="color: #0000FF; ">if</span> (cache == <span style="color: #0000FF; ">null</span> && <span style="color: #0000FF; ">this</span>.dynamic) {<br />            <span style="color: #0000FF; ">synchronized</span> (<span style="color: #0000FF; ">this</span>.cacheMap) {<br />                cache = <span style="color: #0000FF; ">this</span>.cacheMap.get(name);<br />                <span style="color: #0000FF; ">if</span> (cache == <span style="color: #0000FF; ">null</span>) {<br />                    cache = createConcurrentMapCache(name);<br />                    <span style="color: #0000FF; ">this</span>.cacheMap.put(name, cache);<br />                }<br />            }<br />        }<br />        <span style="color: #0000FF; ">return</span> cache;<br />    }<br /><br />    <span style="color: #008000; ">/**</span><span style="color: #008000; "><br />     * Create a new ConcurrentMapCache instance for the specified cache name.<br />     * </span><span style="color: #808080; ">@param</span><span style="color: #008000; "> name the name of the cache<br />     * </span><span style="color: #808080; ">@return</span><span style="color: #008000; "> the ConcurrentMapCache (or a decorator thereof)<br />     </span><span style="color: #008000; ">*/</span><br />    <span style="color: #0000FF; ">protected</span> Cache createConcurrentMapCache(String name) {<br /><span style="color: #008000; ">        //</span><span style="color: #008000; ">return new ConcurrentMapCache(name, isAllowNullValues());<br /></span><span style="color: #008000; ">        //</span><span style="color: #008000; ">姝ゅ鏀圭敤GOOGLE GUAVA鐨勬瀯閫燤ANAGER鏂瑰紡</span><span style="color: #008000; "><br /></span>        <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">new</span> ConcurrentMapCache(name,<br />                                        CacheBuilder.newBuilder()<br />                                                    .expireAfterWrite(<span style="color: #0000FF; ">this</span>.expireTime, TimeUnit.MINUTES)<br />                                                    .maximumSize(<span style="color: #0000FF; ">this</span>.maximumSize)<br />                                                    .build()<br />                                                    .asMap(), <br />                                        isAllowNullValues());<br />    }<br /><br />}</div><br /> <br /> </li> <li>閰嶇疆鎯崇潃bean, cache-concurrentmap-applicationcontext.xml<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><?</span><span style="color: #FF00FF; ">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000FF; ">?></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">beans </span><span style="color: #FF0000; ">xmlns</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/beans"</span><span style="color: #FF0000; "><br />    xmlns:xsi</span><span style="color: #0000FF; ">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #FF0000; "> xmlns:context</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/context"</span><span style="color: #FF0000; "><br />    xmlns:cache</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/cache"</span><span style="color: #FF0000; "><br />    xmlns:p</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/p"</span><span style="color: #FF0000; "><br />    xmlns:c</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/c"</span><span style="color: #FF0000; "><br />    xmlns:jee</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/jee"</span><span style="color: #FF0000; "><br />    xmlns:util</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/util"</span><span style="color: #FF0000; "><br />    xsi:schemaLocation</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/context<br />          http://www.springframework.org/schema/context/spring-context-3.0.xsd<br />          http://www.springframework.org/schema/beans<br />          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd<br />          http://www.springframework.org/schema/cache<br />          http://www.springframework.org/schema/cache/spring-cache.xsd<br />          http://www.springframework.org/schema/jee <br />          http://www.springframework.org/schema/jee/spring-jee.xsd<br />          http://www.springframework.org/schema/util<br />          http://www.springframework.org/schema/util/spring-util.xsd"</span><span style="color: #0000FF; ">></span><br /><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">cache:annotation-driven </span><span style="color: #0000FF; ">/></span><br /><br />    <span style="color: #008000; "><!--</span><span style="color: #008000; "> <bean id="cacheManager"<br />        class="org.springframework.cache.concurrent.ConcurrentMapCacheManager" ><br />        <property name="cacheNames"><br />            <list><br />                <value>my-local-cache</value><br />            </list><br />        </property><br />    </bean> </span><span style="color: #008000; ">--></span><br />    <br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">bean </span><span style="color: #FF0000; ">id</span><span style="color: #0000FF; ">="cacheManager"</span><span style="color: #FF0000; "><br />        class</span><span style="color: #0000FF; ">="com.paul.common.cache.MyConcurrentMapCacheManager"</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">constructor-arg </span><span style="color: #FF0000; ">index</span><span style="color: #0000FF; ">="0"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="1"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">constructor-arg </span><span style="color: #FF0000; ">index</span><span style="color: #0000FF; ">="1"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="5000"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><br />    <span style="color: #0000FF; "></</span><span style="color: #800000; ">bean</span><span style="color: #0000FF; ">></span>    <br />    <br /><span style="color: #0000FF; "></</span><span style="color: #800000; ">beans</span><span style="color: #0000FF; ">></span></div> <br /> <br /> </li> <li>閫氳繃娉ㄩ噴榪涜浣跨敤<br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; ">/*</span><span style="color: #008000; "><br /> * JBoss, Home of Professional Open Source<br /> * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual<br /> * contributors by the @authors tag. See the copyright.txt in the<br /> * distribution for a full listing of individual contributors.<br /> *<br /> * Licensed under the Apache License, Version 2.0 (the "License");<br /> * you may not use this file except in compliance with the License.<br /> * You may obtain a copy of the License at<br /> * </span><span style="color: #008000; text-decoration: underline; ">http://www.apache.org/licenses/LICENSE-2.0</span><span style="color: #008000; "><br /> * Unless required by applicable law or agreed to in writing, software<br /> * distributed under the License is distributed on an "AS IS" BASIS,<br /> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br /> * See the License for the specific language governing permissions and<br /> * limitations under the License.<br /> </span><span style="color: #008000; ">*/</span><br /><span style="color: #0000FF; ">package</span> com.paul.springmvc.data;<br /><br /><span style="color: #0000FF; ">import</span> java.util.List;<br /><br /><span style="color: #0000FF; ">import</span> javax.persistence.EntityManager;<br /><span style="color: #0000FF; ">import</span> javax.persistence.criteria.CriteriaBuilder;<br /><span style="color: #0000FF; ">import</span> javax.persistence.criteria.CriteriaQuery;<br /><span style="color: #0000FF; ">import</span> javax.persistence.criteria.Root;<br /><br /><span style="color: #0000FF; ">import</span> org.springframework.beans.factory.annotation.Autowired;<br /><span style="color: #0000FF; ">import</span> org.springframework.cache.annotation.CacheEvict;<br /><span style="color: #0000FF; ">import</span> org.springframework.cache.annotation.Cacheable;<br /><span style="color: #0000FF; ">import</span> org.springframework.stereotype.Repository;<br /><span style="color: #0000FF; ">import</span> org.springframework.transaction.annotation.Transactional;<br /><br /><span style="color: #0000FF; ">import</span> com.paul.springmvc.model.Member;<br /><br />@Repository<br />@Transactional<br /><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> MemberDaoImpl <span style="color: #0000FF; ">implements</span> MemberDao {<br />    @Autowired<br />    <span style="color: #0000FF; ">private</span> EntityManager em;<br /><br />    @Cacheable(value = "my-local-cache", key = "#id")<br />    <span style="color: #0000FF; ">public</span> Member findById(Long id) {<br />        System.out.println("<img src="http://m.tkk7.com/Images/dot.gif" alt="" /><img src="http://m.tkk7.com/Images/dot.gif" alt="" />MemberDaoImpl NO CACHE<img src="http://m.tkk7.com/Images/dot.gif" alt="" /><img src="http://m.tkk7.com/Images/dot.gif" alt="" />");<br />        <span style="color: #0000FF; ">return</span> em.find(Member.<span style="color: #0000FF; ">class</span>, id);<br />    }<br /><br />    <span style="color: #0000FF; ">public</span> Member findByEmail(String email) {<br />        CriteriaBuilder cb = em.getCriteriaBuilder();<br />        CriteriaQuery<Member> criteria = cb.createQuery(Member.<span style="color: #0000FF; ">class</span>);<br />        Root<Member> member = criteria.from(Member.<span style="color: #0000FF; ">class</span>);<br /><br />        <span style="color: #008000; ">/*</span><span style="color: #008000; "><br />         * Swap criteria statements if you would like to try out type-safe criteria queries, a new<br />         * feature in JPA 2.0 criteria.select(member).orderBy(cb.asc(member.get(Member_.name)));<br />         </span><span style="color: #008000; ">*/</span><br /><br />        criteria.select(member).where(cb.equal(member.get("email"), email));<br />        <span style="color: #0000FF; ">return</span> em.createQuery(criteria).getSingleResult();<br />    }<br /><br />    <span style="color: #0000FF; ">public</span> List<Member> findAllOrderedByName() {<br />        CriteriaBuilder cb = em.getCriteriaBuilder();<br />        CriteriaQuery<Member> criteria = cb.createQuery(Member.<span style="color: #0000FF; ">class</span>);<br />        Root<Member> member = criteria.from(Member.<span style="color: #0000FF; ">class</span>);<br /><br />        <span style="color: #008000; ">/*</span><span style="color: #008000; "><br />         * Swap criteria statements if you would like to try out type-safe criteria queries, a new<br />         * feature in JPA 2.0 criteria.select(member).orderBy(cb.asc(member.get(Member_.name)));<br />         </span><span style="color: #008000; ">*/</span><br /><br />        criteria.select(member).orderBy(cb.asc(member.get("name")));<br />        <span style="color: #0000FF; ">return</span> em.createQuery(criteria).getResultList();<br />    }<br /><br />    @CacheEvict(value="my-local-cache",allEntries=<span style="color: #0000FF; ">true</span>,beforeInvocation=<span style="color: #0000FF; ">true</span>)<span style="color: #008000; ">//</span><span style="color: #008000; ">娓呯┖鎵鏈夌紦瀛?/span><span style="color: #008000; "><br /></span>    <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">void</span> register(Member member) {<br />        em.persist(member);<br />        <span style="color: #0000FF; ">return</span>;<br />    }<br />}</div></li> </ol><img src ="http://m.tkk7.com/paulwong/aggbug/423034.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/paulwong/" target="_blank">paulwong</a> 2015-02-25 16:34 <a href="http://m.tkk7.com/paulwong/archive/2015/02/25/423034.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>SPRING CACHE璧勬簮http://m.tkk7.com/paulwong/archive/2015/02/25/423032.htmlpaulwongpaulwongWed, 25 Feb 2015 08:04:00 GMThttp://m.tkk7.com/paulwong/archive/2015/02/25/423032.htmlhttp://m.tkk7.com/paulwong/comments/423032.htmlhttp://m.tkk7.com/paulwong/archive/2015/02/25/423032.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/423032.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/423032.html
http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/htmlsingle/#cache

SPRING CONCURRENTMAP MANAGER鍔犺繃鏈熺瓥鐣?br />http://stackoverflow.com/questions/8181768/can-i-set-a-ttl-for-cacheable

緇勫悎KEY
http://stackoverflow.com/questions/14072380/cacheable-key-on-multiple-method-arguments

Spring Cache鎶借薄璇﹁В
http://www.open-open.com/lib/view/open1389575623336.html

娉ㄩ噴椹卞姩鐨?Spring cache 緙撳瓨浠嬬粛
https://www.ibm.com/developerworks/cn/opensource/os-cn-spring-cache/

Spring Cache鎶借薄璇﹁В



paulwong 2015-02-25 16:04 鍙戣〃璇勮
]]>
浣跨敤WILDFLY涓殑鍒嗗竷寮忕紦瀛業NFISHPANhttp://m.tkk7.com/paulwong/archive/2015/02/23/422998.htmlpaulwongpaulwongMon, 23 Feb 2015 05:40:00 GMThttp://m.tkk7.com/paulwong/archive/2015/02/23/422998.htmlhttp://m.tkk7.com/paulwong/comments/422998.htmlhttp://m.tkk7.com/paulwong/archive/2015/02/23/422998.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/422998.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/422998.html
  • 閫氳繃http://127.0.0.1:9991/console/App.html#infinispan娣誨姞CACHE
    <cache-container name="tickets" default-cache="default" jndi-name="java:jboss/infinispan/tickets">
           <local-cache name="default" batching="true">
                  <locking isolation="REPEATABLE_READ"/>
           </local-cache>
    </cache-container>

  • pom.xml娣誨姞渚濊禆鍖?br />
            <dependency>
                <groupId>org.infinispan</groupId>
                <artifactId>infinispan-core</artifactId>
                <scope>provided</scope>
            </dependency>
            
            <dependency>
                <groupId>org.infinispan</groupId>
                <artifactId>infinispan-client-hotrod</artifactId>
                <scope>provided</scope>
            </dependency>

        <dependency>
            <groupId>org.jgroups</groupId>
            <artifactId>jgroups</artifactId>
            <scope>provided</scope>
        </dependency>

            <dependency>
                <groupId>org.infinispan</groupId>
                <artifactId>infinispan-spring</artifactId>
                <version>6.0.2.Final</version>
            </dependency>
            
            <dependency>
                <groupId>org.infinispan</groupId>
                <artifactId>infinispan-jcache</artifactId>
                <version>6.0.2.Final</version>
            </dependency>

  • 娣誨姞鎷︽埅鍣紝WEB-INF/beans.xml
    <?xml version="1.0"?>
    <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation
    ="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
        <interceptors>
            <class>org.infinispan.jcache.annotation.CacheResultInterceptor</class>
            <class>org.infinispan.jcache.annotation.CachePutInterceptor</class>
            <class>org.infinispan.jcache.annotation.CacheRemoveEntryInterceptor</class>
            <class>org.infinispan.jcache.annotation.CacheRemoveAllInterceptor</class>
        </interceptors>
    </beans>

  • 娣誨姞欏圭洰鐨勫叏灞渚濊禆錛學EB-INF/jboss-deployment-structure.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-deployment-structure>
        <deployment>
            <dependencies>
                <module name="org.jboss.xnio" />
                <module name="org.infinispan" export="true"/>
                <module name="org.infinispan.commons" export="true"/>
                <module name="org.infinispan.client.hotrod" export="true"/>
            </dependencies>
        </deployment>
    </jboss-deployment-structure>

  • 鍦–DI BEAN涓嬌鐢–ACHE
    package com.paul.myejb;

    import javax.annotation.Resource;
    import javax.cache.annotation.CacheResult;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.interceptor.Interceptors;

    import org.infinispan.Cache;
    import org.infinispan.manager.EmbeddedCacheManager;
    //import org.springframework.cache.annotation.Cacheable;
    import org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor;

    /**
     * Session Bean implementation class HelloWorldBean
     
    */
    @Stateless
    //@Local(HelloWorld.class)
    @Remote(HelloWorld.class)
    @Interceptors(SpringBeanAutowiringInterceptor.class)
    //@RolesAllowed({Roles.ADMIN})
    public class HelloWorldBean implements HelloWorld {
        
        @Resource(lookup = "java:jboss/infinispan/tickets")
        private EmbeddedCacheManager container;
        
        
        /**
         * Default constructor. 
         
    */
        public HelloWorldBean() {
        }

    //    @Transactional
    //    @Cacheable(value = "books", key = "#name")
        @CacheResult
        public String sayHello(String name) {
            System.out.println("NO CACHE");
            String result = "Hello " + name + ", I am HelloWorldBean.";
            Cache<String, String> cache = this.container.getCache();
            cache.put(name, result);
            return result;
        }

    }


  • 淇敼modules/system/layers/base/org/infinispan/client/hotrod/main/modules.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
      ~ JBoss, Home of Professional Open Source.
      ~ Copyright 2010, Red Hat, Inc., and individual contributors
      ~ as indicated by the @author tags. See the copyright.txt file in the
      ~ distribution for a full listing of individual contributors.
      ~
      ~ This is free software; you can redistribute it and/or modify it
      ~ under the terms of the GNU Lesser General Public License as
      ~ published by the Free Software Foundation; either version 2.1 of
      ~ the License, or (at your option) any later version.
      ~
      ~ This software is distributed in the hope that it will be useful,
      ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
      ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
      ~ Lesser General Public License for more details.
      ~
      ~ You should have received a copy of the GNU Lesser General Public
      ~ License along with this software; if not, write to the Free
      ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
      ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
      
    -->
    <module xmlns="urn:jboss:module:1.3" name="org.infinispan.client.hotrod">
        <properties>
            <property name="jboss.api" value="private"/>
        </properties>

        <resources>
            <resource-root path="infinispan-client-hotrod-6.0.2.Final.jar"/>
        </resources>

        <dependencies>
            <module name="javax.api"/>
            <!--涓嬮潰榪欎竴琛屾敞閲婃帀-->
            <!--<module name="com.google.protobuf"/>-->
            <module name="org.apache.commons.pool"/>
            <module name="org.infinispan.commons"/>
            <module name="org.infinispan.query.dsl"/>
            <module name="org.jboss.logging"/>
        </dependencies>
    </module>

  • 浠ヤ笅鏄疭PRING鐗堟湰
    1. 娣誨姞渚濊禆鐨凷PRING BEAN
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi
      ="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
          xmlns:cache
      ="http://www.springframework.org/schema/cache"
          xmlns:p
      ="http://www.springframework.org/schema/p"
          xmlns:jee
      ="http://www.springframework.org/schema/jee"
          xsi:schemaLocation
      ="http://www.springframework.org/schema/context
                http://www.springframework.org/schema/context/spring-context-3.0.xsd
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/cache
                http://www.springframework.org/schema/cache/spring-cache.xsd
                http://www.springframework.org/schema/jee 
                http://www.springframework.org/schema/jee/spring-jee.xsd"
      >

          <cache:annotation-driven />
          
          <bean id="cacheManager"
                class
      ="org.infinispan.spring.provider.ContainerCacheManagerFactoryBean">
                <constructor-arg ref="cacheContainer"  />
          </bean>
          
          <jee:jndi-lookup id="cacheContainer" jndi-name="java:jboss/infinispan/tickets" > 
          </jee:jndi-lookup>
          
          <!-- <bean id="cacheContainer"
                class="com.paul.myejb.common.util.cache.JndiSpringCacheManagerFactoryBean"
                p:infinispanJNDI="java:jboss/infinispan/tickets" /> 
      -->
          
      </beans>

    2. 浣跨敤CACHE
      package com.paul.myejb.spring;

      import org.springframework.beans.factory.annotation.Autowired;
      import org.springframework.cache.CacheManager;
      import org.springframework.cache.annotation.Cacheable;
      import org.springframework.stereotype.Component;

      @Component
      public class MySpringBean {
          
          @Autowired
          private CacheManager cacheManager;
          
          @Cacheable(value = "my-local-cache", key = "#name")
          public String sayHello(String name)
          {
              System.out.println("MySpringBean NO CACHE");
              String result = "Hi " + name + ", I am Spring!";
              org.springframework.cache.Cache springCache = this.cacheManager.getCache("my-local-cache");
              System.out.println(springCache.get(name) == null ? "null" : springCache.get(name).get());
              springCache.put(name, result);
              return result;
          }

      }




    paulwong 2015-02-23 13:40 鍙戣〃璇勮
    ]]>
    Infinispan璧勬簮http://m.tkk7.com/paulwong/archive/2015/02/22/422993.htmlpaulwongpaulwongSun, 22 Feb 2015 06:03:00 GMThttp://m.tkk7.com/paulwong/archive/2015/02/22/422993.htmlhttp://m.tkk7.com/paulwong/comments/422993.htmlhttp://m.tkk7.com/paulwong/archive/2015/02/22/422993.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/422993.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/422993.html 浣跨敤鏃舵渶濂戒笌SPRING緇撳悎錛岀敤鍦―AO灞傘?br /> 浠ユ煇鏂規硶鍙傛暟浣滀負KEY錛岃繑鍥炵殑瀵硅薄浣滀負VALUE淇濆瓨鍒扮紦瀛樹腑銆?br /> ADD/EDIT/REMOVE鏂規硶琚墽琛屾椂鍒欐竻闄ゆ墍鏈夌殑緙撳瓨銆?br />
    Infinispan鐨勮繍琛屾ā寮忔湁涓ょ錛?br /> 1銆佸祵鍏ュ紡
    鍏堝惎鍔ㄤ竴涓繘紼嬶紝鍐嶅湪姝よ繘紼嬩腑鍚姩Infinispan鐨凜ACHE MANAGER銆?br /> 2銆丆LIENT/SERVER
    鐩存帴榪愯startserver.sh鏉ュ惎鍔ㄣ?br />
    涓よ呭尯鍒?br /> 宓屽叆寮忥細
    1銆両nfinispan鍜屽惎鍔ㄨ繘紼嬫槸鍦ㄥ悓涓涓繘紼嬮噷錛屽JBOSS涓殑Infinispan
    2銆佽浣跨敤Infinispan鐨凜ACHE錛屽繀欏誨皢搴旂敤閮ㄧ講鍒版榪涚▼涓紝濡傚皢WAR搴旂敤閮ㄧ講鍒癑BOSS涓?br /> 3銆佸鏈夊鍙版満浠ユ妯″紡榪愯錛屽垯浜掔浉鍙互閫氳

    CLIENT/SERVER錛?br /> 1銆両nfinispan鍗曠嫭涓涓繘紼?br /> 2銆侀氳繃SDK錛屼互MEMCHAED錛孯HQ絳夊崗璁闂瓹ACHE
    3銆佸鏈夊鍙版満浠ユ妯″紡榪愯錛屼簰鐩鎬笉鍙互閫氳

    JBOSS涓殑INFINISPAN鑲畾鏄祵鍏ュ紡錛岃璁塊棶INFINISPAN鐨凜ACHE蹇呴』閮ㄧ講鍒癑BOSS鎵嶈兘璁塊棶錛屾病鏈夎繙紼嬫ā寮忋?/span>

    Infinispan涓殑CACHE鏈変袱縐嶆ā寮忥細鏈湴緙撳瓨鍜岄泦緹ょ紦瀛樸?br />
    鏈湴緙撳瓨鏄崟鏈虹増銆?br /> 闆嗙兢緙撳瓨鏄鏈虹綉緇滅増錛屽張鍒嗕負涓夌錛?br /> 1銆佸垎甯冨紡錛氱綉緇滀腑鐨勬瘡涓妭鐐瑰彧淇濆瓨閮ㄤ喚緙撳瓨鏉$洰錛屾墍鏈夌殑鑺傜偣鍚堣搗鏉ヤ繚瀛樺叏閮ㄧ紦瀛樻潯鐩?br /> 褰撴湰鏈烘棤姝ゆ潯鐩椂錛岃閫氳繃緗戠粶鍘誨埌鍒殑鏈哄櫒涓婂彇
    2銆佸鍒跺紡錛氱綉緇滀腑鐨勬瘡涓妭鐐歸兘淇濆瓨鍏ㄩ儴緙撳瓨鏉$洰錛屼絾緙撳瓨鏉$洰鏈夋洿鏂版椂錛屾墍鏈夎妭鐐逛竴騫舵洿鏂?br /> 褰撴湰鏈烘棤姝ゆ潯鐩椂錛屼笉鐢ㄥ埌鍒殑鑺傜偣鍙栵紝浣嗙紦瀛樻潯鐩湁鏇存柊鏃訛紝鎵鏈夎妭鐐歸兘浼氭墽琛屾洿鏂版湰鍦扮紦瀛樻搷浣?br /> 3銆佹棤鏁堝紡錛氱綉緇滀腑鐨勬瘡涓妭鐐逛簰涓嶉氳錛屼絾緙撳瓨鏉$洰鏈夋洿鏂版椂錛岃妭鐐規敹鍒板け鏁堥氱煡錛屽悇鑷鐞嗘湰鏈虹殑緙撳瓨鏉$洰

    緙栫▼浣跨敤鏂規硶
    1銆侀氳繃紼嬪簭浣跨敤錛屽嵆鍦ㄤ唬鐮佷腑鍐檆ache鐨勫瓨鍙栥?br /> 2銆侀氳繃娉ㄩ噴浣跨敤錛岃繖鍚勬敞閲婃槸閫氳繃鎴潰鎷︽埅鏂規硶鏂瑰紡瀹炵幇錛屽嵆濡傛灉鍦ㄧ紦瀛樹腑鏈夋緙撳瓨鏉$洰錛屽垯鏂規硶涓嶄細琚墽琛岋紝鐩存帴榪斿洖緇撴灉銆?br /> 鍙堢粏鍒嗕袱縐嶏細
    閫氳繃SPRING瀹炵幇錛岄氳繃JAVA EE鐨凜DI瀹炵幇銆?br />
    JBoss 緋誨垪涓夊崄涓錛欽Boss Data Grid錛圛nfinispan錛夌紦瀛樻ā寮?/a>

    JBoss 緋誨垪涓夊崄浜岋細JBoss Data Grid錛圛nfinispan錛夌紦瀛樻ā寮忕ず渚?/a>


    infinispan-quickstart


    https://docs.jboss.org/infinispan/5.0/apidocs/org/infinispan/spring/provider/package-summary.html


    Infinispan integrate with spring based application
    http://timtang.me/blog/2012/11/04/infinispan-spring-based-application-integration/


    Java緙撳瓨鏂版爣鍑嗭紙javax.cache錛?br /> http://www.importnew.com/11723.html

    https://developer.jboss.org/en/infinispan/cn/content?filterID=contentstatus[published]~objecttype~objecttype[document]

    paulwong 2015-02-22 14:03 鍙戣〃璇勮
    ]]>
    鍑犲ぇNOSQL鏁版嵁搴撴ц兘姣旇緝http://m.tkk7.com/paulwong/archive/2015/01/30/422565.htmlpaulwongpaulwongThu, 29 Jan 2015 16:16:00 GMThttp://m.tkk7.com/paulwong/archive/2015/01/30/422565.htmlhttp://m.tkk7.com/paulwong/comments/422565.htmlhttp://m.tkk7.com/paulwong/archive/2015/01/30/422565.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/422565.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/422565.htmlhttp://planetcassandra.org/nosql-performance-benchmarks

    NoSQL Benchmarking
    http://www.cubrid.org/blog/dev-platform/nosql-benchmarking/


    http://www.badrit.com/blog/2013/11/18/redis-vs-mongodb-performance#.VMpfW2SUfsg

    How many requests per second can I get out of Redis?
    http://skipperkongen.dk/2013/08/27/how-many-requests-per-second-can-i-get-out-of-redis/

    redis鎬ц兘嫻嬭瘯錛屾祴璇曞茍鍙戞ц兘
    http://my.oschina.net/pblack/blog/102394

    paulwong 2015-01-30 00:16 鍙戣〃璇勮
    ]]>
    鑵捐CKV嫻烽噺鍒嗗竷寮忓瓨鍌ㄧ郴緇?/title><link>http://m.tkk7.com/paulwong/archive/2014/07/16/415866.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Tue, 15 Jul 2014 23:58:00 GMT</pubDate><guid>http://m.tkk7.com/paulwong/archive/2014/07/16/415866.html</guid><wfw:comment>http://m.tkk7.com/paulwong/comments/415866.html</wfw:comment><comments>http://m.tkk7.com/paulwong/archive/2014/07/16/415866.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/paulwong/comments/commentRss/415866.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/paulwong/services/trackbacks/415866.html</trackback:ping><description><![CDATA[<img src="http://ww4.sinaimg.cn/bmiddle/a1ab8e59jw1eeeg66h72fj20c83ek7ra.jpg" width="440" height="4412" alt="" /><img src ="http://m.tkk7.com/paulwong/aggbug/415866.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/paulwong/" target="_blank">paulwong</a> 2014-07-16 07:58 <a href="http://m.tkk7.com/paulwong/archive/2014/07/16/415866.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓浜涙暟鎹垏鍒嗐佺紦瀛樸乺pc妗嗘灦銆乶osql鏂規璧勬枡http://m.tkk7.com/paulwong/archive/2013/10/14/404954.htmlpaulwongpaulwongMon, 14 Oct 2013 02:14:00 GMThttp://m.tkk7.com/paulwong/archive/2013/10/14/404954.htmlhttp://m.tkk7.com/paulwong/comments/404954.htmlhttp://m.tkk7.com/paulwong/archive/2013/10/14/404954.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/404954.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/404954.html1銆佹暟鎹垏鍒?/span>

            1.1銆?a style="color: #108ac6;" target="_blank">mysql涓棿浠剁爺絀訛紙Atlas錛宑obar錛孴DDL錛?/a> 

            1.2銆?a style="color: #108ac6;" target="_blank">鍒╃敤 MySQL Proxy 瀹炵幇鏁版嵁鍒囧垎鍙婃暣鍚?nbsp;

            1.3銆?a style="color: #108ac6;" target="_blank">鍩轟簬MySQL鍒嗗簱鍒嗚〃鏂規綆浠?nbsp;

            1.4銆?a style="color: #108ac6;" target="_blank">tddl鍜宒iamond  

    2銆佺紦瀛?/p>

            2.1銆?a style="color: #108ac6;" target="_blank">java瀹㈡埛绔笁縐嶆柟寮忔搷浣?nbsp;

            2.2銆?a style="color: #108ac6;" target="_blank">myibatis閰嶇疆memcached璇勬祴 

            2.3銆?a style="color: #108ac6;" target="_blank">Memcached + Spring Caching 

            2.4銆?a style="color: #108ac6;" target="_blank">memcachedb-鎸佷箙鍖栧瓨鍌ㄧ殑緙撳瓨緋葷粺 

            2.5銆?a style="color: #108ac6;" target="_blank">memcachedb璁﹎emcache鐨勬暟鎹寔涔呭寲 

            2.6銆?a style="color: #108ac6;" target="_blank">娣樺疂kv緙撳瓨妗嗘灦tair 

            2.7銆?a style="color: #108ac6;" target="_blank">ibatis涔嬫墿灞曠紦瀛榠batis-tair-cache 

    3銆乺pc妗嗘灦

            3.1銆?a style="color: #108ac6;">dubbo 

            3.2銆乭sf 鏈紑婧?/p>

            3.3銆?a style="color: #108ac6;" target="_blank">鏈嶅姟妗嗘灦HSF鍒嗘瀽涔嬩竴瀹瑰櫒鍚姩

    4銆乶oSql

            4.1銆?a style="color: #108ac6;" target="_blank">瀛︿範NoSQL鏁版嵁搴撶殑蹇呰璧勬枡 



    paulwong 2013-10-14 10:14 鍙戣〃璇勮
    ]]>
    綆鍗曠殑寮婧愬垎甯冨紡緙撳瓨妗嗘灦鏋?/title><link>http://m.tkk7.com/paulwong/archive/2012/05/02/377145.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 02 May 2012 02:24:00 GMT</pubDate><guid>http://m.tkk7.com/paulwong/archive/2012/05/02/377145.html</guid><wfw:comment>http://m.tkk7.com/paulwong/comments/377145.html</wfw:comment><comments>http://m.tkk7.com/paulwong/archive/2012/05/02/377145.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/paulwong/comments/commentRss/377145.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/paulwong/services/trackbacks/377145.html</trackback:ping><description><![CDATA[<div><a target="_blank" >http://code.google.com/p/xcache-j/</a></div><img src ="http://m.tkk7.com/paulwong/aggbug/377145.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/paulwong/" target="_blank">paulwong</a> 2012-05-02 10:24 <a href="http://m.tkk7.com/paulwong/archive/2012/05/02/377145.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀹炴垬Memcached緙撳瓨緋葷粺http://m.tkk7.com/paulwong/archive/2012/04/29/377039.htmlpaulwongpaulwongSun, 29 Apr 2012 13:42:00 GMThttp://m.tkk7.com/paulwong/archive/2012/04/29/377039.htmlhttp://m.tkk7.com/paulwong/comments/377039.htmlhttp://m.tkk7.com/paulwong/archive/2012/04/29/377039.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/377039.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/377039.html
  • 瀹炴垬Memcached緙撳瓨緋葷粺錛?錛塎emcached鍩虹鍙婄ず渚嬬▼搴?/font>
  • 瀹炴垬Memcached緙撳瓨緋葷粺錛?錛塎emcached Java API鍩虹涔婱emcachedClient
    鍐呭錛氫互Memcached鐨凧ava Spy API涓轟緥錛岃榪板熀鏈殑瀹㈡埛绔嬌鐢ㄣ?
  • 瀹炴垬Memcached緙撳瓨緋葷粺錛?錛塎emcached閰嶇疆鍙傛暟鍒濊В
    鍐呭錛氭彁渚汳emcached閰嶇疆鐨勫垵姝ヨВ璇匯?
  • 瀹炴垬Memcached緙撳瓨緋葷粺錛?錛塎emcached鐨凜AS鍗忚
    鍐呭錛歁emcached鐨凜AS鍗忚銆?
  • 瀹炴垬Memcached緙撳瓨緋葷粺錛?錛塎emcached鐨凜AS紼嬪簭瀹炰緥
    鍐呭錛歁emcached Client浣跨敤CAS鍗忚鐨勫疄渚嬨?
  • 瀹炴垬Memcached緙撳瓨緋葷粺錛?錛塎emcached CAS鐨勫綰跨▼紼嬪簭瀹炰緥
    鍐呭錛歁emcached Client浣跨敤CAS鍗忚鐨勫綰跨▼瀹炰緥銆?
  • 瀹炴垬Memcached緙撳瓨緋葷粺錛?錛塎emcached鐨勪竴浜涘熀紜FAQ
    鍐呭錛氫竴浜涘叧浜嶮emcached鐨勫父瑙侀棶棰樺拰鍩虹鐭ヨ瘑姹囨伙紝涓嶆柇鏇存柊涓?
  • 瀹炴垬Memcached緙撳瓨緋葷粺錛?錛塎emcached寮傛瀹炴椂璇誨啓闂鐨勮В鍐蟲柟妗圫AC


  • paulwong 2012-04-29 21:42 鍙戣〃璇勮
    ]]>
    Spring鍩轟簬娉ㄨВ鐨勭紦瀛橀厤緗?-web搴旂敤瀹炰緥http://m.tkk7.com/paulwong/archive/2012/02/16/370119.htmlpaulwongpaulwongThu, 16 Feb 2012 09:04:00 GMThttp://m.tkk7.com/paulwong/archive/2012/02/16/370119.htmlhttp://m.tkk7.com/paulwong/comments/370119.htmlhttp://m.tkk7.com/paulwong/archive/2012/02/16/370119.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/370119.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/370119.html
    http://hanqunfeng.iteye.com/blog/605123

    緇忛獙璇侊紝濡傛灉瑕佹敮鎸佸垎甯冨紡鐨勭紦瀛橈紝鐢╯pring-modules-cache涓嶅ソ浣匡紝蹇呴』杞敤com.googlecode.ehcache-spring-annotations銆?br />
    鍏ㄥMAVEN鐨凱OM:
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation
    ="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        
    <modelVersion>4.0.0</modelVersion>
        
    <groupId>EhCache-Cluster-Tester</groupId>
        
    <artifactId>EhCache-Cluster-Tester</artifactId>
        
    <version>0.0.1-SNAPSHOT</version>
        
    <packaging>war</packaging>
        
    <dependencies>
            
    <dependency>
                
    <groupId>net.sf.ehcache</groupId>
                
    <artifactId>ehcache-jgroupsreplication</artifactId>
                
    <version>1.4</version>
            
    </dependency>
            
    <!-- Spring framework -->
            
    <dependency>
                
    <groupId>org.springframework</groupId>
                
    <artifactId>spring</artifactId>
                
    <version>${spring.version}</version>
            
    </dependency>

            
    <!-- Spring MVC framework -->
            
    <dependency>
                
    <groupId>org.springframework</groupId>
                
    <artifactId>spring-webmvc</artifactId>
                
    <version>${spring.version}</version>
            
    </dependency>
            
    <dependency>
                
    <groupId>javax.servlet</groupId>
                
    <artifactId>servlet-api</artifactId>
                
    <version>2.4</version>
                
    <scope>provided</scope>
            
    </dependency>
            
    <dependency>
                
    <groupId>org.slf4j</groupId>
                
    <artifactId>slf4j-jdk14</artifactId>
                
    <version>1.5.6</version>
                
    <type>jar</type>
                
    <scope>compile</scope>
            
    </dependency>
            
    <dependency>
                
    <groupId>log4j</groupId>
                
    <artifactId>log4j</artifactId>
                
    <version>1.2.13</version>
                
    <type>jar</type>
                
    <scope>compile</scope>
            
    </dependency>
            
    <dependency>
                
    <groupId>cglib</groupId>
                
    <artifactId>cglib-nodep</artifactId>
                
    <version>2.2.2</version>
                
    <type>jar</type>
                
    <scope>compile</scope>
            
    </dependency>
            
    <!-- 
            <dependency>
                <groupId>org.springmodules</groupId>
                <artifactId>spring-modules-cache</artifactId>
                <version>0.9</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            
    -->
            
    <dependency>
                
    <groupId>com.googlecode.ehcache-spring-annotations</groupId>
                
    <artifactId>ehcache-spring-annotations</artifactId>
                
    <version>1.2.0</version>
                
    <type>jar</type>
                
    <scope>compile</scope>
                
    <exclusions>
                    
    <exclusion>
                        
    <artifactId>spring-aop</artifactId>
                        
    <groupId>org.springframework</groupId>
                    
    </exclusion>
                    
    <exclusion>
                        
    <artifactId>spring-expression</artifactId>
                        
    <groupId>org.springframework</groupId>
                    
    </exclusion>
                
    </exclusions>
            
    </dependency>
        
    </dependencies>
        
    <build>
            
    <finalName>cluster-test</finalName>
            
    <plugins>
                
    <plugin>
                    
    <groupId>org.apache.maven.plugins</groupId>
                    
    <artifactId>maven-compiler-plugin</artifactId>
                    
    <configuration>
                        
    <source>1.6</source>
                        
    <target>1.6</target>
                        
    <encoding>UTF-8</encoding>
                    
    </configuration>
                
    </plugin>
                
    <plugin>
                    
    <groupId>org.mortbay.jetty</groupId>
                    
    <artifactId>jetty-maven-plugin</artifactId>
                    
    <version>8.0.4.v20111024</version>
                    
    <!-- 
                    <artifactId>maven-jetty-plugin</artifactId>
                    <version>6.1.26</version>
                    
    -->
                    
    <configuration>
                        
    <contextPath>/cluster-test</contextPath>
                        
    <scanIntervalSeconds>3</scanIntervalSeconds>
                        
    <scanTargetPatterns>
                            
    <scanTargetPattern>
                                
    <directory>src/main/webapp/WEB-INF</directory>
                                
    <excludes>
                                    
    <exclude>**/*.jsp</exclude>
                                
    </excludes>
                                
    <includes>
                                    
    <include>**/*.properties</include>
                                    
    <include>**/*.xml</include>
                                
    </includes>
                            
    </scanTargetPattern>
                        
    </scanTargetPatterns>
                    
    </configuration>
                
    </plugin>
            
    </plugins>
        
    </build>
        
    <properties>
            
    <spring.version>2.5.2</spring.version>
        
    </properties>
    </project>


    paulwong 2012-02-16 17:04 鍙戣〃璇勮
    ]]>
    Ehcache鍒嗗竷寮忕紦瀛?/title><link>http://m.tkk7.com/paulwong/archive/2012/02/14/369948.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Tue, 14 Feb 2012 07:46:00 GMT</pubDate><guid>http://m.tkk7.com/paulwong/archive/2012/02/14/369948.html</guid><wfw:comment>http://m.tkk7.com/paulwong/comments/369948.html</wfw:comment><comments>http://m.tkk7.com/paulwong/archive/2012/02/14/369948.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.tkk7.com/paulwong/comments/commentRss/369948.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/paulwong/services/trackbacks/369948.html</trackback:ping><description><![CDATA[浠?.2鐗堟湰寮濮嬶紝Ehcache鍙互浣跨敤鍒嗗竷寮忕殑緙撳瓨浜嗐?br /> <br /> 鍒嗗竷寮忚繖涓壒鎬ф槸浠lugin鐨勬柟寮忓疄鐜扮殑銆侲hcache鑷甫浜嗕竴浜涢粯璁ょ殑鍒嗗竷寮忕紦瀛樻彃浠跺疄鐜幫紝榪欎簺鎻掍歡鍙互婊¤凍澶ч儴鍒嗗簲鐢ㄧ殑闇瑕併傚鏋滈渶瑕佷嬌鐢ㄥ叾浠栫殑鎻掍歡閭e氨闇瑕佽嚜宸卞紑鍙戜簡錛屽紑鍙戣呭彲浠ラ氳繃鏌ョ湅distribution鍖呴噷鐨勬簮浠g爜鍙奐avaDoc鏉ュ疄鐜板畠銆?br /> <br /> 灝界涓嶆槸蹇呴』鐨勶紝鍦ㄤ嬌鐢ㄥ垎甯冨紡緙撳瓨鏃剁悊瑙d竴浜沞hcahce鐨勮璁℃濇兂涔熸槸鏈夊府鍔╃殑銆傝繖鍙互鍙傜湅鍒嗗竷寮忕紦瀛樿璁$殑欏甸潰銆?br /> 浠ヤ笅鐨勯儴鍒嗗皢灞曠ず濡備綍璁╁垎甯冨紡鎻掍歡鍚宔hcache涓璧峰伐浣溿?br /> <br /> 涓嬮潰鍒楀嚭鐨勬槸涓浜涘垎甯冨紡緙撳瓨涓瘮杈冮噸瑕佺殑鏂歸潰錛?br /> <br /> 浣犲浣曠煡閬撻泦緹ょ幆澧冧腑鐨勫叾浠栫紦瀛橈紵鍒嗗竷寮忎紶閫佺殑娑堟伅鏄粈涔堝艦寮忥紵浠涔堟儏鍐甸渶瑕佽繘琛屽鍒訛紵澧炲姞錛圥uts錛夛紝鏇存柊錛圲pdates錛夋垨鏄け鏁堬紙Expiries錛夛紵閲囩敤浠涔堟柟寮忚繘琛屽鍒訛紵鍚屾榪樻槸寮傛鏂瑰紡錛?br /> <br /> 涓轟簡瀹夎鍒嗗竷寮忕紦瀛橈紝浣犻渶瑕侀厤緗竴涓狿eerProvider銆佷竴涓狢acheManagerPeerListener錛屽畠浠浜庝竴涓狢acheManager鏉ヨ鏄叏灞鐨勩傛瘡涓繘琛屽垎甯冨紡鎿嶄綔鐨刢ache閮借娣誨姞涓涓猚acheEventListener鏉ヤ紶閫佹秷鎭?br /> <br /> <strong>姝g‘鐨勫厓绱犵被鍨?/strong><br /> <br /> 鍙湁鍙簭鍒楀寲鐨勫厓绱犲彲浠ヨ繘琛屽鍒躲?br /> <br /> 涓浜涙搷浣滐紝姣斿縐婚櫎錛屽彧闇瑕佸厓绱犵殑閿艱屼笉鐢ㄦ暣涓厓绱狅紱鍦ㄨ繖鏍風殑鎿嶄綔涓嵆浣垮厓绱犱笉鏄彲搴忓垪鍖栫殑浣嗛敭鍊兼槸鍙簭鍒楀寲鐨勪篃鍙互琚鍒訛紝<br /> <br /> <strong>鎴愬憳鍙戠幇錛圥eer Discovery錛?/strong><br /> <br /> Ehcache榪涜闆嗙兢鐨勬椂鍊欐湁涓涓猚ache緇勭殑姒傚康銆傛瘡涓猚ache閮芥槸鍏朵粬cache鐨勪竴涓猵eer錛屾病鏈変富cache鐨勫瓨鍦ㄣ傚垰鎵嶆垜浠棶浜嗕竴涓棶棰橈細浣犲浣曠煡閬撻泦緹ょ幆澧冧腑鐨勫叾浠栫紦瀛橈紵榪欎釜闂鍙互鍛藉悕涓烘垚鍛樺彂鐜幫紙Peer Discovery錛夈?br /> <br /> Ehcache鎻愪緵浜嗕袱縐嶆満鍒剁敤鏉ヨ繘琛屾垚鍛樺彂鐜幫紝灝卞儚涓杈嗘苯杞︼細鎵嬪姩妗e拰鑷姩妗c?br /> <br /> 瑕佷嬌鐢ㄤ竴涓唴緗殑鎴愬憳鍙戠幇鏈哄埗瑕佸湪ehcache鐨勯厤緗枃浠朵腑鎸囧畾cacheManagerPeerProviderFactory鍏冪礌鐨刢lass灞炴т負net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory銆?br /> <br /> <strong>鑷姩鐨勬垚鍛樺彂鐜?/strong><br /> <br /> 鑷姩鐨勫彂鐜版柟寮忕敤TCP騫挎挱鏈哄埗鏉ョ‘瀹氬拰緇存寔涓涓箍鎾粍銆傚畠鍙渶瑕佷竴涓畝鍗曠殑閰嶇疆鍙互鑷姩鐨勫湪緇勪腑娣誨姞鍜岀Щ闄ゆ垚鍛樸傚湪闆嗙兢涓篃涓嶉渶瑕佷粈涔堜紭鍖栨湇鍔″櫒鐨勭煡璇嗭紝榪欐槸榛樿鎺ㄨ崘鐨勩?br /> <br /> 鎴愬憳姣忕鍚戠兢緇勫彂閫佷竴涓?#8220;蹇冭煩”銆傚鏋滀竴涓垚鍛?5縐掔閮芥病鏈夊彂鍑轟俊鍙峰畠灝嗚緹ょ粍縐婚櫎銆傚鏋滀竴涓柊鐨勬垚鍛樺彂閫佷簡涓涓?#8220;蹇冭煩”瀹冨皢琚坊鍔犺繘緹ょ粍銆?br /> <br /> 浠諱綍涓涓敤榪欎釜閰嶇疆瀹夎浜嗗鍒跺姛鑳界殑cache閮藉皢琚叾浠栫殑鎴愬憳鍙戠幇騫舵爣璇嗕負鍙敤鐘舵併?br /> <br /> 瑕佽緗嚜鍔ㄧ殑鎴愬憳鍙戠幇錛岄渶瑕佹寚瀹歟hcache閰嶇疆鏂囦歡涓璫acheManagerPeerProviderFactory鍏冪礌鐨刾roperties灞炴э紝灝卞儚涓嬮潰榪欐牱錛?br /><br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">peerDiscovery=automatic multicastGroupAddress=multicast address | multicast host name multicastGroupPort=port <br /># (timeToLive灞炴ц瑙佸父瑙侀棶棰橀儴鍒嗙殑鎻忚堪)<br />timeToLive=0-255</span></div><br /> 紺轟緥<br /> <br /> 鍋囪浣犲湪闆嗙兢涓湁涓ゅ彴鏈嶅姟鍣ㄣ備綘甯屾湜鍚屾sampleCache1鍜宻ampleCache2銆傛瘡鍙扮嫭绔嬬殑鏈嶅姟鍣ㄩ兘瑕佹湁榪欐牱鐨勯厤緗細<br /> 閰嶇疆server1鍜宻erver2<br /> <br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><</span><span style="color: #800000; ">cacheManagerPeerProviderFactory<br /></span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"</span><span style="color: #FF0000; "><br />properties</span><span style="color: #0000FF; ">="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,<br />multicastGroupPort=4446, timeToLive=32"</span><span style="color: #0000FF; ">/></span></div><br /> <strong>鎵嬪姩榪涜鎴愬憳鍙戠幇</strong><br /> <br /> 榪涜鎵嬪姩鎴愬憳閰嶇疆瑕佺煡閬撴瘡涓洃鍚櫒鐨処P鍦板潃鍜岀鍙c傛垚鍛樹笉鑳藉湪榪愯鏃跺姩鎬佸湴娣誨姞鍜岀Щ闄ゃ傚湪鎶鏈笂寰堥毦浣跨敤騫挎挱鐨勬儏鍐典笅灝卞彲浠ユ墜鍔ㄦ垚鍛樺彂鐜幫紝渚嬪鍦ㄩ泦緹ょ殑鏈嶅姟鍣ㄤ箣闂存湁涓涓笉鑳戒紶閫佸箍鎾姤鏂囩殑璺敱鍣ㄣ備綘涔熷彲浠ョ敤鎵嬪姩鎴愬憳鍙戠幇榪涜鍗曞悜鐨勬暟鎹鍒訛紝鍙server2鐭ラ亾server1鑰宻erver1涓嶇煡閬搒erver2銆?br /> <br /> 閰嶇疆鎵嬪姩鎴愬憳鍙戠幇錛岄渶瑕佹寚瀹歟hcache閰嶇疆鏂囦歡涓璫acheManagerPeerProviderFactory鐨刾roperties灞炴э紝鍍忎笅闈㈣繖鏍鳳細<br /> <br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">peerDiscovery</span><span style="color: #000000; ">=</span><span style="color: #000000; ">manual rmiUrls</span><span style="color: #000000; ">=</span><span style="color: #000000; ">//server:port/cacheName</span><span style="color: #000000; ">,</span><span style="color: #000000; "> <img src="http://m.tkk7.com/Images/dot.gif" alt="" /><br />rmiUrls閰嶇疆鐨勬槸鏈嶅姟鍣╟ache peers鐨勫垪琛ㄣ傛敞鎰忎笉瑕侀噸澶嶉厤緗?/span></div><br /> 紺轟緥<br /> <br /> 鍋囪浣犲湪闆嗙兢涓湁涓ゅ彴鏈嶅姟鍣ㄣ備綘瑕佸悓姝ampleCache1鍜宻ampleCache2銆備笅闈㈡槸姣忎釜鏈嶅姟鍣ㄩ渶瑕佺殑閰嶇疆錛?br /> 閰嶇疆server1<br /> <br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><</span><span style="color: #800000; ">cacheManagerPeerProviderFactory<br /></span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"</span><span style="color: #FF0000; "><br />properties</span><span style="color: #0000FF; ">="peerDiscovery=manual,<br />rmiUrls=//server2:40001/sampleCache11|//server2:40001/sampleCache12"</span><span style="color: #0000FF; ">/></span></div><br /> 閰嶇疆server2<br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><</span><span style="color: #800000; ">cacheManagerPeerProviderFactory<br /></span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"</span><span style="color: #FF0000; "><br />properties</span><span style="color: #0000FF; ">="peerDiscovery=manual,<br />rmiUrls=//server1:40001/sampleCache11|//server1:40001/sampleCache12"</span><span style="color: #0000FF; ">/></span></div><br /> <strong>閰嶇疆CacheManagerPeerListener</strong><br /> <br /> 姣忎釜CacheManagerPeerListener鐩戝惉鎴愬憳浠彂鍚戝綋鍓岰acheManager鐨勬秷鎭?br /> 閰嶇疆CacheManagerPeerListener闇瑕佹寚瀹氫竴涓狢acheManagerPeerListenerFactory錛屽畠浠ユ彃浠剁殑鏈哄埗瀹炵幇錛岀敤鏉ュ垱寤篊acheManagerPeerListener銆?br /> <br /> cacheManagerPeerListenerFactory鐨勫睘鎬ф湁錛?br /> class – 涓涓畬鏁寸殑宸ュ巶綾誨悕銆?br /> properties – 鍙榪欎釜宸ュ巶鏈夋剰涔夌殑灞炴э紝浣跨敤閫楀悆鍒嗛殧銆?br /> <br /> Ehcache鏈変竴涓唴緗殑鍩轟簬RMI鐨勫垎甯冪郴緇熴傚畠鐨勭洃鍚櫒鏄疪MICacheManagerPeerListener錛岃繖涓洃鍚櫒鍙互鐢≧MICacheManagerPeerListenerFactory鏉ラ厤緗?br /> <br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><</span><span style="color: #800000; ">cacheManagerPeerListenerFactory<br /></span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"</span><span style="color: #FF0000; "><br />properties</span><span style="color: #0000FF; ">="hostName=localhost, port=40001,<br />socketTimeoutMillis=2000"</span><span style="color: #0000FF; ">/></span></div><br />鏈夋晥鐨勫睘鎬ф槸錛?br /> hostname (鍙? – 榪愯鐩戝惉鍣ㄧ殑鏈嶅姟鍣ㄥ悕縐般傛爣鏄庝簡鍋氫負闆嗙兢緹ょ粍鐨勬垚鍛樼殑鍦板潃錛屽悓鏃朵篃鏄綘鎯寵鎺у埗鐨勪粠闆嗙兢涓帴鏀舵秷鎭殑鎺ュ彛銆?br /> <br /> 鍦–acheManager鍒濆鍖栫殑鏃跺欎細媯鏌ostname鏄惁鍙敤銆?br /> <br /> 濡傛灉hostName涓嶅彲鐢紝CacheManager灝嗘嫆緇濆惎鍔ㄥ茍鎶涘嚭涓涓繛鎺ヨ鎷掔粷鐨勫紓甯搞?br /> <br /> 濡傛灉鎸囧畾錛宧ostname灝嗕嬌鐢↖netAddress.getLocalHost().getHostAddress()鏉ュ緱鍒般?br /> <br /> 璀﹀憡錛氫笉瑕佸皢localhost閰嶇疆涓烘湰鍦板湴鍧127.0.0.1錛屽洜涓哄畠鍦ㄧ綉緇滀腑涓嶅彲瑙佸皢浼氬鑷翠笉鑳戒粠榪滅▼鏈嶅姟鍣ㄦ帴鏀朵俊鎭粠鑰屼笉鑳藉鍒躲傚湪鍚屼竴鍙版満鍣ㄤ笂鏈夊涓狢acheManager鐨勬椂鍊欙紝浣犲簲璇ュ彧鐢╨ocalhost鏉ラ厤緗?br /> <br /> port – 鐩戝惉鍣ㄧ洃鍚殑绔彛銆?br /> socketTimeoutMillis (鍙? – Socket瓚呮椂鐨勬椂闂淬傞粯璁ゆ槸2000ms銆?br /> <br /> <strong>閰嶇疆CacheReplicators</strong><br /> <br /> 姣忎釜瑕佽繘琛屽悓姝ョ殑cache閮介渶瑕佽緗竴涓敤鏉ュ悜CacheManagerr鐨勬垚鍛樺鍒舵秷鎭殑緙撳瓨浜嬩歡鐩戝惉鍣ㄣ傝繖涓伐浣滆閫氳繃涓烘瘡涓猚ache鐨勯厤緗鍔犱竴涓猚acheEventListenerFactory鍏冪礌鏉ュ畬鎴愩?br /> <br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; "><!--</span><span style="color: #008000; "> Sample cache named sampleCache2. </span><span style="color: #008000; ">--></span><span style="color: #000000; "><br /></span><span style="color: #0000FF; "><</span><span style="color: #800000; ">cache </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="sampleCache2"</span><span style="color: #FF0000; "><br />maxElementsInMemory</span><span style="color: #0000FF; ">="10"</span><span style="color: #FF0000; "><br />eternal</span><span style="color: #0000FF; ">="false"</span><span style="color: #FF0000; "><br />timeToIdleSeconds</span><span style="color: #0000FF; ">="100"</span><span style="color: #FF0000; "><br />timeToLiveSeconds</span><span style="color: #0000FF; ">="100"</span><span style="color: #FF0000; "><br />overflowToDisk</span><span style="color: #0000FF; ">="false"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /></span><span style="color: #0000FF; "><</span><span style="color: #800000; ">cacheEventListenerFactory </span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="net.sf.ehcache.distribution.RMICacheReplicatorFactory"</span><span style="color: #FF0000; "><br />properties</span><span style="color: #0000FF; ">="replicateAsynchronously=true,<br />replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true "</span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br /></span><span style="color: #0000FF; "></</span><span style="color: #800000; ">cache</span><span style="color: #0000FF; ">></span></div><br /> name錛氱紦瀛樺悕縐般傞氬父涓虹紦瀛樺璞$殑綾誨悕錛堥潪涓ユ牸鏍囧噯錛夈?br /> <br /> maxElementsInMemory錛氳緗熀浜庡唴瀛樼殑緙撳瓨鍙瓨鏀懼璞$殑鏈澶ф暟鐩?br /> <br /> maxElementsOnDisk錛氳緗熀浜庣‖鐩樼殑緙撳瓨鍙瓨鏀懼璞$殑鏈澶ф暟鐩?br /> <br /> eternal錛氬鏋滀負true錛岃〃紺哄璞℃案榪滀笉浼氳繃鏈燂紝姝ゆ椂浼氬拷鐣imeToIdleSeconds鍜宼imeToLiveSeconds灞炴э紝榛樿涓篺alse;<br /> <br /> timeToIdleSeconds錛?璁懼畾鍏佽瀵硅薄澶勪簬絀洪棽鐘舵佺殑鏈闀挎椂闂達紝浠ョ涓哄崟浣嶃傚綋瀵硅薄鑷粠鏈榪戜竴嬈¤璁塊棶鍚庯紝濡傛灉澶勪簬絀洪棽鐘舵佺殑鏃墮棿瓚呰繃浜唗imeToIdleSeconds灞炴у鹼紝榪欎釜瀵硅薄灝變細榪囨湡銆傚綋瀵硅薄榪囨湡錛孍HCache灝嗘妸瀹冧粠緙撳瓨涓竻絀恒傚彧鏈夊綋eternal灞炴т負false錛岃灞炴ф墠鏈夋晥銆傚鏋滆灞炴у間負0錛屽垯琛ㄧず瀵硅薄鍙互鏃犻檺鏈熷湴澶勪簬絀洪棽鐘舵併?br /> <br /> timeToLiveSeconds錛氳瀹氬璞″厑璁稿瓨鍦ㄤ簬緙撳瓨涓殑鏈闀挎椂闂達紝浠ョ涓哄崟浣嶃傚綋瀵硅薄鑷粠琚瓨鏀懼埌緙撳瓨涓悗錛屽鏋滃浜庣紦瀛樹腑鐨勬椂闂磋秴榪囦簡 timeToLiveSeconds灞炴у鹼紝榪欎釜瀵硅薄灝變細榪囨湡銆傚綋瀵硅薄榪囨湡錛孍HCache灝嗘妸瀹冧粠緙撳瓨涓竻闄ゃ傚彧鏈夊綋eternal灞炴т負false錛岃灞炴ф墠鏈夋晥銆傚鏋滆灞炴у間負0錛屽垯琛ㄧず瀵硅薄鍙互鏃犻檺鏈熷湴瀛樺湪浜庣紦瀛樹腑銆倀imeToLiveSeconds蹇呴』澶т簬timeToIdleSeconds灞炴э紝鎵嶆湁鎰忎箟銆?br /> <br /> overflowToDisk錛氬鏋滀負true,琛ㄧず褰撳熀浜庡唴瀛樼殑緙撳瓨涓殑瀵硅薄鏁扮洰杈懼埌浜唌axElementsInMemory鐣岄檺鍚庯紝浼氭妸鐩婂嚭鐨勫璞″啓鍒板熀浜庣‖鐩樼殑緙撳瓨涓?br /> <br /> class – 浣跨敤net.sf.ehcache.distribution.RMICacheReplicatorFactory<br /> <br /> 榪欎釜宸ュ巶鏀寔浠ヤ笅灞炴э細<br /> replicatePuts=true | false – 褰撲竴涓柊鍏冪礌澧炲姞鍒扮紦瀛樹腑鐨勬椂鍊欐槸鍚﹁澶嶅埗鍒板叾浠栫殑peers. 榛樿鏄痶rue銆?br /> replicateUpdates=true | false – 褰撲竴涓凡緇忓湪緙撳瓨涓瓨鍦ㄧ殑鍏冪礌琚鐩栨椂鏄惁瑕佽繘琛屽鍒躲傞粯璁ゆ槸true銆?br /> replicateRemovals= true | false – 褰撳厓绱犵Щ闄ょ殑鏃跺欐槸鍚﹁繘琛屽鍒躲傞粯璁ゆ槸true銆?br /> replicateAsynchronously=true | false – 澶嶅埗鏂瑰紡鏄紓姝ョ殑錛堟寚瀹氫負true鏃訛級榪樻槸鍚屾鐨勶紙鎸囧畾涓篺alse鏃訛級銆傞粯璁ゆ槸true銆?br /> replicateUpdatesViaCopy=true | false – 褰撲竴涓厓绱犺鎷瘋礉鍒板叾浠栫殑cache涓椂鏄惁榪涜澶嶅埗錛堟寚瀹氫負true鏃朵負澶嶅埗錛夛紝榛樿鏄痶rue銆?br /> <br /> 浣犲彲浠ヤ嬌鐢╡hcache鐨勯粯璁よ涓轟粠鑰屽噺灝戦厤緗殑宸ヤ綔閲忥紝榛樿鐨勮涓烘槸浠ュ紓姝ョ殑鏂瑰紡澶嶅埗姣忎歡浜嬶紱浣犲彲浠ュ儚涓嬮潰鐨勪緥瀛愪竴鏍峰噺灝慠MICacheReplicatorFactory鐨勫睘鎬ч厤緗細<br /> <br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; "><!--</span><span style="color: #008000; "> Sample cache named sampleCache4. All missing RMICacheReplicatorFactory properties default to true </span><span style="color: #008000; ">--></span><span style="color: #000000; "><br /></span><span style="color: #0000FF; "><</span><span style="color: #800000; ">cache </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="sampleCache4"</span><span style="color: #FF0000; "><br />maxElementsInMemory</span><span style="color: #0000FF; ">="10"</span><span style="color: #FF0000; "><br />eternal</span><span style="color: #0000FF; ">="true"</span><span style="color: #FF0000; "><br />overflowToDisk</span><span style="color: #0000FF; ">="false"</span><span style="color: #FF0000; "><br />memoryStoreEvictionPolicy</span><span style="color: #0000FF; ">="LFU"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /></span><span style="color: #0000FF; "><</span><span style="color: #800000; ">cacheEventListenerFactory </span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="net.sf.ehcache.distribution.RMICacheReplicatorFactory"</span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br /></span><span style="color: #0000FF; "></</span><span style="color: #800000; ">cache</span><span style="color: #0000FF; ">></span></div><br /><strong>甯歌鐨勯棶棰榃indows涓婄殑Tomcat</strong><br /> <br /> 鏈変竴涓猅omcat鎴栬呮槸JDK鐨刡ug錛屽湪tomcat鍚姩鏃跺鏋渢omcat鐨勫畨瑁呰礬寰勪腑鏈夌┖鏍肩殑璇濓紝鍦ㄥ惎鍔ㄦ椂RMI鐩戝惉鍣ㄤ細澶辮觸銆傚弬瑙乭ttp://archives.java.sun.com/cgi-bin/wa?A2=ind0205&L=rmi-users&P=797鍜宧ttp://www.ontotext.com/kim/doc/sys-doc/faq-howto-bugs/known-bugs.html銆?br /> <br /> 鐢變簬鍦╓indows涓婂畨瑁匱omcat榛樿鏄鍦?#8220;Program Files”鏂囦歡澶歸噷鐨勶紝鎵浠ヨ繖涓棶棰樼粡甯稿彂鐢熴?br /> <br /> <strong>騫挎挱闃繪柇</strong><br /> <br /> 鑷姩鐨刾eer discovery涓庡箍鎾伅鎭浉鍏熾傚箍鎾彲鑳借璺敱闃繪嫤錛屽儚Xen鍜孷MWare榪欑铏氭嫙鍖栫殑鎶鏈篃鍙互闃繪嫤騫挎挱銆傚鏋滆繖浜涢兘鎵撳紑浜嗭紝浣犲彲鑳借繕鍦ㄨ灝嗕綘鐨勭綉鍗$殑鐩稿叧閰嶇疆鎵撳紑銆?br /> <br /> 涓涓畝鍗曠殑鍔炴硶鍙互鍛婅瘔騫挎挱鏄惁鏈夋晥錛岄偅灝辨槸浣跨敤ehcache remote debugger鏉ョ湅“蹇冭煩”鏄惁鍙敤銆?br /> <br /> <strong>騫挎挱浼犳挱鐨勪笉澶熻繙鎴栨槸浼犲緱澶繙</strong><br /> <br /> 浣犲彲浠ラ氳繃璁劇疆badly misnamed time to live鏉ユ帶鍒跺箍鎾紶鎾殑璺濈銆傜敤騫挎挱IP鍗忚鏃訛紝timeToLive鐨勫兼寚鐨勬槸鏁版嵁鍖呭彲浠ヤ紶閫掔殑鍩熸垨鏄寖鍥淬傜害瀹氬涓嬶細<br /> <br /> 0鏄檺鍒跺湪鍚屼竴涓湇鍔″櫒<br />1鏄檺鍒跺湪鍚屼竴涓瓙緗?br />32鏄檺鍒跺湪鍚屼竴涓綉绔?br />64鏄檺鍒跺湪鍚屼竴涓猺egion<br />128鏄檺鍒跺湪鍚屼竴涓ぇ媧?br />255鏄笉闄愬埗<br /> <br /> 璇戣呮寜錛氫笂闈㈣繖浜涜祫鏂欑炕璇戠殑涓嶅鍑嗙‘錛岃璇昏呰嚜琛屽鎵懼師鏂囩悊瑙e惂銆?br /> <br /> 鍦↗ava瀹炵幇涓粯璁ゅ兼槸1錛屼篃灝辨槸鍦ㄥ悓涓涓瓙緗戜腑浼犳挱銆傛敼鍙榯imeToLive灞炴у彲浠ラ檺鍒舵垨鏄墿灞曚紶鎾殑鑼冨洿銆?br /> <br /> 鍘熸枃鍦板潃涓?http://ehcache.sourceforge.net/documentation/distributed_caching.html<img src ="http://m.tkk7.com/paulwong/aggbug/369948.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/paulwong/" target="_blank">paulwong</a> 2012-02-14 15:46 <a href="http://m.tkk7.com/paulwong/archive/2012/02/14/369948.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浼樺寲紼嬪簭涔嬪墠錛屽彲鐢↗amon鏉ョ洃嫻嬩綘鐨凷pring搴旂敤http://m.tkk7.com/paulwong/archive/2012/01/25/368882.htmlpaulwongpaulwongWed, 25 Jan 2012 08:32:00 GMThttp://m.tkk7.com/paulwong/archive/2012/01/25/368882.htmlhttp://m.tkk7.com/paulwong/comments/368882.htmlhttp://m.tkk7.com/paulwong/archive/2012/01/25/368882.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/368882.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/368882.html*浣滆咃細寮犺崳鍗?ahuaxuan)
    *2007-8-15
    *杞澆璇鋒敞鏄庡嚭澶勫強浣滆?
    */

    鍓嶄袱澶╁湪鐪婼pring鍐呯疆鐨勬嫤鎴櫒鐨勬椂鍊欙紝鍙戠幇浜嗕竴涓箣鍓嶆病鏈夋敞鎰忕殑綾伙細org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor錛屽ソ濂囧績淇冧嬌鎴戜笂緗戞煡浜嗕竴涓嬭繖涓猨amon銆傚ぇ姒傜湅浜嗕竴涓嬩箣鍚庡彂鐜拌繖涓帺鎰忚繕鐪熸尯濂界敤鐨勮屼笖鎸洪噸瑕佺殑錛岃屼笖鐜板湪鍥藉唴瀵瑰畠鐨勪粙緇嶄篃寰堝皯錛屾墍浠ュ啓浜嗕竴綃囨枃绔犲拰澶у鍒嗕韓銆?

    涓錛孞amon綆浠嬶細
    Jamon鐨勫叏鍚嶆槸錛欽ava Application Monitor銆傚畠鏄竴涓皬宸х殑錛屽厤璐圭殑錛岄珮鎬ц兘鐨勶紝綰跨▼瀹夊叏鐨勬ц兘鐩戞祴宸ュ叿銆傚畠鍙互鐢ㄦ潵嫻嬪畾緋葷粺鐨勬ц兘鐡墮錛屼篃鍙互鐢ㄦ潵鐩戣鐢ㄦ埛鍜屽簲鐢ㄧ▼搴忎箣闂寸殑浜や簰鎯呭喌銆?Jamon涓昏鏄敤鏉ユ嫻媕ee鐨勫簲鐢ㄧ▼搴忋傚畠鏈鏂扮殑鐗堟湰鏄?.1錛屽彲浠ョ敤鍦?.4浠ヤ笂鐨刯dk涓娿?

    浜岋紝灝唈amon瀵煎叆鍒頒綘鐨勫簲鐢ㄧ▼搴忎腑鍘?
    棣栧厛涓嬭澆jamon鐨勫紑鍙戝寘錛岃鎴戠殑闄勪歡錛屽悓鏃朵綘涔熷彲浠ュ幓Sourceforge涓婅嚜宸變笅杞姐係ourceforge鐨勪笅杞藉湴鍧涓篽ttp://jamonapi.sourceforge.net銆傝В鍘嬩箣鍚庡彲浠ュ緱鍒頒竴涓猨ar鍖呭拰涓涓獁ar鍖呫俲ar鍖呮槸鑷繁浼氱敤鍒扮殑錛岃寃ar鍖呮槸涓涓緥瀛愶紙涓嶈灝忕湅榪欎釜渚嬪瓙錛屽緟浼氫篃瑕佹妸瀹冨鍏ュ埌欏圭洰涓級銆傛妸war鍖呬箣闂翠涪鍒版湇鍔″櫒涓婏紝璁塊棶錛歭ocalhost:8080/jamon灝卞彲浠ョ湅鍒拌繖涓緥瀛愪簡錛岃繖涓緥瀛愭槸涓涓畝鍗曠殑鎬ц兘鐩戞帶緋葷粺銆?

    鎺ョ潃鎶婁緥瀛愪腑鐨勬墍鏈夌殑鍖呴兘瀵煎叆鍒伴」鐩腑錛屽茍鎶妛ar鍖呬腑鐨刯sp鍜宨mages榪樻湁css閮借冨埌欏圭洰涓紝姣斿鏂板緩涓涓洰褰曞彨monitor錛堝畠鍜學EB-INF鏄悓綰х洰褰曪級銆?

    涓夛紝姝g‘閰嶇疆鑷繁鐨勫簲鐢?
    鎴戜滑鍦ㄦц兘鐩戞祴鐨勬椂鍊欐渶鐩戞祴鐨勫氨鏄〉闈㈢殑璁塊棶鐜囧拰綾諱腑鏂規硶鐨勮闂巼銆傛墍浠ュ湪榪欎竴閮ㄥ垎涓昏璁茶В涓涓嬪浣曠洃嫻嬭嚜宸辯殑欏甸潰鍜岀被涓柟娉曠殑璁塊棶銆?

    1錛?媯嫻嬭嚜宸辯殑欏甸潰璁塊棶鐜?
    棣栧厛鎴戜滑闇瑕佸湪web.xml涓坊鍔犱竴涓猣ilter錛岃繖涓猣ilter灝辨槸鐢ㄦ潵鍒ゆ柇鍝簺欏甸潰闇瑕佽鐩戣鐨勶紝濡備笅鎵紺猴細
    <filter>
            
    <filter-name>JAMonFilter</filter-name>
            
    <filter-class>com.easywebwork.filter.EasyPageMonFilter</filter-class>
        
    </filter>
        
    <filter-mapping>
            
    <filter-name>JAMonFilter</filter-name>
            
    <url-pattern>/*</url-pattern>
        
    </filter-mapping>

    鎺ヤ笅鏉ユ垜浠湅鐪嬭繖涓猣ilter鐨勫啓娉曪細

    /**
    *
    @author 寮犺崳鍗庯紙ahuaxuan錛?br /> *
    *
    @since 2007-8-13
    */

    public class PageMonFilter extends JAMonFilter{

    private static final long serialVersionUID = 5746197114960908454L;

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
    Monitor allPages
    = MonitorFactory.start(new MonKeyImp("org.easywebwork.allPages",getURI(request),"ms."));
    //榪欓噷灝辨槸鎴戜滑瑕佺洃瑙嗙殑鎵鏈夌殑欏甸潰鐨勯厤緗?/span>
    Monitor monitor = MonitorFactory.start(getURI(request));
    //榪欓噷灝辨槸鎴戜滑瑕佺洃瑙嗙殑鏌愪釜欏甸潰鐨勯厤緗?/span>
    try {
    filterChain.doFilter(request, response);
    }
    finally {
    monitor.stop();
    allPages.stop();
    }

    }


    protected String getURI(ServletRequest request) {
    if (request instanceof HttpServletRequest) {
    return ((HttpServletRequest) request).getRequestURI();
    }
    else {
    return "Not an HttpServletRequest";
    }

    }


    private FilterConfig filterConfig = null;

    }
    }

    榪欎釜綾葷湅涓婂幓寰堢畝鍗曪紝鍏跺疄涔熸尯綆鍗曠殑錛屽氨鏄緱鍒皍ri錛岀劧鍚庢妸瀹冩敞鍐屽埌MonitorFactory綾諱腑銆傝繖鏍峰彧瑕佹垜浠幓璁塊棶鍒氭墠鍒涘緩鐨刴onitor鐩綍涓嬬殑jsp灝卞彲浠ョ湅鍒版ц兘鐩戞祴欏甸潰浜嗐?

    2錛?鎺ヤ笅鏉ユ垜浠湅鐪嬪湪浣跨敤spring鐨勬儏鍐典笅濡備綍鐩戞祴涓涓猙ean鐨勬柟娉曡皟鐢ㄣ?br />Spring涔熸彁渚涗簡瀵笿amon鐨勬敮鎸?spring鏀寔鐨勪笢瑗胯繕鐪熷鍟?錛屼篃灝辨槸鏂囩珷寮澶存彁鍑虹殑閭d釜鎷︽埅鍣紝涓轟簡緇欐垜浠殑bean鍔犱笂鎷︽埅鍣紝鎴戜滑鍦╯pring鐨刟pplicationcontext閰嶇疆鏂囦歡涓姞鍏ュ涓嬭鍙ワ細

    <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
    <property name="beanNames">
    <list>
    <value>userService</value>
    </list>
    </property>
    <property name="interceptorNames">
    <list>
    <value>jamonInterceptor</value>
    </list>
    </property>
    </bean>

    <bean id="jamonInterceptor" class="org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor">
    </bean>

    涓婇潰榪欎釜鏄吀鍨嬬殑spring鐨刟op鐨勯厤緗紝濡傛灉瀵箂pring鐨刟op閰嶇疆涓嶄簡瑙g殑鍙互鍘葷湅涓涓媠pring涓枃鏂囨。錛屽綋鐒跺鏋滀笉鎯充簡瑙g殑璇濆嵆浣跨洿鎺ユ妸榪欐閰嶇疆鎷峰埌鑷繁鐨勯」鐩腑涔熸槸鍙互鐩存帴浣跨敤鐨勩?

    榪樻湁涓涓楠ゅ氨鏄湪浣犵殑log4j.properties涓姞鍏ヨ繖鍙ヤ唬鐮侊細

    log4j.logger.org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor = TRACE


    濡傛灉娌℃湁榪欎竴琛岋紝閭d箞榪欎釜鎷︽埅鍣ㄦ槸涓嶄細鎶婃柟娉曡皟鐢ㄧ殑淇℃伅鍚慚onitorFactory娉ㄥ唽鐨勩?

    鍙渶瑕佽繖浜涙楠わ紝userservice涓殑鏂規硶鍦ㄨ皟鐢ㄧ殑鏃跺欏氨鍙互琚嫤鎴紝鐒跺悗灝嗗叾娉ㄥ唽鍒癕onitorFactory涓幓浜嗐?

    鎵鏈夌殑閰嶇疆瀹屾垚涔嬪悗鎴戜滑鏉ョ湅涓涓嬫晥鏋滃惂:
    http://www.iteye.com/topics/download/b2bac96e-6c18-4340-b7e0-f84c7bb6adca浠庤繖涓浘涓婃垜浠彲浠ョ湅鍒幫紝鎵鏈夐〉闈㈣璁塊棶鐨勬鏁幫紝UserService涓殑getAllUsers琚皟鐢ㄧ殑嬈℃暟錛屾渶鍙寵竟鐨勬槸璁塊棶鏃墮棿銆傝繖鍙槸鏁翠釜鍥劇殑涓閮ㄥ垎錛屽綋鐒惰繖涓〉闈腑涔熷寘鎷瘡涓涓〉闈㈣璁塊棶鐨勬鏁板拰絎竴嬈¤闂殑鏃墮棿絳夌瓑銆備笅杞介檮浠惰繍琛岋紝灝卞彲浠ョ湅鍒版墍鏈夌殑欏甸潰浜嗐?

    涓夛紝鎬葷粨
    鏍規嵁浠ヤ笂鐨勬楠わ紝鎴戜滑灝卞彲浠ョ洃嫻嬫垜浠殑紼嬪簭浜嗭紝搴旂敤紼嬪簭涓摢浜涢〉闈㈣璁塊棶鐨勫錛屽摢浜涢〉闈㈣璁塊棶鐨勫皯錛屽摢浜涙柟娉曡璁塊棶鐨勫錛屽摢浜涙柟娉曡璁塊棶鐨勫皯錛屼互鍙婅闂珮宄版湡闆嗕腑鍦ㄤ粈涔堟椂闂寸瓑絳夛紝鏈変簡榪欎簺鍙傛暟錛屾垜浠洿鍙互鏈夐拡瀵規х殑瀵瑰簲鐢ㄧ▼搴忚繘琛屼紭鍖栦簡錛屾瘮濡傝鏌愪釜欏甸潰璁塊棶姣旇緝棰戠箒錛屾垜灝卞彲浠ョ敤ehcache鎴杘scache緇欒繖涓〉闈㈠仛涓涓紦瀛樸傚鏋滄煇涓柟娉曠殑璁塊棶姣旇緝棰戠箒閭e氨鐪嬬湅榪欎釜鏂規硶鑳藉惁榪涗竴姝ヤ紭鍖栵紝鏄渶瑕佸紓姝ワ紝榪樻槸闇瑕佺紦瀛橈紝榪樻槸闇瑕佸叾浠栫瓑絳夛紝鎬諱箣鏈変簡jamon鍙互緇欐垜浠甫鏉ユ洿澶氱殑渚挎嵎錛屾棦鍙互璁╂垜浠煡閬撴垜浠殑瀹㈡埛鐨勮涓猴紝涔熷彲浠ヨ鎴戜滑鐭ラ亾鎴戜滑寮鍙戠殑紼嬪簭鐨?#8220;鑳藉姏”銆?

    鍏跺疄鏈枃鎻愪緵鐨勫彧鏄欏甸潰鍜屾柟娉曡皟鐢ㄧ殑鐩戞帶錛屼絾鏄痡amon鍙互鎻愪緵鏇村鍔熻兘錛屾瘮濡傝sql璇彞鐨勭洃鎺х瓑絳夛紝榪欏氨闇瑕佹垜浠叡鍚屽幓鍙戞帢浜嗐?

    闄勪歡涓寘鎷簡涓涓猠asywebwork鐨勪緥瀛愶紝鎴戞妸jamon瀵煎叆鍒拌繖涓緥瀛愬伐紼嬩腑鍘伙紝澶у鍙互鐩存帴涓嬭澆榪愯瑙傜湅鏁堟灉銆侲asywebwork鏄竴涓棬鍦ㄥ噺灝憌ebwork2.2.x緋誨垪鐨剎ml閰嶇疆鏂囦歡鐨勯」鐩?br />
  • JamonSample.rar (3.7 MB)
  • 鎻忚堪: 鐢變簬涓婁紶鏂囦歡澶у皬鏈夐檺鍒訛紝鎵浠ラ渶瑕佸悓瀛︿滑鑷繁娣誨姞涓涓媕ar鍖咃細 spring,common-logging,log4j,common-collections activation, common-lang

     

  • lib.rar (3.3 MB)
  • 鎻忚堪: 絎簩緇勫寘鍖呮嫭 spring,common-logging,log4j,common-collections activation, common-lang

     



  • paulwong 2012-01-25 16:32 鍙戣〃璇勮
    ]]>
    memcache-client-forjava http://m.tkk7.com/paulwong/archive/2012/01/24/368871.htmlpaulwongpaulwongTue, 24 Jan 2012 12:34:00 GMThttp://m.tkk7.com/paulwong/archive/2012/01/24/368871.htmlhttp://m.tkk7.com/paulwong/comments/368871.htmlhttp://m.tkk7.com/paulwong/archive/2012/01/24/368871.html#Feedback0http://m.tkk7.com/paulwong/comments/commentRss/368871.htmlhttp://m.tkk7.com/paulwong/services/trackbacks/368871.htmlhttp://code.google.com/p/memcache-client-forjava/
    http://marc.iteye.com/blog/28700
    http://www.jayxu.com/2010/06/09/2342/
    http://www.iteye.com/topic/128458
    http://code.google.com/p/xmemcached/wiki/User_Guide_zh



    paulwong 2012-01-24 20:34 鍙戣〃璇勮
    ]]>
    EhCache 緙撳瓨緋葷粺綆浠?/title><link>http://m.tkk7.com/paulwong/archive/2012/01/24/368869.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Tue, 24 Jan 2012 12:32:00 GMT</pubDate><guid>http://m.tkk7.com/paulwong/archive/2012/01/24/368869.html</guid><wfw:comment>http://m.tkk7.com/paulwong/comments/368869.html</wfw:comment><comments>http://m.tkk7.com/paulwong/archive/2012/01/24/368869.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/paulwong/comments/commentRss/368869.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/paulwong/services/trackbacks/368869.html</trackback:ping><description><![CDATA[     鎽樿: EhCache 鏄竴涓函Java鐨勮繘紼嬪唴緙撳瓨妗嗘灦錛屽叿鏈夊揩閫熴佺簿騫茬瓑鐗圭偣錛屾槸Hibernate涓粯璁ょ殑CacheProvider銆? 涓嬪浘鏄?EhCache 鍦ㄥ簲鐢ㄧ▼搴忎腑鐨勪綅緗細 EhCache 鐨勪富瑕佺壒鎬ф湁錛? 1. 蹇?2. 綆鍗?3. 澶氱緙撳瓨絳栫暐4. 緙撳瓨鏁版嵁鏈変袱綰э細鍐呭瓨鍜岀鐩橈紝鍥犳鏃犻渶鎷呭績瀹歸噺闂5. 緙撳瓨鏁版嵁浼氬湪铏氭嫙鏈洪噸鍚殑榪囩▼涓啓鍏ョ鐩?. 鍙互閫氳繃RMI銆佸彲鎻掑叆API...  <a href='http://m.tkk7.com/paulwong/archive/2012/01/24/368869.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/paulwong/aggbug/368869.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/paulwong/" target="_blank">paulwong</a> 2012-01-24 20:32 <a href="http://m.tkk7.com/paulwong/archive/2012/01/24/368869.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://100357.com" target="_blank">免费人成视频在线播放</a>| <a href="http://qzllw.com" target="_blank">久久久国产精品福利免费</a>| <a href="http://wwwbu610.com" target="_blank">亚洲人午夜射精精品日韩</a>| <a href="http://6266tv.com" target="_blank">国产一区二区免费</a>| <a href="http://dszb0099.com" target="_blank">亚洲中字慕日产2020</a>| <a href="http://www1688mz.com" target="_blank">国产成人免费a在线视频app</a>| <a href="http://653349.com" target="_blank">最近免费中文字幕中文高清</a>| <a href="http://532342.com" target="_blank">亚洲国产成人在线视频</a>| <a href="http://pecbj.com" target="_blank">亚洲精品成人久久久</a>| <a href="http://hhrrrr.com" target="_blank">24小时在线免费视频</a>| <a href="http://400209.com" target="_blank">免费无毒a网站在线观看</a>| <a href="http://snbbearing.com" target="_blank">亚洲国产成人片在线观看</a>| <a href="http://www-44334.com" target="_blank">成人毛片18女人毛片免费96</a>| <a href="http://tjbdyx.com" target="_blank">999zyz**站免费毛片</a>| <a href="http://msjdyd.com" target="_blank">亚洲精华国产精华精华液好用</a>| <a href="http://zzhjnmzp.com" target="_blank">亚洲午夜电影在线观看高清 </a>| <a href="http://shcxsoft.com" target="_blank">永久免费视频v片www</a>| <a href="http://s8sb.com" target="_blank">一级毛片完整版免费播放一区</a>| <a href="http://90hong.com" target="_blank">国产免费AV片在线播放唯爱网</a>| <a href="http://xyjxnhcl.com" target="_blank">亚洲AV无码久久精品色欲</a>| <a href="http://caocl1024liu.com" target="_blank">欧洲乱码伦视频免费</a>| <a href="http://fenxue520.com" target="_blank">香蕉免费看一区二区三区</a>| <a href="http://5g5t.com" target="_blank">美女视频黄免费亚洲</a>| <a href="http://3688008.com" target="_blank">久久亚洲精品中文字幕三区</a>| <a href="http://wusongtv.com" target="_blank">午夜视频在线在免费</a>| <a href="http://ynxxrh.com" target="_blank">最近中文字幕大全中文字幕免费</a>| <a href="http://www5g9.com" target="_blank">亚洲成AV人在线观看天堂无码</a>| <a href="http://ygloka.com" target="_blank">二区久久国产乱子伦免费精品</a>| <a href="http://zzo8.com" target="_blank">亚洲国产一级在线观看</a>| <a href="http://gift1town.com" target="_blank">久久99九九国产免费看小说</a>| <a href="http://dehaichem.com" target="_blank">免费a级毛片无码a∨免费软件 </a>| <a href="http://963315.com" target="_blank">亚洲成AV人片在线观看ww</a>| <a href="http://bjbf99.com" target="_blank">国产一级高清视频免费看</a>| <a href="http://sh-shule.com" target="_blank">91av视频免费在线观看</a>| <a href="http://lzhuiding.com" target="_blank">国产精品免费视频观看拍拍</a>| <a href="http://www003924.com" target="_blank">亚洲成a人片在线观看天堂无码 </a>| <a href="http://fz166.com" target="_blank">免费人成网站7777视频</a>| <a href="http://hn283.com" target="_blank">中文字幕av无码无卡免费</a>| <a href="http://cao8080.com" target="_blank">99久久人妻精品免费二区</a>| <a href="http://72c5.com" target="_blank">国产无限免费观看黄网站</a>| <a href="http://littlevv.com" target="_blank">看全免费的一级毛片</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>