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

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

?? configparams.java

?? jxta平臺的開發包
?? JAVA
字號:
/* * Copyright (c) 2001 Sun Microsystems, Inc.  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 acknowledgment: *       "This product includes software developed by the *       Sun Microsystems, Inc. for Project JXTA." *    Alternately, this acknowledgment may appear in the software itself, *    if and wherever such third-party acknowledgments normally appear. * * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must *    not be used to endorse or promote products derived from this *    software without prior written permission. For written *    permission, please contact Project JXTA at http://www.jxta.org. * * 5. Products derived from this software may not be called "JXTA", *    nor may "JXTA" appear in their name, without prior written *    permission of Sun. * * 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 SUN MICROSYSTEMS OR * ITS 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 many * individuals on behalf of Project JXTA.  For more * information on Project JXTA, please see * <http://www.jxta.org/>. * * This license is based on the BSD license adopted by the Apache Foundation. * * $Id: ConfigParams.java,v 1.7 2006/02/22 01:31:14 bondolo Exp $ */package net.jxta.protocol;import java.net.URI;import java.util.Collections;import java.util.Enumeration;import java.util.HashMap;import java.util.Iterator;import java.util.Map;import java.util.Set;import java.net.URISyntaxException;import org.apache.log4j.Level;import org.apache.log4j.Logger;import net.jxta.document.ExtendableAdvertisement;import net.jxta.document.Element;import net.jxta.document.StructuredDocument;import net.jxta.document.StructuredDocumentUtils;import net.jxta.document.XMLElement;import net.jxta.id.ID;import net.jxta.id.IDFactory;/** * A container for collections of configuration parameters. Configuration  * parameters are stored in a Map which is keyed by {@code JXTA ID}s and whose  * values are {@code StructuredDocument}s. **/public abstract class ConfigParams extends ExtendableAdvertisement {        /**     *  Log4J Logger     **/    private final static transient Logger LOG = Logger.getLogger(ConfigParams.class.getName());        private static final String SVC_TAG = "Svc";    private static final String MCID_TAG = "MCID";    private static final String PARAM_TAG = "Parm";        /**     * A table of structured documents to be interpreted by each service.     * For safe operation these elements should be immutable, but we're helpless     * if they are not. Parameters for services associated with this peer. May     * be needed for invocation of those services.     **/    private Map<ID, StructuredDocument> params = new HashMap<ID, StructuredDocument>();        /**     * Counts the changes made to this object. The API increments it every time     * some change is not proven to be idempotent. We rely on implementations to     * increment modCount every time something is changed without going through     * the API.     **/    protected transient volatile int modCount = 0;        /**     * Returns the number of times this object has been modified since     * it was created.     * This permits the detection of local changes that require refreshing some     * other data.     *     * @return int the current modification count.     */    public int getModCount() {        return modCount;    }        /**     *  Increases the modification count of the     **/    protected synchronized int incModCount() {        return modCount++;    }        /**     *  Returns the identifying type of this Advertisement.     *     * @return String the type of advertisement     **/    public static String getAdvertisementType() {        return "jxta:CP" ;    }        /**     * {@inheritDoc}     **/    public final String getBaseAdvType() {        return getAdvertisementType();    }        /**     * Puts a service parameter in the service parameters table     * under the given key. The key is of a subclass of ID; usually a     * ModuleClassID. This method makes a deep copy of the given element     * into an independent document.     *     * @param key The key.     * @param param The parameter, as an element. What is stored is a copy as     * a stand-alone StructuredDocument which type is the element's name.     */    public void putServiceParam( ID key, Element param ) {        incModCount();                if (param == null) {            params.remove(key);            return;        }        StructuredDocument newDoc = StructuredDocumentUtils.copyAsDocument(param);        params.put( key, newDoc);    }        /**     * Returns the parameter element that matches the given key from the     * service parameters table. The key is of a subclass of ID; usually a     * ModuleClassID.     *     * @param key The key.     * @return StructuredDocument The matching parameter document or null if     * none matched.     **/    public StructuredDocument getServiceParam(ID key) {        StructuredDocument param = params.get(key);                if (param == null) {            return null;        }                StructuredDocument newDoc = StructuredDocumentUtils.copyAsDocument(param);        return newDoc;    }        /**     * Removes and returns the parameter element that matches the given key     * from the service parameters table. The key is of a subclass of ID;     * usually a ModuleClassID.     *     * @param key The key.     *     * @return Element the removed parameter element or null if not found.     * This is actually a StructureDocument of type "Param".     */    public StructuredDocument removeServiceParam(ID key) {                Element param = (Element) params.remove(key);        if (param == null) {            return null;        }                incModCount();                // It sound silly to clone it, but remember that we could be sharing        // this element with a clone of ours, so we have the duty to still        // protect it.                StructuredDocument newDoc =        StructuredDocumentUtils.copyAsDocument(param);                return newDoc;    }        /**     *  Returns the set of params held by this object. The parameters are not     *  copied and any changes to the Set are reflected in this object's version.     *  incModCount should be called as appropriate.     **/    public Set getServiceParamsEntrySet() {        return Collections.unmodifiableSet( params.entrySet() );    }        /**     *  {@inheritDoc}     **/    protected boolean handleElement( Element raw ) {                if ( super.handleElement( raw ) )            return true;                XMLElement elem = (XMLElement) raw;                if (elem.getName().equals(SVC_TAG)) {            Enumeration elems = elem.getChildren();            ID classID = null;            Element param = null;            while (elems.hasMoreElements()) {                XMLElement e = (XMLElement) elems.nextElement();                if ( e.getName().equals(MCID_TAG) ) {                    try {                        URI mcid = new URI( e.getTextValue() );                        classID = (ID) IDFactory.fromURI( mcid );                    } catch ( URISyntaxException badID ) {                        throw new IllegalArgumentException( "Bad ModuleClassID in advertisement: " + e.getTextValue() );                    }                    continue;                }                if ( e.getName().equals(PARAM_TAG) ) {                    param = e;                    continue;                }            }            if (classID != null && param != null) {                // Add this param to the table. putServiceParam()                // clones param into a standalone document automatically.                // (classID gets cloned too).                putServiceParam( classID, param );            } else {                if ( LOG.isEnabledFor(Level.DEBUG) )                    LOG.debug( "Incomplete Service Param : id=" + classID + " param=" + param );                return false;            }            return true;        }                return false;    }        /**     *  Return the advertisement as a document.     *     *  @param adv the document to add elements to.     *  @return true if elements were added otherwise false     **/    public boolean addDocumentElements( StructuredDocument adv ) {        Iterator eachParam = getServiceParamsEntrySet().iterator();                if( !eachParam.hasNext() )            return false;                while( eachParam.hasNext() ) {            Map.Entry anEntry = (Map.Entry) eachParam.next();            ID anID = (ID) anEntry.getKey();            StructuredDocument aDoc = (StructuredDocument) anEntry.getValue();                        Element s = adv.createElement(SVC_TAG);            adv.appendChild(s);                        Element e = adv.createElement(MCID_TAG, anID.toString());            s.appendChild(e);                        StructuredDocumentUtils.copyElements(adv, s, aDoc, PARAM_TAG);        }                return true;    }    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久99久久精品国产片果冻 | 欧美在线三级电影| 成人av网址在线观看| 国产成人午夜精品5599| 国产一区二区调教| 美女任你摸久久| 精品一二线国产| 国产真实乱子伦精品视频| 国产一区美女在线| 成人午夜在线免费| av福利精品导航| 日韩亚洲欧美中文三级| 欧美亚洲日本国产| 欧美性xxxxxxxx| 91精品黄色片免费大全| 日韩一级二级三级| 日韩免费性生活视频播放| 欧美成人一区二区三区片免费| 精品国产乱码久久久久久久| 久久久三级国产网站| 国产精品全国免费观看高清| 亚洲免费观看高清完整版在线观看熊| 亚洲午夜激情网站| 奇米777欧美一区二区| 激情都市一区二区| 国产露脸91国语对白| 福利电影一区二区| 99久久免费国产| 欧美色涩在线第一页| 日韩精品最新网址| 中文字幕第一页久久| 一区二区三区四区蜜桃| 奇米影视一区二区三区| 国产成人自拍高清视频在线免费播放| 99精品在线观看视频| 在线播放一区二区三区| 久久先锋影音av| 亚洲免费毛片网站| 伦理电影国产精品| 91亚洲精品乱码久久久久久蜜桃| 欧美精品第一页| 国产欧美日韩综合精品一区二区| 一区二区三区四区乱视频| 看片的网站亚洲| 99视频精品在线| 91精品婷婷国产综合久久性色 | 国产精品久久久久永久免费观看| 亚洲尤物视频在线| 精品午夜久久福利影院| 色噜噜狠狠色综合中国| 欧美大片国产精品| 亚洲一区二区三区自拍| 国产精品99久久久久久宅男| 91国偷自产一区二区使用方法| 欧美精品一区二区三区久久久 | 91在线精品秘密一区二区| 欧美日韩国产天堂| 日本一区免费视频| 奇米777欧美一区二区| 色综合天天狠狠| 久久久亚洲综合| 日产国产欧美视频一区精品| 99re这里只有精品6| 久久婷婷国产综合精品青草| 亚洲bt欧美bt精品777| 99v久久综合狠狠综合久久| 欧美成人女星排名| 亚洲成人动漫精品| 91在线视频免费91| 欧美国产97人人爽人人喊| 美国三级日本三级久久99 | 亚洲日本在线a| 成a人片亚洲日本久久| 精品国产污污免费网站入口| 午夜精品爽啪视频| 色呦呦网站一区| 国产欧美久久久精品影院| 久久爱另类一区二区小说| 69av一区二区三区| 依依成人综合视频| 91亚洲午夜精品久久久久久| 国产人久久人人人人爽| 国产在线视频精品一区| 日韩免费视频一区二区| 日韩精品乱码免费| 欧美日韩一级二级三级| 一区二区成人在线观看| 91啪在线观看| 综合av第一页| heyzo一本久久综合| 国产欧美日韩在线看| 国产一区二区h| 精品国产伦一区二区三区观看方式| 亚洲成人激情av| 欧美日韩情趣电影| 亚洲国产视频一区二区| 色婷婷综合久久久中文一区二区 | 国产精品超碰97尤物18| 国产激情一区二区三区| 久久蜜桃av一区精品变态类天堂| 九一九一国产精品| 精品国产一区a| 国产激情一区二区三区| 欧美激情中文不卡| 99久久精品免费看| 亚洲视频免费观看| 91免费在线看| 亚洲国产精品久久不卡毛片 | 国产欧美精品区一区二区三区| 国产乱子轮精品视频| 国产欧美精品一区| 91蜜桃免费观看视频| 亚洲美腿欧美偷拍| 欧美三级日韩三级| 日本午夜一区二区| 久久婷婷成人综合色| 不卡欧美aaaaa| 亚洲精品久久嫩草网站秘色| 欧美性极品少妇| 日韩福利电影在线| 久久久99免费| 91看片淫黄大片一级在线观看| 亚洲欧美在线aaa| 欧洲精品中文字幕| 青青青爽久久午夜综合久久午夜 | 日韩精品福利网| 精品久久久久久最新网址| 国产成人综合在线| 一区二区三区小说| 欧美一级理论片| 国产成人丝袜美腿| 亚洲综合色在线| 日韩欧美另类在线| 菠萝蜜视频在线观看一区| 一级做a爱片久久| 日韩精品一区二区三区三区免费| 国产曰批免费观看久久久| 亚洲女同女同女同女同女同69| 欧美在线播放高清精品| 国内欧美视频一区二区| 日韩码欧中文字| 91精品国产福利| 国产成人精品网址| 亚洲18色成人| 国产精品麻豆99久久久久久| 欧美三级三级三级爽爽爽| 韩国成人精品a∨在线观看| 亚洲精品国产精华液| 日韩亚洲欧美高清| 91捆绑美女网站| 激情综合一区二区三区| 依依成人精品视频| 精品国产91洋老外米糕| 日本精品一级二级| 国产在线播精品第三| 亚洲午夜久久久久中文字幕久| 国产午夜精品一区二区| 欧美少妇xxx| 成人av电影在线| 老司机精品视频在线| 一区二区三区在线视频免费| 久久久精品天堂| 欧美一区二区三区白人| 97国产精品videossex| 看电影不卡的网站| 亚洲国产美女搞黄色| 国产精品日日摸夜夜摸av| 日韩欧美在线影院| 91国产免费看| 暴力调教一区二区三区| 久草在线在线精品观看| 亚洲成人激情社区| 伊人婷婷欧美激情| 国产精品久久免费看| 精品成a人在线观看| 欧美一区二区在线免费观看| 日本高清视频一区二区| 不卡的电视剧免费网站有什么| 麻豆91免费看| 亚洲不卡一区二区三区| 亚洲黄色小说网站| 一色桃子久久精品亚洲| 久久久久88色偷偷免费| 日韩欧美你懂的| 日韩午夜电影在线观看| 精品视频一区二区不卡| 色婷婷综合激情| 99久久99久久综合| zzijzzij亚洲日本少妇熟睡| 国产呦精品一区二区三区网站| 蜜桃视频一区二区| 日本成人在线看| 视频精品一区二区| 亚洲综合色在线| 亚洲在线视频网站| 亚洲综合图片区| 亚洲国产欧美一区二区三区丁香婷| 亚洲欧美日本韩国| 曰韩精品一区二区| 亚洲在线视频免费观看|