亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lrumemorystore.java

?? EasyDBO v0.4 是一個非常適合中小型軟件數據庫開發的數據持久層框架
?? JAVA
字號:
/* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2003 - 2004 Greg Luck.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in *    the documentation and/or other materials provided with the *    distribution. * * 3. The end-user documentation included with the redistribution, if *    any, must include the following acknowlegement: *       "This product includes software developed by Greg Luck *       (http://sourceforge.net/users/gregluck) and contributors. *       See http://sourceforge.net/project/memberlist.php?group_id=93232 *       for a list of contributors" *    Alternately, this acknowledgement may appear in the software itself, *    if and wherever such third-party acknowlegements normally appear. * * 4. The names "EHCache" must not be used to endorse or promote products *    derived from this software without prior written permission. For written *    permission, please contact Greg Luck (gregluck at users.sourceforge.net). * * 5. Products derived from this software may not be called "EHCache" *    nor may "EHCache" appear in their names without prior written *    permission of Greg Luck. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED.  IN NO EVENT SHALL GREG LUCK OR OTHER * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by contributors * individuals on behalf of the EHCache project.  For more * information on EHCache, please see <http://ehcache.sourceforge.net/>. * */package com.easyjf.cache.store;/** * 這里直接使用的Apache開源緩存ECache中的算法 */import com.easyjf.cache.*;import org.apache.log4j.Logger;import java.util.Map;/** * An implementation of a LruMemoryStore. * <p/> * This uses {@link java.util.LinkedHashMap} as its backing map. It uses the {@link java.util.LinkedHashMap} LRU * feature. LRU for this implementation means least recently accessed. * * @author <a href="mailto:gluck@thoughtworks.com">Greg Luck</a> * @version $Id: LruMemoryStore.java,v 1.8 2005/10/14 02:12:58 gregluck Exp $ */public class LruMemoryStore extends MemoryStore {	private final static Logger logger = Logger.getLogger(LruMemoryStore.class);    /**     * Constructor for the LruMemoryStore object     * The backing {@link java.util.LinkedHashMap} is created with LRU by access order.     */    public LruMemoryStore(ICache cache) {        super(cache);        try {            map = loadMapInstance();        } catch (CacheException e) {            logger.error(cache.getName() + "Cache: Cannot start LruMemoryStore", e);        }    }    /**     * Tries to load a {@link java.util.LinkedHashMap} (JDK1.4) and then     * tries to load an {@link org.apache.commons.collections.LRUMap}.     * <p/>     * This way applications running JDK1.4 do not have a dependency     * on Apache commons-collections.     *     * @return a Map, being either {@link java.util.LinkedHashMap} or     */    public Map loadMapInstance() throws CacheException {        //First try to load java.util.LinkedHashMap, which is preferred, but only if not overriden        if (System.getProperty("net.sf.ehcache.useLRUMap") == null) {            try {                Class.forName("java.util.LinkedHashMap");                Map candidateMap = new SpoolingLinkedHashMap();                                  logger.debug(cache.getName() + " Cache: Using SpoolingLinkedHashMap implementation");                             return candidateMap;            } catch (Exception e) {                                   logger.debug(cache.getName() + " Cache: Cannot find java.util.LinkedHashMap");                          }        }        //Secondly, try and load org.apache.commons.collections.LRUMap        try {            Class.forName("org.apache.commons.collections.LRUMap");            Map candidateMap = new SpoolingLRUMap();                           logger.debug(cache.getName() + " Cache: Using SpoolingLRUMap implementation");                      return candidateMap;        } catch (Exception e) {            //Give up            throw new CacheException(cache.getName()                    + "Cache: Cannot find org.apache.commons.collections.LRUMap.");        }    }    /**     * An LRU Map implementation based on Apache Commons LRUMap.     * <p/>     * This is used if {@link java.util.LinkedHashMap} is not found in the classpath.     * LinkedHashMap is part of JDK     */    public class SpoolingLRUMap extends org.apache.commons.collections.LRUMap {    	private static final long serialVersionUID=1994584985l;        /**         * Constructor.         * The maximum size is set to {@link Cache#getMaxElementsInMemory}. If the         * LRUMap gets bigger than this, {@link #processRemovedLRU} is called.         */        public SpoolingLRUMap() {            setMaximumSize(cache.getMaxElemnetCount());        }        /**         * Called after the element has been removed.         * <p/>         * Our choices are to do nothing or spool the element to disk.         * <p/>         * Note that value will be null when the memory size is set to 0. Thus a null guard is used.         *         * @param key         * @param value         */        protected void processRemovedLRU(Object key, Object value) {            //Already removed from the map at this point            Element element = (Element) value;            //When max size is 0            if (element == null) {                return;            }        }    }    /**     * An extension of LinkedHashMap which overrides {@link #removeEldestEntry}     * to persist cache entries to the auxiliary cache before they are removed.     * <p/>     * This implementation also provides LRU by access order.     */    public class SpoolingLinkedHashMap extends java.util.LinkedHashMap {    	private static final long serialVersionUID=84758345l;        private static final int INITIAL_CAPACITY = 100;        private static final float GROWTH_FACTOR = .75F;        /**         * Default constructor.         * Will create an initial capacity of 100, a loading of .75 and         * LRU by access order.         */        public SpoolingLinkedHashMap() {            super(INITIAL_CAPACITY, GROWTH_FACTOR, true);        }        /**         * Returns <tt>true</tt> if this map should remove its eldest entry.         * This method is invoked by <tt>put</tt> and <tt>putAll</tt> after         * inserting a new entry into the map.  It provides the implementer         * with the opportunity to remove the eldest entry each time a new one         * is added.  This is useful if the map represents a cache: it allows         * the map to reduce memory consumption by deleting stale entries.         * <p/>         * Will return true if:         * <ol>         * <li> the element has expired         * <li> the cache size is greater than the in-memory actual.         * In this case we spool to disk before returning.         * </ol>         *         * @param eldest The least recently inserted entry in the map, or if         *               this is an access-ordered map, the least recently accessed         *               entry.  This is the entry that will be removed it this         *               method returns <tt>true</tt>.  If the map was empty prior         *               to the <tt>put</tt> or <tt>putAll</tt> invocation resulting         *               in this invocation, this will be the entry that was just         *               inserted; in other words, if the map contains a single         *               entry, the eldest entry is also the newest.         * @return true if the eldest entry should be removed         *         from the map; <tt>false</t> if it should be retained.         */        protected boolean removeEldestEntry(Map.Entry eldest) {            Element element = (Element) eldest.getValue();            return removeLeastRecentlyUsedElement(element);        }        /**         * Relies on being called from a synchronized method         *         * @param element         * @return true if the LRU element should be removed         */        private boolean removeLeastRecentlyUsedElement(Element element) {            //check for expiry and remove before going to the trouble of spooling it            if (cache.isExpired(element)) {                              return true;            }            if (isFull()) {                             return true;            } else {                return false;            }        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久一区二区| 精品久久国产97色综合| 高清国产一区二区| 国产精品456露脸| 狠狠色丁香久久婷婷综合丁香| 日本美女视频一区二区| 麻豆精品在线播放| 国产伦精品一区二区三区在线观看 | 欧美亚洲国产bt| 在线看一区二区| 欧美日韩国产综合草草| 日韩一区二区三区在线观看| 日韩视频国产视频| 国产日韩精品一区| 一区二区三区日韩欧美精品| 亚洲高清在线精品| 日本v片在线高清不卡在线观看| 青青草97国产精品免费观看 | 欧美日韩精品专区| 日韩免费一区二区| 中文无字幕一区二区三区| 亚洲三级在线免费| 日韩和的一区二区| 国产精品亚洲综合一区在线观看| 91丝袜美腿高跟国产极品老师| 欧美日韩国产经典色站一区二区三区| 在线播放欧美女士性生活| 久久只精品国产| 亚洲伊人伊色伊影伊综合网| 另类成人小视频在线| 99精品1区2区| 日韩一区二区中文字幕| 亚洲日本在线a| 蜜桃av噜噜一区| 色婷婷综合久久久中文字幕| 日韩免费电影网站| 亚洲啪啪综合av一区二区三区| 美女性感视频久久| 在线免费观看日本欧美| 精品久久久三级丝袜| 亚洲激情五月婷婷| 国产综合久久久久影院| 欧美亚洲国产一区二区三区| 久久久777精品电影网影网| 亚洲第一狼人社区| 91小视频在线免费看| 亚洲精品在线观| 天天色天天操综合| 日本电影欧美片| 国产视频911| 黄色日韩三级电影| 欧美福利视频一区| 一区二区三区在线视频免费观看| 国产酒店精品激情| 欧美一级免费观看| 婷婷久久综合九色国产成人| 99re视频精品| 国产精品污www在线观看| 国产一区二区三区| 日韩欧美在线影院| 日韩精品久久久久久| 色久优优欧美色久优优| 国产精品久久久久久久久久久免费看| 国产一区二区三区日韩| 7777女厕盗摄久久久| 视频精品一区二区| 欧美日韩在线三区| 五月综合激情婷婷六月色窝| 欧美日韩在线三级| 亚洲福利一区二区| 色哟哟国产精品免费观看| 国产精品久久久久久久久晋中 | 男女性色大片免费观看一区二区| 91浏览器在线视频| 自拍视频在线观看一区二区| 成人av网站免费| 中文字幕精品—区二区四季| 高清国产一区二区| 成人欧美一区二区三区白人| 播五月开心婷婷综合| 中日韩免费视频中文字幕| 国产盗摄精品一区二区三区在线| 久久综合久久鬼色| 国产白丝网站精品污在线入口| 国产日韩在线不卡| 成人网在线免费视频| 亚洲男人的天堂在线观看| 99精品视频在线免费观看| 亚洲免费观看视频| 在线成人小视频| 激情亚洲综合在线| 国产欧美一区二区三区网站 | 免费在线成人网| 欧美一区午夜精品| 国产成人精品一区二区三区网站观看| 国产精品免费aⅴ片在线观看| 在线一区二区视频| 久久成人羞羞网站| 国产精品久久久久久一区二区三区| www.亚洲色图| 日韩国产精品久久久久久亚洲| 欧美高清精品3d| 国产成人高清视频| 一区二区三区在线观看欧美| 日韩一级片网址| 91碰在线视频| 麻豆一区二区三| 亚洲视频在线一区观看| 51午夜精品国产| 91日韩一区二区三区| 美女在线视频一区| 亚洲综合色丁香婷婷六月图片| 亚洲精品一区二区三区影院 | 国产亚洲欧美在线| 欧美私模裸体表演在线观看| 老司机精品视频在线| **欧美大码日韩| 日韩欧美亚洲另类制服综合在线 | 婷婷丁香激情综合| 国产精品久久久久久久久免费桃花 | 97久久人人超碰| 免费成人在线网站| 一区二区欧美在线观看| 国产欧美日韩不卡| 在线精品视频免费播放| 久久众筹精品私拍模特| 亚洲国产精品欧美一二99 | 中文字幕二三区不卡| 日韩av在线播放中文字幕| 一区二区在线观看免费视频播放| 精品999在线播放| 亚洲国产精品av| 91精品福利在线一区二区三区 | 五月天一区二区三区| 粉嫩av一区二区三区粉嫩 | 日日噜噜夜夜狠狠视频欧美人| 一本色道久久综合狠狠躁的推荐 | 91极品视觉盛宴| 亚洲欧洲韩国日本视频| 成熟亚洲日本毛茸茸凸凹| 欧美日本高清视频在线观看| 欧美天天综合网| 成人a级免费电影| 欧洲人成人精品| 欧美大片在线观看| 欧美另类久久久品| 欧美亚洲高清一区| 91久久免费观看| 在线看国产一区| 91福利精品视频| 在线看不卡av| 欧美绝品在线观看成人午夜影视| 色网站国产精品| 在线欧美日韩精品| 欧美蜜桃一区二区三区| 91麻豆精品国产自产在线| 欧美伦理视频网站| 欧美一级二级三级蜜桃| 日韩一区二区三区在线| 26uuu国产在线精品一区二区| 欧美精品一区二区三| 欧美国产精品久久| 亚洲男女毛片无遮挡| 亚洲成国产人片在线观看| 日韩精品电影一区亚洲| 精品一区二区国语对白| 国产精品一二三四五| www.亚洲色图.com| 欧美综合色免费| 在线观看91精品国产麻豆| 久久综合国产精品| 国产精品另类一区| 一区二区三区国产精品| 丝袜亚洲另类欧美综合| 狠狠狠色丁香婷婷综合久久五月| 国产精品一二三在| 欧美在线免费视屏| 欧美大片一区二区| 亚洲特级片在线| 日本系列欧美系列| 处破女av一区二区| 欧美日韩精品高清| 欧美国产禁国产网站cc| 亚洲成人免费视| 成人一道本在线| 欧美高清精品3d| 中文字幕一区二区在线观看 | 日韩不卡手机在线v区| 国内不卡的二区三区中文字幕 | 欧美一级爆毛片| 综合电影一区二区三区| 麻豆高清免费国产一区| 91天堂素人约啪| 欧美videofree性高清杂交| 亚洲欧美综合色| 国产一区二区三区综合| 欧美老年两性高潮| 国产精品成人一区二区三区夜夜夜 | 91精品国产品国语在线不卡| 国产精品亲子伦对白|