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

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

?? confighelper.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 2003-2005 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: ConfigHelper.java,v 1.7 2005/06/07 14:15:16 tanderson Exp $
 */
package org.exolab.jms.config;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.exolab.jms.config.types.SchemeType;


/**
 * Helper class for interrogating the configuration.
 *
 * @author <a href="mailto:tma@netspace.net.au">Tim Anderson</a>
 * @version $Revision: 1.7 $ $Date: 2005/06/07 14:15:16 $
 */
public class ConfigHelper {

    /**
     * Returns the server URL for the specified scheme.
     *
     * @param scheme the connector scheme
     * @param config the configuration to use
     * @return the server URL for the specified scheme
     */
    public static String getServerURL(SchemeType scheme,
                                      Configuration config) {
        String url = null;
        ServerConfiguration server = config.getServerConfiguration();

        if (scheme.equals(SchemeType.TCP)) {
            url = getServerURL(scheme, server.getHost(),
                               config.getTcpConfiguration());
        } else if (scheme.equals(SchemeType.TCPS)) {
            url = getServerURL(scheme, server.getHost(),
                               config.getTcpsConfiguration());
        } else if (scheme.equals(SchemeType.RMI)) {
            RmiConfiguration rmi = config.getRmiConfiguration();
            if (rmi.getEmbeddedRegistry()) {
                // if the registry is embedded within the OpenJMS server,
                // use the server host
                url = getServerURL(scheme, server.getHost(), rmi);
            } else {
                url = getServerURL(scheme, rmi.getRegistryHost(), rmi);
            }
        } else if (scheme.equals(SchemeType.HTTP)) {
            url = getServerURL(scheme, config.getHttpConfiguration());
        } else if (scheme.equals(SchemeType.HTTPS)) {
            url = getServerURL(scheme, config.getHttpsConfiguration());
        } else if (scheme.equals(SchemeType.EMBEDDED)) {
            url = "vm:openjms";
        }
        return url;
    }

    /**
     * Returns the embedded JNDI URL for the specified scheme.
     *
     * @param scheme the connector scheme
     * @param config the configuration to use
     * @return embedded JNDI URL for the specified scheme
     */
    public static String getJndiURL(SchemeType scheme, Configuration config) {
        String url = null;
        ServerConfiguration server = config.getServerConfiguration();

        if (scheme.equals(SchemeType.TCP)) {
            url = getJndiURL(scheme, server.getHost(),
                             config.getTcpConfiguration());
        } else if (scheme.equals(SchemeType.TCPS)) {
            url = getJndiURL(scheme, server.getHost(),
                             config.getTcpsConfiguration());
        } else if (scheme.equals(SchemeType.HTTP)) {
            url = getJndiURL(scheme, config.getHttpConfiguration());
        } else if (scheme.equals(SchemeType.HTTPS)) {
            url = getJndiURL(scheme, config.getHttpsConfiguration());
        } else if (scheme.equals(SchemeType.RMI)) {
            RmiConfiguration rmi = config.getRmiConfiguration();
            if (rmi.getEmbeddedRegistry()) {
                // if the registry is embedded within the OpenJMS server,
                // use the server host
                url = getJndiURL(scheme, server.getHost(), rmi);
            } else {
                url = getJndiURL(scheme, rmi.getRegistryHost(), rmi);
            }
        } else if (scheme.equals(SchemeType.EMBEDDED)) {
            url = "vm:openjms";
        }
        return url;
    }

    /**
     * Returns the server administration URL for the specified scheme.
     *
     * @param scheme the connector scheme
     * @param config the configuration to use
     * @return the server administration URL for the specified scheme
     */
    public static String getAdminURL(SchemeType scheme, Configuration config) {
        String url = null;
        ServerConfiguration server = config.getServerConfiguration();

        if (scheme.equals(SchemeType.TCP)) {
            url = getAdminURL(scheme, server.getHost(),
                              config.getTcpConfiguration());
        } else if (scheme.equals(SchemeType.TCPS)) {
            url = getAdminURL(scheme, server.getHost(),
                              config.getTcpsConfiguration());
        } else if (scheme.equals(SchemeType.RMI)) {
            RmiConfiguration rmi = config.getRmiConfiguration();
            if (rmi.getEmbeddedRegistry()) {
                // if the registry is embedded within the OpenJMS server,
                // use the server host
                url = getAdminURL(scheme, server.getHost(), rmi);
            } else {
                url = getAdminURL(scheme, rmi.getRegistryHost(), rmi);
            }
        } else if (scheme.equals(SchemeType.HTTP)) {
            url = getAdminURL(scheme, config.getHttpConfiguration());
        } else if (scheme.equals(SchemeType.HTTPS)) {
            url = getAdminURL(scheme, config.getHttpsConfiguration());
        } else if (scheme.equals(SchemeType.EMBEDDED)) {
            url = "vm:openjms";
        }
        return url;
    }

    /**
     * Returns the server URL for the TCP/TCPS connector.
     *
     * @param scheme the connector scheme
     * @param host   the server host
     * @param config the TCP/TCPS configuration
     * @return the server URL for the TCP/TCPS connector
     */
    private static String getServerURL(SchemeType scheme, String host,
                                       TcpConfigurationType config) {
        return getURL(scheme, host, config.getPort());
    }

    /**
     * Returns the server URL for the RMI connector.
     *
     * @param scheme the connector scheme
     * @param host   the server host
     * @param config the RMI configuration
     * @return the server URL for the RMI connector
     */
    private static String getServerURL(SchemeType scheme, String host,
                                       RmiConfiguration config) {
        return getURL(scheme, host, config.getRegistryPort());
    }

    /**
     * Returns the server URL for the HTTP/HTTPS connector.
     *
     * @param scheme the connector scheme
     * @param config the HTTP/HTTPS configuration
     * @return the server URL for the HTTP/HTTPS connector
     */
    private static String getServerURL(SchemeType scheme,
                                       HttpConfigurationType config) {
        return getURL(scheme, config.getWebServerHost(),
                      config.getWebServerPort(), config.getServlet());
    }

    /**
     * Returns the embedded JNDI URL for the TCP/TCPS connector.
     *
     * @return the embedded JNDI URL for the TCP/TCPS connector
     */
    private static String getJndiURL(SchemeType scheme, String host,
                                     TcpConfigurationType config) {
        int port = config.getJndiPort();
        if (port == 0) {
            port = config.getPort();
        }
        return getURL(scheme, host, port);
    }

    /**
     * Returns the embedded JNDI URL for the RMI connector.
     *
     * @return the embedded JNDI URL for the RMI connector
     */
    private static String getJndiURL(SchemeType scheme, String host,
                                     RmiConfiguration config) {
        return getURL(scheme, host, config.getRegistryPort());
    }

    /**
     * Returns the embedded JNDI URL for the HTTP/HTTPS connector.
     *
     * @return the embedded JNDI URL for the HTTP/HTTPS connector
     */
    private static String getJndiURL(SchemeType scheme,
                                     HttpConfigurationType config) {
        return getURL(scheme, config.getWebServerHost(),
                      config.getWebServerPort(), config.getServlet());
    }

    /**
     * Returns the admin URL for the TCP/TCPS connector.
     *
     * @return the admin URL for the TCP/TCPS connector
     */
    private static String getAdminURL(SchemeType scheme, String host,
                                      TcpConfigurationType config) {
        int port = config.getAdminPort();
        if (port == 0) {
            port = config.getPort();
        }
        return getURL(scheme, host, port);
    }

    /**
     * Returns the admin URL for the RMI connector.
     *
     * @return the admin URL for the RMI connector
     */
    private static String getAdminURL(SchemeType scheme, String host,
                                      RmiConfiguration config) {
        return getURL(scheme, host, config.getRegistryPort());
    }

    /**
     * Returns the admin URL for the HTTP/HTTPS connector.
     *
     * @return the admin URL for the HTTP/HTTPS connector
     */
    private static String getAdminURL(SchemeType scheme,
                                      HttpConfigurationType config) {
        return getURL(scheme, config.getWebServerHost(),
                      config.getWebServerPort(), config.getServlet());
    }

    /**
     * Constructs a URL with no path.
     *
     * @param scheme the connector scheme
     * @param host   the host
     * @param port   the port
     * @return a URL formed from the concatenation of the arguments
     */
    private static String getURL(SchemeType scheme, String host, int port) {
        return getURL(scheme, host, port, "");
    }

    /**
     * Constructs a URL with a path.
     *
     * @param scheme the connector scheme
     * @param host   the host
     * @param port   the port
     * @param path   the path
     * @return a URL formed from the concatenation of the arguments
     */
    private static String getURL(SchemeType scheme, String host, int port,
                                 String path) {
        return getURL(scheme.toString(), host, port, path);
    }

    /**
     * Constructs a URL with a path.
     *
     * @param scheme the connector scheme
     * @param host   the host
     * @param port   the port
     * @param path   the path
     * @return a URL formed from the concatenation of the arguments
     */
    private static String getURL(String scheme, String host, int port,
                                 String path) {
        String result = scheme + "://" + getHost(host) + ":" + port;
        if (!path.startsWith("/")) {
            result += "/" + path;
        } else {
            result += path;
        }
        return result;
    }

    /**
     * Returns the host address, if the supplied host is localhost, else returns
     * it, unchanged.
     */
    private static String getHost(String host) {
        if (host.equals("localhost")) {
            try {
                host = InetAddress.getLocalHost().getHostAddress();
            } catch (UnknownHostException ignore) {
            }
        }
        return host;
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re8在线精品视频免费播放| 精品成人佐山爱一区二区| 日韩情涩欧美日韩视频| 国产精品三级视频| 美日韩一级片在线观看| 91麻豆视频网站| 国产农村妇女毛片精品久久麻豆 | 国产a级毛片一区| 欧美日韩电影在线播放| 国产精品白丝在线| 国产一区福利在线| 欧美精品少妇一区二区三区| 亚洲四区在线观看| 从欧美一区二区三区| 精品日韩在线观看| 日韩av在线发布| 欧美丝袜自拍制服另类| 国产精品久久一卡二卡| 国产麻豆精品在线观看| 日韩欧美国产高清| 三级影片在线观看欧美日韩一区二区 | 国产精品精品国产色婷婷| 久久亚洲一区二区三区四区| 亚洲综合成人网| 成人国产免费视频| 国产午夜精品久久久久久久| 精品综合免费视频观看| 欧美日韩高清一区二区三区| 亚洲成人tv网| 欧美日韩在线播放三区四区| 一卡二卡三卡日韩欧美| 91最新地址在线播放| 国产精品久久久久久久久久免费看 | 日韩成人dvd| 91在线视频观看| 欧美色大人视频| 欧美精品一区在线观看| 视频在线观看91| 色八戒一区二区三区| 中文字幕在线观看一区二区| 国产成人av电影免费在线观看| 精品国产乱码久久久久久闺蜜| 视频一区二区国产| 欧美日韩亚洲另类| 亚洲国产日韩在线一区模特| 色狠狠一区二区| 亚洲第一福利视频在线| 色哟哟一区二区在线观看| 亚洲视频一区在线| 色女孩综合影院| 亚洲天堂免费在线观看视频| 99久久精品国产一区二区三区| 欧美国产丝袜视频| 粉嫩13p一区二区三区| 中文字幕精品一区| 99久久精品免费精品国产| 中文字幕一区二区三区不卡 | 亚洲成人7777| 欧美日韩久久久久久| 污片在线观看一区二区| 91精品国产91久久综合桃花 | 91精品国产综合久久蜜臀| 天天做天天摸天天爽国产一区 | 日欧美一区二区| 欧美成人福利视频| 国产精品资源网| 亚洲欧洲日产国码二区| 色综合久久中文综合久久牛| 亚洲综合色噜噜狠狠| 欧美日韩在线三级| 国产一区二区三区国产| 亚洲高清免费观看 | 东方aⅴ免费观看久久av| 中文字幕一区二区三区在线不卡| 色综合久久天天综合网| 午夜精品久久久久久久久| 日韩精品综合一本久道在线视频| 国产一区欧美日韩| 久久免费的精品国产v∧| 97精品电影院| 日韩精品免费视频人成| 精品国产污污免费网站入口| 丁香亚洲综合激情啪啪综合| 亚洲国产精品久久久男人的天堂 | 五月激情综合婷婷| ww久久中文字幕| 一本一道久久a久久精品| 欧美a级理论片| 国产精品久久久久影院| 91麻豆精品国产91久久久资源速度| 极品美女销魂一区二区三区| 亚洲免费观看高清完整版在线| 欧美一区欧美二区| 99精品一区二区三区| 免费成人在线视频观看| 日韩一区中文字幕| 日韩久久久精品| 欧美在线三级电影| 美女精品一区二区| 亚洲一二三区在线观看| 亚洲一区二区三区国产| 亚洲精品在线一区二区| 欧美中文字幕一区二区三区 | 亚洲国产成人tv| 国产日产精品一区| 在线成人av影院| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 18成人在线观看| 欧美精品一区二区三区蜜桃视频 | 国产精品五月天| 欧美成人精品二区三区99精品| 欧美丝袜丝交足nylons图片| 波多野结衣精品在线| 人人超碰91尤物精品国产| 亚洲女子a中天字幕| 国产欧美精品区一区二区三区 | 综合久久久久久| 国产日韩欧美电影| 欧美片网站yy| 在线精品视频一区二区| 成人免费av网站| 日本不卡不码高清免费观看| 亚洲国产成人高清精品| 亚洲一区二区三区自拍| 亚洲激情成人在线| 亚洲美女视频在线| 一色屋精品亚洲香蕉网站| 国产精品网站在线| 国产精品嫩草99a| 国产女主播一区| 欧美韩日一区二区三区四区| 久久久久久久网| 国产欧美日韩视频一区二区| 26uuu国产在线精品一区二区| 日韩一卡二卡三卡四卡| 日韩欧美电影一二三| 精品美女在线播放| 欧美α欧美αv大片| 精品国免费一区二区三区| 26uuu亚洲婷婷狠狠天堂| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 日韩av在线免费观看不卡| 天堂一区二区在线| 天堂蜜桃一区二区三区| 久久福利视频一区二区| 国产盗摄一区二区三区| 成人午夜激情视频| 色婷婷综合中文久久一本| 欧美日韩一区成人| 日韩视频一区二区三区 | 在线免费av一区| 欧美日韩一区二区三区不卡| 欧美一级黄色录像| 精品国产一区二区亚洲人成毛片| 久久青草欧美一区二区三区| 亚洲黄色录像片| 性感美女久久精品| 国产精品一区专区| 久久成人免费网| 成人18视频在线播放| 欧美区一区二区三区| 久久久噜噜噜久久中文字幕色伊伊 | 欧美丝袜丝交足nylons| 精品日韩av一区二区| 中文字幕一区二区三区av| 天堂在线一区二区| 成人精品在线视频观看| 欧美日韩国产一区二区三区地区| 精品少妇一区二区三区在线播放| 中文字幕精品综合| 午夜av一区二区| 国产寡妇亲子伦一区二区| 欧美私模裸体表演在线观看| 精品久久久影院| 依依成人精品视频| 久久激五月天综合精品| 欧美综合天天夜夜久久| 国产欧美精品区一区二区三区 | 国产一区二区日韩精品| 在线观看视频一区二区| 精品国产伦一区二区三区观看方式 | 国产精品欧美一区二区三区| 天天综合日日夜夜精品| 成人sese在线| 精品免费视频.| 天堂一区二区在线| 麻豆一区二区三| 国产成人自拍网| 日韩欧美亚洲国产另类| 天堂精品中文字幕在线| 9i在线看片成人免费| 精品剧情v国产在线观看在线| 亚洲激情自拍视频| 成人性生交大片免费看中文| 日韩欧美视频一区| 亚洲成人精品在线观看| 99久久综合色| 国产精品嫩草影院com| 久久精品av麻豆的观看方式| 欧美日高清视频|