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

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

?? wireformatmessagefactory.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: WireFormatMessageFactory.java,v 1.2 2005/11/21 19:50:58 bondolo Exp $ */package net.jxta.endpoint;import java.io.InputStream;import java.util.Hashtable;import java.util.Map;import java.io.IOException;import java.util.MissingResourceException;import org.apache.log4j.Logger;import org.apache.log4j.Level;import net.jxta.document.MimeMediaType;import net.jxta.endpoint.Message;import net.jxta.util.ClassFactory;/** * This class is a class factory for Wire Format Messages. This class abstracts * The implementation of Wire Format Messages and allows for construction based * on the MimeType of InputStreams. * * <p>The WireFormatMessageFactory extends the ClassFactory to register the * various Message wire format implementations into a static hastable. The * factory is called with the Mime type requested to create the corresponding * Wire Format type. * *  @see net.jxta.endpoint.Message *  @see net.jxta.endpoint.WireFormatMessage *  @see net.jxta.util.ClassFactory *  @see net.jxta.document.MimeMediaType * */public final class WireFormatMessageFactory extends ClassFactory {    /**     *  Log4J categorgy     **/    private static final Logger LOG = Logger.getLogger( WireFormatMessageFactory.class.getName());        /**     *  The mime media type of prefered/default wire format.      **/    public static final MimeMediaType DEFAULT_WIRE_MIME = new MimeMediaType("application/x-jxta-msg").intern();         /**     *  Interface for instantiators of wire format messages.     **/    public interface Instantiator {                /**         *  Returns the list of mime types supported by this serialization. All of         *  mimetypes in this list should have no mime type parameters.         **/        public MimeMediaType [] getSupportedMimeTypes();                /**         *  Returns a list of the content encodings supported by this serialization.         *  These content encodings apply to both the overall coding of the message         *  and to the encodig of individual elements.         **/        public MimeMediaType [] getSupportedContentEncodings();                /**         *  Create a WireFormatMessage from an abstract message. It is an error         * (though lazily enforced) tomodify the abstract message during the         *  lifetime of the WireFormatMessage.         *         *  @param msg  the message for which a serialization is desired.         *  @param type the the serialization form desired. This can include         *  mime parameters to control options.         *  @param preferedContentEncoding An array of acceptable message encodings         *  in descending order of preference. any or none of these encoding options         *  may be used. May be null for unencoded messages.         *  @return a proxy object for the abstract message which is a         *  representation of the message in its serialized form.         **/        public WireFormatMessage toWire( Message msg, MimeMediaType type, MimeMediaType [] preferedContentEncoding );                /**         *  Create an abstract message from a serialization.         *         *  @param is  The message stream. Message serializations must either use         *  internal data or EOF to determine the length of the stream.         *  @param type Declared message type of the stream including any optional         *  configuration parameters.         *  @param contentEncoding Content encoding (including optional parameters)         * which has been applied to the message. May be null for unencoded messages.         *  @return a proxy object for the abstract message which is a         *  representation of the message in its serialized form.         **/        public Message fromWire( InputStream is, MimeMediaType type, MimeMediaType contentEncoding ) throws IOException;    };        /**     *  This is the map of mime-types and constructors used by     *  <CODE>newStructuredDocument</CODE>.     **/    private Map  encodings = new Hashtable();        /**     *  If true then the pre-defined set of StructuredDocument sub-classes has     *  been registered from the property containing them.     **/    private volatile boolean loadedProperty = false;        /**     *  This class is in fact a singleton. This is the instance that backs the     *  static methods.     **/    private static WireFormatMessageFactory factory = new WireFormatMessageFactory();        /**     *  Private constructor. This class is not meant to be instantiated except     *  by itself.     *     **/    private WireFormatMessageFactory() {    };        /**     *  Registers the pre-defined set of StructuredDocument sub-classes so that     *  this factory can construct them.     *     *  @return true if at least one of the StructuredDocument sub-classes could     *  be registered otherwise false.     **/    private synchronized boolean doLoadProperty() {        if( loadedProperty )            return true;                try {            return registerFromResources( "net.jxta.impl.config",            "MsgWireFmtsInstanceTypes" );        }        catch ( MissingResourceException notFound ) {            if (LOG.isEnabledFor(Level.WARN))                LOG.warn( "Could not find net.jxta.impl.config properties file!" );            return false;        }    }        /**     *  {@inheritDoc}     **/    protected Map getAssocTable() {        return encodings;    }        /**     *  {@inheritDoc}     **/    public Class getClassOfInstantiators() {        // our key is the doctype names.        return Instantiator.class;    }        /**     *  {@inheritDoc}     **/    public Class getClassForKey() {        // our key is the mime types.        return String.class;    }        /**     *  {@inheritDoc}     **/    protected boolean registerAssoc( String className ) {        boolean registeredSomething = false;                if ( LOG.isEnabledFor(Level.DEBUG) )            LOG.debug( "Registering : " + className );                try {            Class msgClass = Class.forName( className );                        Instantiator instantiator = (Instantiator)            (msgClass.getField("INSTANTIATOR").get(null));                        MimeMediaType [] mimeTypes = instantiator.getSupportedMimeTypes();                        for( int eachType = 0; eachType < mimeTypes.length; eachType++ ) {                if ( LOG.isEnabledFor(Level.DEBUG) )                    LOG.debug( "   Registering Type : " + mimeTypes[eachType].getMimeMediaType() );                                registeredSomething |=                registerInstantiator( mimeTypes[eachType], instantiator );            }        }        catch( Exception all ) {            if (LOG.isEnabledFor(Level.WARN))                LOG.warn( "Failed to register '" + className + "'", all );        }                return registeredSomething;    }        /**     * Register an instantiator object a mime-type of documents to be     * constructed.     *     * @param mimetype   the mime-type associated.     * @param instantiator the instantiator that wants to be registered..     * @return boolean true   if the instantiator for this mime-type is now     * registered. If there was already an instantiator this mime-type then     * false will be returned.     * @throws SecurityException   there were permission problems registering     *  the instantiator.     **/    public static boolean registerInstantiator(MimeMediaType mimetype, Instantiator instantiator ) {        boolean registered = factory.registerAssoc( mimetype.getMimeMediaType(),        instantiator );                return registered;    }        /**     * Constructs an instance of {@link WireFormatMessage} matching the type     * specified by the <CODE>type</CODE> parameter.     *     *  @param msg  the message for which a serialization is desired.     *  @param type the the serialization form desired. This can include     *  mime parameters to control options.     *  @param preferedEncodings An array of acceptable message encodings     *  in descending order of preference. any or none of these encoding options     *  may be used. May be null for unencoded messages.     *  @return a proxy object for the abstract message which is a     *  representation of the message in its serialized form.     **/    public static WireFormatMessage toWire( Message msg, MimeMediaType type, MimeMediaType [] preferedEncodings ) {        if( !factory.loadedProperty ) {            factory.loadedProperty = factory.doLoadProperty();        }                Instantiator instantiator =        (Instantiator) factory.getInstantiator( type.getMimeMediaType() );                return instantiator.toWire( msg, type, preferedEncodings );    }        /**     * Constructs an instance of <CODE>Message</CODE> frommatching the type     * specified by the <CODE>type</CODE> parameter.     *     *  @param is  The message stream. Message serializations must either use     *  internal data or EOF to determine the length of the stream.     *  @param type Declared message type of the stream including any optional     *  configuration parameters.     *  @param contentEncoding Content encoding (including optional parameters)     * which has been applied to the message. May be null for unencoded messages.     *    @return the new abstract message.     **/    public static Message fromWire( InputStream is, MimeMediaType type, MimeMediaType contentEncoding ) throws IOException {        if( !factory.loadedProperty ) {            factory.loadedProperty = factory.doLoadProperty();        }                Instantiator instantiator = (Instantiator) factory.getInstantiator( type.getMimeMediaType() );                return instantiator.fromWire( is, type, contentEncoding );    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产3级a| 一区二区三区.www| 精品国产乱码久久久久久闺蜜 | 精品粉嫩超白一线天av| 欧美一区中文字幕| 欧美一区三区二区| 日韩一区二区三区电影在线观看| 717成人午夜免费福利电影| 7777精品伊人久久久大香线蕉完整版 | 精品国产乱码久久久久久夜甘婷婷 | 国产精品一二一区| 免费av成人在线| 精品一区二区三区蜜桃| 美日韩一区二区| 美女视频一区二区| 国产在线精品一区在线观看麻豆| 久久国产精品免费| 国产福利一区二区三区视频在线| 国内久久精品视频| 国产自产高清不卡| 国产精品77777| 粉嫩一区二区三区性色av| av影院午夜一区| 91一区一区三区| 欧美丝袜自拍制服另类| 欧美午夜不卡视频| 日韩欧美中文字幕公布| 日韩三级伦理片妻子的秘密按摩| 在线观看一区二区精品视频| 91精品国产一区二区三区香蕉| 91麻豆精品国产91| 2021久久国产精品不只是精品| 欧美tickle裸体挠脚心vk| 国产日韩av一区二区| 国产精品视频一区二区三区不卡| 2022国产精品视频| 一区二区成人在线| 天堂在线亚洲视频| 国产精品一区2区| 9i看片成人免费高清| 欧美色图激情小说| 日韩欧美在线不卡| 日韩精品一区二区三区在线播放| 久久久久久久久岛国免费| 中文字幕av一区二区三区免费看| 亚洲人成网站精品片在线观看| 污片在线观看一区二区| 精品一区二区三区在线视频| 极品少妇xxxx精品少妇偷拍| 91亚洲永久精品| 88在线观看91蜜桃国自产| 国产精品全国免费观看高清| 亚洲激情网站免费观看| 久久国产欧美日韩精品| 成人性生交大片免费看视频在线| 欧美精品三级日韩久久| 久久久久久久久免费| 亚洲成a人v欧美综合天堂 | 欧美在线观看视频在线| 久久夜色精品一区| 亚洲激情图片qvod| 国产精品一区二区果冻传媒| 欧美亚洲国产一区二区三区| 久久久亚洲欧洲日产国码αv| 日韩理论片中文av| 精品影院一区二区久久久| 色综合天天做天天爱| 日韩精品专区在线影院重磅| 亚洲黄色性网站| 国产精品538一区二区在线| 欧美日韩国产美| 中文av一区二区| 国产麻豆精品theporn| 91福利在线免费观看| 国产精品免费av| 日韩成人精品在线| 粉嫩av一区二区三区| 精品少妇一区二区三区视频免付费| 最新热久久免费视频| 国模娜娜一区二区三区| 欧美日韩一区二区三区免费看| 欧美高清在线一区二区| 青青草97国产精品免费观看| 欧美日韩mp4| 亚洲欧洲日本在线| 国产成人av福利| 日韩一区二区三区免费观看| 亚洲一二三区视频在线观看| 成人免费看视频| 欧美久久高跟鞋激| 亚洲男人天堂av网| 成人久久视频在线观看| 日韩精品中文字幕在线一区| 亚洲国产aⅴ成人精品无吗| 国产精品白丝jk白祙喷水网站| 日韩欧美成人一区| 亚洲国产日韩a在线播放| 欧美亚洲动漫制服丝袜| 国产精品萝li| 丰满亚洲少妇av| 精品国产一区a| 国模无码大尺度一区二区三区| 欧美丰满嫩嫩电影| 国产精品久久一级| 国产馆精品极品| 精品国产一二三| 国产精品白丝av| 久久免费精品国产久精品久久久久 | 亚洲制服丝袜一区| 波多野结衣91| 亚洲精品一区二区三区四区高清| 五月天久久比比资源色| 国产.精品.日韩.另类.中文.在线.播放| 欧美精品一区男女天堂| 美国精品在线观看| 久久精品一区四区| 国内精品久久久久影院色 | 欧美综合在线视频| 国产精品成人一区二区三区夜夜夜| 韩国三级电影一区二区| 3d成人h动漫网站入口| 亚洲第一二三四区| 99麻豆久久久国产精品免费| 亚洲欧美aⅴ...| 91久久精品一区二区| 午夜精品视频一区| 91精品福利在线一区二区三区| 精品在线观看视频| 久久综合九色欧美综合狠狠| 成人精品鲁一区一区二区| 国产网红主播福利一区二区| 97久久超碰国产精品| 亚洲黄色av一区| 日韩女同互慰一区二区| 蜜桃久久久久久久| 国产精品久久久久影院| 99国产精品99久久久久久| 性欧美疯狂xxxxbbbb| 欧美高清性hdvideosex| 国产成人亚洲综合a∨婷婷| 国产性天天综合网| 91视频免费观看| 一区二区激情小说| 91精品国产美女浴室洗澡无遮挡| 奇米影视在线99精品| 欧美tickling挠脚心丨vk| 国产在线视频一区二区| 国产精品美女久久久久久久久| 国产精一区二区三区| 国产精品天干天干在观线| 在线观看免费成人| 日本午夜一区二区| 中文一区二区在线观看| av亚洲精华国产精华| 丝袜美腿亚洲一区| 欧美疯狂性受xxxxx喷水图片| 久久精品久久精品| 国产精品美女www爽爽爽| 色婷婷国产精品| 一区二区三区免费| 欧美一区二区三区不卡| 色噜噜狠狠成人中文综合 | 色菇凉天天综合网| 日韩电影在线免费看| 亚洲三级在线观看| 日韩美女视频在线| 欧美日韩国产在线观看| 欧美aaaaaa午夜精品| 伊人婷婷欧美激情| 91.xcao| 色哟哟在线观看一区二区三区| 亚洲国产精品久久一线不卡| 国产欧美精品一区二区三区四区| 99久久伊人精品| 国产一区二区免费看| 中文字幕色av一区二区三区| 精品久久国产老人久久综合| 成人午夜视频网站| 激情小说欧美图片| 亚洲美女视频一区| 国产欧美日韩在线| 日韩精品成人一区二区三区| 国产精品麻豆99久久久久久| 精品国产亚洲在线| 欧美日韩一区视频| 色综合咪咪久久| 国产露脸91国语对白| 久久国产乱子精品免费女| 一区二区三区蜜桃| 亚洲欧美日韩中文播放| www久久精品| 日韩欧美123| 7777精品伊人久久久大香线蕉| 欧洲一区二区三区在线| 成人的网站免费观看| 懂色av一区二区三区蜜臀| 蓝色福利精品导航| 蜜臀久久久久久久| 无码av中文一区二区三区桃花岛| 偷窥少妇高潮呻吟av久久免费|