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

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

?? remoteserverconnection.java

?? 一個java方面的消息訂閱發送的源碼
?? JAVA
字號:
/**
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided
 * that the following conditions are met:
 *
 * 1. Redistributions of source code must retain copyright
 *    statements and notices.  Redistributions must also contain a
 *    copy of this document.
 *
 * 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 name "Exolab" must not be used to endorse or promote
 *    products derived from this Software without prior written
 *    permission of Exoffice Technologies.  For written permission,
 *    please contact info@exolab.org.
 *
 * 4. Products derived from this Software may not be called "Exolab"
 *    nor may "Exolab" appear in their names without prior written
 *    permission of Exoffice Technologies. Exolab is a registered
 *    trademark of Exoffice Technologies.
 *
 * 5. Due credit should be given to the Exolab Project
 *    (http://www.exolab.org/).
 *
 * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
 * ``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
 * EXOFFICE TECHNOLOGIES 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.
 *
 * Copyright 2004-2005 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: RemoteServerConnection.java,v 1.2 2005/06/13 23:05:45 tanderson Exp $
 */
package org.exolab.jms.server.net;

import java.rmi.RemoteException;
import java.rmi.server.ExportException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.jms.InvalidClientIDException;
import javax.jms.JMSException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.exolab.jms.net.connector.Caller;
import org.exolab.jms.net.connector.CallerListener;
import org.exolab.jms.net.orb.ORB;
import org.exolab.jms.net.orb.UnicastObject;
import org.exolab.jms.server.ServerConnection;
import org.exolab.jms.server.ServerSession;


/**
 * Implementation of the {@link ServerConnection{ interface which wraps an
 * {@link ServerConnection} to make it remotable.
 *
 * @author <a href="mailto:tma@netspace.net.au">Tim Anderson</a>
 * @version $Revision: 1.2 $ $Date: 2005/06/13 23:05:45 $
 * @see JmsServerConnection
 */
public class RemoteServerConnection
        extends UnicastObject
        implements ServerConnection, CallerListener {

    /**
     * The connection to delegate calls to.
     */
    private ServerConnection _connection;

    /**
     * The URI of the remote caller.
     */
    private final String _uri;

    /**
     * The set of {@link RemoteServerSession} instances created by this.
     */
    private List _sessions = Collections.synchronizedList(new ArrayList());

    /**
     * The logger.
     */
    private static final Log _log
            = LogFactory.getLog(RemoteServerConnection.class);


    /**
     * Construct a new <code>RemoteServerConnection</code>.
     *
     * @param connection the connection to delegate calls to
     * @param orb        the ORB to export this with
     * @throws RemoteException if this can't be exported
     */
    public RemoteServerConnection(ServerConnection connection, ORB orb)
            throws RemoteException {
        super(orb, null, true);
        if (connection == null) {
            throw new IllegalArgumentException("Argument 'connection' is null");
        }
        Caller caller = orb.getCaller();
        if (caller == null) {
            throw new ExportException("Can't determine remote caller");
        }
        _uri = caller.getRemoteURI().toString();
        orb.addCallerListener(_uri, this);
        _connection = connection;
    }

    /**
     * Returns the connection identifier.
     *
     * @return the connection identifier
     * @throws JMSException for any JMS error
     */
    public long getConnectionId() throws JMSException {
        return _connection.getConnectionId();
    }

    /**
     * Returns the client identifier.
     *
     * @return the client identifier
     * @throws JMSException for any JMS error
     */
    public String getClientID() throws JMSException {
        return _connection.getClientID();
    }

    /**
     * Sets the client identifier for this connection.
     *
     * @param clientID the unique client identifier
     * @throws JMSException             if the JMS provider fails to set the
     *                                  client ID for this connection due to
     *                                  some internal error.
     * @throws InvalidClientIDException if the JMS client specifies an invalid
     *                                  or duplicate client ID.
     * @throws IllegalStateException    if the JMS client attempts to set a
     *                                  connection's client ID at the wrong time
     *                                  or when it has been administratively
     *                                  configured.
     */
    public void setClientID(String clientID) throws JMSException {
        _connection.setClientID(clientID);
    }

    /**
     * Create a new session.
     *
     * @param transacted      indicates whether the session is transacted
     * @param acknowledgeMode indicates whether the consumer or the client will
     *                        acknowledge any messages it receives; ignored if
     *                        the session is transacted. Legal values are
     *                        <code>Session.AUTO_ACKNOWLEDGE</code>,
     *                        <code>Session.CLIENT_ACKNOWLEDGE</code>, and
     *                        <code>Session.DUPS_OK_ACKNOWLEDGE</code>.
     * @return a newly created session
     * @throws JMSException for any JMS error
     */
    public ServerSession createSession(int acknowledgeMode, boolean transacted)
            throws JMSException {
        ServerSession session = _connection.createSession(acknowledgeMode,
                                                          transacted);
        RemoteServerSession remote = null;
        try {
            remote = new RemoteServerSession(getORB(), this, session);
            _sessions.add(remote);
        } catch (RemoteException exception) {
            throw new JMSException(exception.getMessage());
        }
        return (ServerSession) remote.getProxy();
    }

    /**
     * Closes the connection.
     *
     * @throws JMSException for any JMS error
     */
    public void close() throws JMSException {
        JMSException rethrow = null;
        // Need to catch exceptions and propagate last, to ensure all objects
        // are cleaned up and unexported.

        // Clean up sessions.
        RemoteServerSession[] sessions = (RemoteServerSession[])
                _sessions.toArray(new RemoteServerSession[0]);
        if (sessions.length != 0) {
            // There will only be sessions present if the client has disconnected
            // without closing its connection.
            _log.debug("Cleaning up active sessions");
            for (int i = 0; i < sessions.length; ++i) {
                try {
                    sessions[i].close();
                } catch (JMSException exception) {
                    rethrow = exception;
                    if (_log.isDebugEnabled()) {
                        _log.debug("Exception while cleaning up session",
                                   exception);
                    }
                }
            }
        }
        try {
            _connection.close();
        } finally {
            try {
                getORB().removeCallerListener(_uri, this);
                unexportObject();
            } catch (RemoteException exception) {
                throw new JMSException(exception.getMessage());
            }
        }
        if (rethrow != null) {
            throw rethrow;
        }
    }

    /**
     * Notifies that a caller has been disconnected. This implementation invokes
     * {@link #close}.
     *
     * @param caller the caller that was disconnected
     */
    public void disconnected(Caller caller) {
        if (_log.isDebugEnabled()) {
            _log.debug("Detected disconnection of caller="
                       + caller.getRemoteURI() + ". Cleaning up resources");
        }
        try {
            close();
        } catch (JMSException exception) {
            _log.debug("Failed to clean up resources of caller="
                       + caller.getRemoteURI(), exception);
        }

    }

    /**
     * Notify closure of a session.
     *
     * @param session the closed session
     */
    public void closed(RemoteServerSession session) {
        _sessions.remove(session);
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产精品亚洲综合| 欧美精品777| 日韩不卡一区二区| 午夜欧美一区二区三区在线播放| 樱桃视频在线观看一区| 亚洲精选一二三| 亚洲人吸女人奶水| 一区二区国产盗摄色噜噜| 一区二区三区免费观看| 亚洲免费在线视频| 一区二区三区精品在线观看| 亚洲精品视频免费看| 亚洲精品日韩一| 亚洲小少妇裸体bbw| 天堂久久久久va久久久久| 日本视频一区二区三区| 蜜臀久久99精品久久久久久9| 激情丁香综合五月| 成人深夜在线观看| 欧美色手机在线观看| 欧美一区二区三区视频免费| 久久久久国色av免费看影院| 中文字幕一区二区三区不卡| 亚洲国产美国国产综合一区二区| 青娱乐精品在线视频| 国产福利一区在线| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 久久天堂av综合合色蜜桃网| 欧美国产日韩a欧美在线观看| 亚洲三级久久久| 日日摸夜夜添夜夜添精品视频| 国产在线精品一区二区夜色| 91视频在线观看免费| 欧美成人video| 亚洲日本在线天堂| 国产乱色国产精品免费视频| 一本到高清视频免费精品| 精品国产免费人成在线观看| 亚洲三级在线播放| 黑人巨大精品欧美一区| 在线观看国产日韩| 国产亚洲精品bt天堂精选| 亚洲国产综合人成综合网站| 国产99精品国产| 欧美日韩免费视频| 亚洲欧美一区二区久久| 韩国三级在线一区| 91精品久久久久久久91蜜桃| 中文字幕成人在线观看| 精品一区二区在线免费观看| 欧美在线观看一二区| 亚洲欧美日韩精品久久久久| 男女男精品网站| 91成人国产精品| 国产精品的网站| 国产精品1024| 26uuu久久天堂性欧美| 天涯成人国产亚洲精品一区av| 97久久超碰精品国产| 国产视频一区二区三区在线观看| 日韩极品在线观看| 色婷婷综合久色| 欧美激情一区二区三区不卡| 精品系列免费在线观看| 日韩欧美一区二区不卡| 石原莉奈在线亚洲三区| 精品视频在线视频| 中文天堂在线一区| 风间由美性色一区二区三区| 国产亚洲一区字幕| 国产成人综合在线观看| 国产亚洲福利社区一区| 国产乱码一区二区三区| 久久久影视传媒| 国产永久精品大片wwwapp| 久久亚洲综合av| 国产精品综合二区| 中文字幕高清不卡| 99精品久久99久久久久| 一区二区三区精品在线观看| 久久久91精品国产一区二区精品| 亚洲少妇最新在线视频| 99久久综合狠狠综合久久| 国产精品麻豆视频| 91碰在线视频| 亚洲一区二区三区美女| 在线成人av影院| 久久国产精品无码网站| 久久久久久久av麻豆果冻| 国产精品一二一区| 国产精品传媒视频| 欧美性生活大片视频| 午夜激情一区二区| 26uuu精品一区二区| 成人动漫av在线| 一区二区三区加勒比av| 91精品欧美一区二区三区综合在| 久久99精品国产91久久来源| 久久精品水蜜桃av综合天堂| av在线一区二区| 日韩电影在线免费观看| 久久久www成人免费无遮挡大片| www.亚洲色图.com| 日韩电影在线看| 国产精品久久久久久久久图文区| 色88888久久久久久影院野外| 石原莉奈一区二区三区在线观看 | 色偷偷久久一区二区三区| 一区二区三区欧美激情| 91精品国产福利在线观看| 国产成人av资源| 亚欧色一区w666天堂| 国产亚洲精品超碰| 欧美日本国产视频| 成年人国产精品| 美女爽到高潮91| 国产精品不卡视频| 精品免费99久久| 欧美日韩另类国产亚洲欧美一级| 国产精品资源站在线| 亚洲在线成人精品| 欧美国产亚洲另类动漫| 欧美一卡二卡三卡| 欧美性受极品xxxx喷水| 成人av电影在线网| 国产一区二区三区日韩 | 久草精品在线观看| 亚洲综合一二区| 欧美激情资源网| 亚洲精品一区二区三区蜜桃下载| 欧美吻胸吃奶大尺度电影 | 国产在线播放一区二区三区| 亚洲成人免费影院| 亚洲视频一区二区在线| 国产女人水真多18毛片18精品视频| 欧美日韩国产一区二区三区地区| 成人黄色在线视频| 国产黄色精品视频| 另类中文字幕网| 香蕉加勒比综合久久| 夜色激情一区二区| 亚洲精品网站在线观看| 亚洲人成7777| 亚洲美女电影在线| 亚洲国产精品传媒在线观看| 亚洲女人的天堂| 中文文精品字幕一区二区| 久久久五月婷婷| 久久久精品人体av艺术| 国产欧美一二三区| 久久综合久久99| 国产亚洲污的网站| 国产精品久久毛片av大全日韩| 国产清纯白嫩初高生在线观看91 | 欧美性猛交一区二区三区精品 | 亚洲mv大片欧洲mv大片精品| 洋洋av久久久久久久一区| 亚洲最大色网站| 午夜日韩在线观看| 蜜臀精品久久久久久蜜臀| 免费视频最近日韩| 蜜臀va亚洲va欧美va天堂| 国产一区二区三区蝌蚪| 国v精品久久久网| 91丨九色porny丨蝌蚪| 在线看不卡av| 欧美精品tushy高清| 日韩免费观看2025年上映的电影 | 欧洲在线/亚洲| 8x8x8国产精品| 精品美女在线观看| 国产亚洲1区2区3区| 一区视频在线播放| 亚洲成人福利片| 麻豆精品一二三| 成人一区二区三区视频在线观看| 97久久人人超碰| 51精品秘密在线观看| 久久影院午夜论| 国产精品国产自产拍高清av王其| 一区二区三区欧美| 国产尤物一区二区在线| 欧洲色大大久久| 精品电影一区二区| 亚洲一区欧美一区| 国模无码大尺度一区二区三区| 色综合中文字幕国产 | 欧美一级艳片视频免费观看| 欧美精品一区二区不卡| 中文字幕色av一区二区三区| 五月婷婷色综合| 成人av网在线| 4438x亚洲最大成人网| 中文字幕av资源一区| 日韩国产欧美在线视频| 成人av资源在线观看| 日韩一区国产二区欧美三区| 亚洲精品综合在线| 国产成人精品在线看| 国产精品视频看|