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

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

?? blockingmessenger.java

?? jxta平臺的開發包
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * * $Id: BlockingMessenger.java,v 1.13 2006/04/18 00:51:27 bondolo Exp $ * * Copyright (c) 2004 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. */package net.jxta.impl.endpoint;import java.util.Timer;import java.util.TimerTask;import java.io.IOException;import java.io.InterruptedIOException;import org.apache.log4j.Level;import org.apache.log4j.Logger;import net.jxta.endpoint.AbstractMessenger;import net.jxta.endpoint.ChannelMessenger;import net.jxta.endpoint.EndpointAddress;import net.jxta.endpoint.Message;import net.jxta.endpoint.Messenger;import net.jxta.endpoint.MessengerState;import net.jxta.endpoint.OutgoingMessageEvent;import net.jxta.peergroup.PeerGroupID;import net.jxta.util.SimpleSelectable;import net.jxta.impl.util.TimeUtils;import net.jxta.impl.util.TimerThreadNamer;/** * This class is a near-drop-in replacement for the previous BlockingMessenger class. * To subclassers (that is, currently, transports) the only difference is that some * overloaded methods have a different name (class hierarchy reasons made it impossible * to preserve the names without forcing an API change for applications). * * The other difference which is not API visible, is that it implements the * standard MessengerState behaviour and semantics required by the changes in the endpoint framework. * * This the only base messenger class meant to be extended by outside code that is in the impl tree. The * reason being that what it replaces was there already and that new code should not become dependant upon it. * **/public abstract class BlockingMessenger extends AbstractMessenger {    /**     *  Log4J Logger     **/    private final static transient Logger LOG = Logger.getLogger(BlockingMessenger.class.getName());    /**     * The self destruct timer.     *     * <p/>When a messenger has become idle, it is closed. As a side effect, it      * makes the owning canonical messenger, if any, subject to removal if it is      * otherwise unreferenced.     **/    private final static transient Timer timer = new Timer( "BlockingMessenger self destruct timer", true );    /*     * Actions that we defer to after returning from event methods. In other words, they cannot be done with the lock held, or     * they require calling more event methods.  Because this messenger can take only one message at a time (saturated while     * sending), actions do not cascade much. Start can lead to connect if the sending fails, but, because we always fail to     * connect, connect will not lead to start. As a result we can get away with performing deferred actions recursively. That     * simplifies the code.     */    /**     * No action deferred.     **/    private static final int ACTION_NONE = 0;    /**     * Must send the current message.     **/    private static final int ACTION_SEND = 1;    /**     * Must report failure to connect.     **/    private static final int ACTION_CONNECT = 2;    /**     * The outstanding message.     **/    private Message currentMessage = null;    /**     * The serviceName override for that message.     **/    private String currentService = null;    /**     * The serviceParam override for that message.     */    private String currentParam = null;    /**     * The exception that caused that message to not be sent.     **/    private Throwable currentThrowable = null;    /**     * true if we have deliberately closed our one message input queue.     **/    private boolean inputClosed = false;    /**     * Need to know which group this transport lives in, so that we can suppress        channel redirection when in the same group. This is currently the norm.     **/    private final PeerGroupID homeGroupID;    /**     * The current deferred action.     **/    private int deferredAction = ACTION_NONE;    /**     * Reference to owning object. This is there so that the owning object is not subject to garbage collection     * unless this object here becomes itself unreferenced. That happens when the self destruct timer closed it.     **/    private Object owner = null;    /**     * The timer task watching over our self destruction requirement.     **/    private final TimerTask selfDestructTask;    /**     * State lock and engine.     **/    private final BlockingMessengerState stateMachine = new BlockingMessengerState();    /**     * legacy artefact: transports need to believe the messenger is not yet closed in order to actually close it.     * So we lie to them just while we run their closeImpl method so that they do not see that the messenger is     * officially closed.     **/    private boolean lieToOldTransports = false;    /**     * Our statemachine implementation; just connects the standard AbstractMessengerState action methods to     * this object.     **/    private class BlockingMessengerState extends MessengerState {        protected BlockingMessengerState() {            super(true);        }        /*         * The required action methods.         */        /**         *  {@inheritDoc}         */        protected void connectAction() {            deferredAction = ACTION_CONNECT;        }        /**         *  {@inheritDoc}         */        protected void startAction() {            deferredAction = ACTION_SEND;        }        /**         *  {@inheritDoc}         */        protected void closeInputAction() {            // we're synchonized here. (invoked from stateMachine).            inputClosed = true;        }        /**         *  {@inheritDoc}         */        protected void closeOutputAction() {            // This will break the cnx; thereby causing a down event if we have a send in progress.            // If the cnx does not break before the current message is sent, then the message will be sent successfully,            // resulting in an idle event. Either of these events is enough to complete the shutdown process.            lieToOldTransports = true;            closeImpl();            lieToOldTransports = false;            // Disconnect from the timer.            if (selfDestructTask != null) {                selfDestructTask.cancel();            }        }        // This is a synchronous action. No synchronization needed: we're already synchronized, here.        // There's a subtlety here: we do not clear the current message. We let sendMessageB or sendMessageN        // deal with it, so that they can handle the status reporting each in their own way. So basically, all we        // do is to set a reason for that message to fail in case we are shutdown from the outside and that message        // is not sent yet. As long as there is a current message, it is guaranteed that there is a thread        // in charge of reporting its status. It is also guaranteed that when failAll is called, the input is        // already closed, and so, we have no obligation of making room for future messages immediately.        // All this aggravation is so that we do not have to create one context wrapper for each message just so        // that we can associate it with its result. Instead we use our single msg and single status model        // throughout.        protected void failAllAction() {            if (currentMessage == null) {                return;            }            if (currentThrowable == null) {                currentThrowable = new IOException("Messenger unexpectedly closed");            }        }    }    /**     * The implementation of channel messenger that getChannelMessenger returns:     * All it does is address rewritting. Even close() is forwarded to the shared messenger.     * The reason is that BlockingMessengers are not really shared; they're transitional     * entities used directly by CanonicalMessenger. GetChannel is used only to provide address     * rewritting when we pass a blocking messenger directly to incoming messenger listeners...this     * practice is to be removed in the future, in favor of making incoming messengers full-featured     * async messengers that can be shared.     **/    private final class BlockingMessengerChannel extends ChannelMessenger {        public BlockingMessengerChannel( EndpointAddress baseAddress, PeerGroupID redirection,                                         String origService, String origServiceParam ) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品视频免费观看| 成人97人人超碰人人99| 欧美日本免费一区二区三区| 亚洲欧美日韩国产另类专区 | 亚洲电影视频在线| 欧美在线小视频| 婷婷开心久久网| 精品久久人人做人人爽| 国模套图日韩精品一区二区| 久久综合中文字幕| 成人毛片在线观看| 亚洲一区在线免费观看| 91精品福利在线一区二区三区 | 亚洲美女在线国产| 在线观看成人小视频| 免费观看日韩av| 久久久久久久网| 99精品国产热久久91蜜凸| 夜夜精品浪潮av一区二区三区| 欧美剧情片在线观看| 看电视剧不卡顿的网站| 中日韩av电影| 欧美在线999| 国内精品视频666| 日韩理论片在线| 欧美第一区第二区| 91麻豆国产精品久久| 蜜臀av性久久久久蜜臀aⅴ四虎 | 欧美巨大另类极品videosbest| 日本不卡一二三| 亚洲婷婷在线视频| 91精品欧美福利在线观看| 国产99久久精品| 香蕉久久夜色精品国产使用方法| 久久一夜天堂av一区二区三区 | 欧美性色黄大片手机版| 麻豆极品一区二区三区| 日韩毛片精品高清免费| 日韩精品一区二区三区在线| 99久久免费视频.com| 久久精品久久综合| 亚洲综合在线电影| 中文字幕不卡的av| 欧美大片日本大片免费观看| 欧美中文字幕一二三区视频| 粉嫩一区二区三区性色av| 肉丝袜脚交视频一区二区| 国产精品久久毛片a| 欧美大胆一级视频| 欧美伦理电影网| 91同城在线观看| 国产精品996| 老司机精品视频线观看86| 亚洲成人1区2区| 亚洲精品伦理在线| 国产精品护士白丝一区av| 久久久国产综合精品女国产盗摄| 3atv一区二区三区| 欧美日韩一区久久| 日本久久电影网| 97se亚洲国产综合自在线不卡| 国产福利一区二区三区视频| 麻豆成人免费电影| 日韩1区2区3区| 亚洲动漫第一页| 一区二区三区日韩精品| 最新日韩av在线| 中国色在线观看另类| 国产丝袜美腿一区二区三区| 久久久精品欧美丰满| 26uuu国产日韩综合| 欧美不卡在线视频| 精品国产1区二区| 精品国产髙清在线看国产毛片| 91精品国产手机| 欧美妇女性影城| 91精品国产色综合久久久蜜香臀| 欧美嫩在线观看| 欧美一区二区三区在| 欧美一级二级在线观看| 欧美日韩国产另类一区| 欧美日韩在线免费视频| 欧美美女bb生活片| 欧美一二三四区在线| 精品成人在线观看| 国产亚洲精品aa| 国产精品三级电影| 亚洲欧洲国产日本综合| 亚洲图片你懂的| 一卡二卡三卡日韩欧美| 亚洲午夜国产一区99re久久| 偷窥少妇高潮呻吟av久久免费| 亚洲成年人影院| 久久黄色级2电影| 国产精品123| 91老师国产黑色丝袜在线| 在线观看视频一区二区欧美日韩| 欧美日韩一区高清| 91精品国产综合久久婷婷香蕉 | 三级在线观看一区二区| 蜜臀av性久久久久蜜臀aⅴ| 久久精品国产精品青草| 成人中文字幕在线| 欧美在线观看一区| 91精品国产日韩91久久久久久| 精品人在线二区三区| 国产欧美日韩综合精品一区二区| 中文字幕字幕中文在线中不卡视频| 一区二区三区国产| 日韩不卡一区二区| 成人性生交大片免费看在线播放| 色综合激情久久| 欧美一区二区人人喊爽| 国产精品热久久久久夜色精品三区| 亚洲免费伊人电影| 激情综合色播激情啊| 91蜜桃视频在线| 日韩三区在线观看| 日韩理论片一区二区| 蜜臀av一区二区| 色哟哟国产精品免费观看| 欧美精品一区在线观看| 亚洲欧美国产77777| 黄网站免费久久| 91国内精品野花午夜精品| 欧美精品一区二区高清在线观看| 中文字幕一区二区三区av| 日韩不卡在线观看日韩不卡视频| 成人av网站在线观看免费| 在线播放中文字幕一区| 国产精品久久久久桃色tv| 日韩黄色小视频| 一本大道av一区二区在线播放| 精品电影一区二区| 水蜜桃久久夜色精品一区的特点 | 精品精品欲导航| 亚洲男人的天堂网| 国产成人午夜电影网| 欧美一级日韩不卡播放免费| 中文字幕日韩精品一区| 国产一区二区网址| 欧美一区二区三区婷婷月色 | 国产目拍亚洲精品99久久精品| 首页综合国产亚洲丝袜| 色诱视频网站一区| 成人欧美一区二区三区| 国产福利91精品| 精品国产一区二区三区不卡| 午夜电影一区二区| 91成人在线观看喷潮| 亚洲天堂免费在线观看视频| 国产一二三精品| 精品国产三级电影在线观看| 日韩中文字幕区一区有砖一区 | 久久亚洲精品小早川怜子| 免费精品视频在线| 7777精品伊人久久久大香线蕉完整版 | 国产精品污www在线观看| 国产一区中文字幕| 日韩精品在线一区二区| 蜜桃免费网站一区二区三区| 欧美一区日韩一区| 亚洲成av人片在线| 欧美又粗又大又爽| 亚洲乱码中文字幕| 一本大道av伊人久久综合| 日韩码欧中文字| 91在线porny国产在线看| 国产精品色眯眯| www.日韩大片| 亚洲视频免费在线| 色婷婷av久久久久久久| 亚洲精品国产第一综合99久久 | 午夜精品国产更新| 91精品在线免费| 午夜日韩在线观看| 日韩一区二区三区在线| 男女男精品视频网| 久久久五月婷婷| 国产成人免费9x9x人网站视频| 久久精品一区二区三区四区| 国产精品亚洲第一区在线暖暖韩国| 久久久久国产一区二区三区四区 | 成人av一区二区三区| 亚洲精品日产精品乱码不卡| 欧美视频三区在线播放| 喷水一区二区三区| 久久久久久久久久久久久久久99 | 成人av电影在线观看| 亚洲精品你懂的| 91精品国产综合久久精品| 狂野欧美性猛交blacked| 国产性做久久久久久| 色天天综合色天天久久| 日本特黄久久久高潮| 欧美国产1区2区| 在线观看日韩高清av| 麻豆精品久久精品色综合| 国产精品视频你懂的| 欧美日韩中字一区|