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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? baseorderedregistry.java

?? jetspeed源代碼
?? JAVA
字號:
/*
 * Copyright 2000-2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.jetspeed.om.registry.base;

import org.apache.jetspeed.om.registry.RegistryEntry;
import org.apache.jetspeed.om.registry.InvalidEntryException;
import org.apache.jetspeed.services.logging.JetspeedLogFactoryService;
import org.apache.jetspeed.services.logging.JetspeedLogger;


import java.util.Map;
import java.util.TreeMap;
import java.util.List;
import java.util.Iterator;
import java.util.Enumeration;
import java.util.Vector;

/**
 * Provides a basic registry implementation that keep the elements
 * ordered.
 *
 * @author <a href="mailto:raphael@apache.org">Rapha雔 Luta</a>
 * @version $Id: BaseOrderedRegistry.java,v 1.4 2004/02/23 03:08:26 jford Exp $
 */
public class BaseOrderedRegistry implements LocalRegistry
{
    protected List entries = new Vector();

    protected Map idx = null;

    /**
     * Static initialization of the logger for this class
     */    
    private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(BaseOrderedRegistry.class.getName());    
    
    /** @see Registry#getEntryCount */
    public int getEntryCount()
    {
        return this.entries.size();
    }

    /** @see Registry#getEntry */
    public RegistryEntry getEntry( String name ) throws InvalidEntryException
    {

        RegistryEntry entry = null;

        try
        {
            if (idx == null)
            {
                synchronized (entries)
                {
                    buildIdx();
                }
            }

            if (name != null)
            {
                synchronized (entries)
                {
                    Integer pos = ((Integer)idx.get(name));

                    if (pos == null)
                    {
                        throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+name );
                    }

                    entry = (RegistryEntry)entries.get(pos.intValue()) ;
                }
            }
        }
        catch(Exception e)
        {
            // this will happen if for some reasons the index and vector are desynchronized.
            // before throwing an exception, rebuild the idx to prevent further errors
            synchronized(entries)
            {
                buildIdx();
            }

            logger.error("getEntry: index and vector are not in synch.", e);
            throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+name );
        }

        return entry;
    }

    /**
    @see Registry#setEntry
    */
    public void setEntry( RegistryEntry entry ) throws InvalidEntryException
    {
        setLocalEntry( entry );
    }

    /**
    @see Registry#addEntry
    */
    public void addEntry( RegistryEntry entry ) throws InvalidEntryException
    {
        addLocalEntry( entry );
    }

    /**
    @see Registry#removeEntry
    */
    public void removeEntry( String name )
    {
        removeLocalEntry( name );
    }

    /**
    @see Registry#removeEntry
    */

    public void removeEntry( RegistryEntry entry )
    {
        removeLocalEntry( entry );
    }

    /**
       @see Registry#hasEntry
    */
    public boolean hasEntry( String name )
    {
        synchronized (entries)
        {
            if (idx == null)
            {
                buildIdx();
            }
        }

        return this.idx.containsKey( name );
    }

    /**
       @see Registry#getEntries
     */
    public Enumeration getEntries()
    {
        Vector v = new Vector(entries);

        return v.elements();
    }

    /**
       @see Registry#listEntryNames
     */
    public Iterator listEntryNames()
    {
        synchronized (entries)
        {
            if (idx == null)
            {
                buildIdx();
            }
        }

        return this.idx.keySet().iterator();
    }

    /**
       @see Registry#toArray
     */
    public RegistryEntry[] toArray()
    {
        RegistryEntry[] array = new RegistryEntry[ entries.size() ];

        return (RegistryEntry[])entries.toArray(array);

    }

    /**
     * Creates a new RegistryEntry instance compatible with the current
     * Registry instance implementation
     *
     * @return the newly created RegistryEntry
     */
    public RegistryEntry createEntry()
    {
        return new BaseRegistryEntry();
    }


    // RegistryService specific methods

    /**
     * This method is used  to only set the entry in the local
     * memory cache of the registry without any coherency check with
     * persistent storage
     *
     * @param entry the RegistryEntry to store
     */
    public void setLocalEntry( RegistryEntry entry ) throws InvalidEntryException
    {
        synchronized (entries)
        {
            if (idx == null)
            {
                buildIdx();
            }

            if ( this.idx.containsKey( entry.getName() ) == false )
            {
                throw new InvalidEntryException( InvalidEntryException.ENTRY_DOES_NOT_EXIST+" "+entry.getName());
            }

            int pos = ((Integer)idx.get(entry.getName())).intValue();

            this.entries.set( pos, entry );
        }
    }

    /**
     * This method is used to only add the entry in the local
     * memory cache of the registry without any coherency check with
     * persistent storage
     *
     * @param entry the RegistryEntry to store
     */
    public void addLocalEntry( RegistryEntry entry ) throws InvalidEntryException
    {
        synchronized (entries)
        {
            if (idx == null)
            {
                buildIdx();
            }

            if ( this.idx.containsKey( entry.getName() ) )
            {
                throw new InvalidEntryException( InvalidEntryException.ENTRY_ALREADY_PRESENT );
            }

            int pos = this.entries.size();
            this.entries.add( entry );
            this.idx.put( entry.getName(), new Integer(pos) );
        }
    }

    /**
     * This method is used to only remove the entry from the local
     * memory cache of the registry without any coherency check with
     * persistent storage
     *
     * @param name the name of the RegistryEntry to remove
     */
    public void removeLocalEntry( String name )
    {
        synchronized(entries)
        {
            if (idx == null)
            {
                buildIdx();
            }

            if (this.idx.containsKey(name))
            {
                int pos = ((Integer)idx.get(name)).intValue();
                this.entries.remove( pos );
                buildIdx();
            }
        }
    }

    /**
     * This method is used to only remove the entry from the local
     * memory cache of the registry without any coherency check with
     * persistent storage
     *
     * @param entry the RegistryEntry to remove
     */
    public void removeLocalEntry( RegistryEntry entry )
    {
        synchronized(entries)
        {
            if (entries.remove( entry ))
            {
                buildIdx();
            }
        }
    }

    /**
     * Build a lookup index of entries
     */
    private void buildIdx()
    {
        Map map = new TreeMap();

        for (int i=0; i < entries.size(); i++)
        {
            RegistryEntry entry = (RegistryEntry)entries.get(i);
            map.put( entry.getName(), new Integer(i));
        }

        this.idx = map;
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美的一区二区| 成人黄色综合网站| 国产传媒日韩欧美成人| k8久久久一区二区三区| 日本韩国欧美国产| 欧美一区二区视频观看视频| 国产清纯美女被跳蛋高潮一区二区久久w | 在线观看亚洲a| 欧美一区二区性放荡片| 中文字幕免费观看一区| 午夜精品一区二区三区免费视频 | 久久免费电影网| 亚洲精品视频自拍| 韩国精品在线观看| 91久久久免费一区二区| 精品久久久久久久人人人人传媒| 国产精品久久久久久妇女6080| 亚洲超碰精品一区二区| 国产成人午夜99999| 欧美日韩久久一区二区| 国产精品嫩草影院com| 五月天视频一区| 成人美女在线观看| 7777女厕盗摄久久久| 国产精品美女久久久久aⅴ | 91精品午夜视频| 国产精品免费av| 三级久久三级久久| 成人动漫在线一区| 日韩精品一区二区三区在线| 亚洲欧洲日韩一区二区三区| 日韩av成人高清| 一本久久综合亚洲鲁鲁五月天| 精品国产乱码久久久久久老虎| 亚洲一二三区在线观看| 国产成a人亚洲精| 日韩女同互慰一区二区| 亚洲国产cao| 99国产一区二区三精品乱码| xnxx国产精品| 美洲天堂一区二卡三卡四卡视频| 91免费精品国自产拍在线不卡| 精品粉嫩aⅴ一区二区三区四区| 亚洲自拍偷拍九九九| 成人av在线一区二区三区| 日韩一区二区精品| 亚洲永久精品国产| 99精品在线免费| 久久免费午夜影院| 精品综合免费视频观看| 7878成人国产在线观看| 一区二区成人在线| 99riav久久精品riav| 久久久99精品免费观看不卡| 国产精品91一区二区| 日韩欧美自拍偷拍| 日韩**一区毛片| 欧美日韩精品欧美日韩精品一 | 欧美日韩国产另类一区| 亚洲女子a中天字幕| 91香蕉视频mp4| 国产精品动漫网站| 成人免费的视频| 国产女同互慰高潮91漫画| 久久99精品国产91久久来源| 91精品国产91久久久久久最新毛片 | 国产91丝袜在线18| 久久久久高清精品| 国产成人精品aa毛片| 国产欧美日韩一区二区三区在线观看| 老司机午夜精品| 精品少妇一区二区三区日产乱码| 日本少妇一区二区| 欧美一级电影网站| 看片网站欧美日韩| 精品国产一区二区在线观看| 蜜桃一区二区三区在线| 日韩亚洲电影在线| 久久99久久久欧美国产| 精品成人私密视频| 3d成人动漫网站| av亚洲产国偷v产偷v自拍| 久久综合资源网| 国产高清久久久| 中文字幕欧美激情一区| 粉嫩av一区二区三区| 国产精品久久久久久久久图文区 | 日本欧美大码aⅴ在线播放| 欧美一区二区精美| 国产精品影视在线| ...xxx性欧美| 欧美精选午夜久久久乱码6080| 激情另类小说区图片区视频区| 国产精品久久久久永久免费观看 | 国产成人精品一区二区三区四区| 亚洲伦理在线免费看| 日韩欧美国产wwwww| 99久久精品一区二区| 奇米888四色在线精品| 一区在线观看免费| 日韩一区二区电影在线| 91视视频在线直接观看在线看网页在线看 | 欧美成人伊人久久综合网| 北条麻妃国产九九精品视频| 日产国产欧美视频一区精品| 一区精品在线播放| 日韩精品一区二| 日本丶国产丶欧美色综合| 狠狠色综合日日| 亚洲韩国精品一区| 国产农村妇女毛片精品久久麻豆| 欧美人牲a欧美精品| 成人精品gif动图一区| 美国欧美日韩国产在线播放| 一区二区理论电影在线观看| 一区二区视频在线| 国产日本一区二区| 日韩三级电影网址| 欧美影片第一页| 成人黄色免费短视频| 精品一区二区免费视频| 亚洲国产精品久久艾草纯爱| 中文字幕成人av| 久久亚洲综合色| 欧美一区二区精品在线| 欧美午夜精品久久久久久孕妇| 成+人+亚洲+综合天堂| 国产一区二区三区四| 奇米色一区二区| 亚洲第一二三四区| 亚洲伦在线观看| 中文字幕av一区二区三区免费看| 日韩欧美视频一区| 911精品国产一区二区在线| 91免费版在线看| 高清在线不卡av| 国模冰冰炮一区二区| 久久精品999| 日本中文一区二区三区| 一区二区三区丝袜| 亚洲视频在线一区二区| 国产欧美一区二区精品秋霞影院| 精品国产麻豆免费人成网站| 日韩欧美国产一区二区在线播放| 欧美三电影在线| 欧美在线一二三四区| 在线视频一区二区三| 色婷婷av久久久久久久| 一本色道久久加勒比精品| youjizz国产精品| 成人黄色网址在线观看| 成人性视频免费网站| 夫妻av一区二区| 国产91高潮流白浆在线麻豆| 国产成人精品免费在线| 国产乱码字幕精品高清av| 国产一区中文字幕| 国产综合色产在线精品| 国产精品一区一区三区| 国产九色精品成人porny| 国产一区二区在线电影| 国产在线精品免费| 国产精选一区二区三区| 国产成人综合精品三级| 国产成人精品一区二区三区四区| 国产91精品久久久久久久网曝门| 高清免费成人av| av网站免费线看精品| 99精品热视频| 色婷婷亚洲一区二区三区| 欧美视频一区二区三区| 在线精品视频免费播放| 欧美唯美清纯偷拍| 91精品国产综合久久香蕉的特点| 制服.丝袜.亚洲.中文.综合| 欧美一级夜夜爽| 久久蜜桃av一区二区天堂| 国产精品女同一区二区三区| 亚洲精品欧美专区| 日韩精品亚洲专区| 久久黄色级2电影| 盗摄精品av一区二区三区| 99re8在线精品视频免费播放| 欧美视频完全免费看| 日韩视频在线一区二区| 日本一区二区三区久久久久久久久不| 国产精品嫩草影院av蜜臀| 洋洋av久久久久久久一区| 日韩精品三区四区| 国产一区二区剧情av在线| www.欧美亚洲| 精品视频一区二区三区免费| 欧美大尺度电影在线| 中文字幕精品三区| 亚洲午夜精品久久久久久久久| 日韩电影在线免费| 亚洲18女电影在线观看| 美女尤物国产一区| av一二三不卡影片| 欧美日韩免费观看一区二区三区|