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

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

?? configurationloader.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 2000-2005 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: ConfigurationLoader.java,v 1.2 2005/03/19 13:11:19 tanderson Exp $
 */
package org.exolab.jms.config;

import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.ValidationException;


/**
 * The ConfigurationLoader loads a {@link Configuration} document and populates
 * unset items with those provided by {@link DefaultConfiguration}.
 *
 * @author <a href="mailto:tima@intalio.com">Tim Anderson</a>
 * @version $Revision: 1.2 $ $Date: 2005/03/19 13:11:19 $
 * @see Configuration
 */
public class ConfigurationLoader {

    /**
     * The default configuration path, as a resource.
     */
    private static final String DEFAULT_CONFIG = "openjms_defaults.xml";


    /**
     * Construct a new <code>ConfigurationLoader</code>.
     */
    public ConfigurationLoader() {
    }

    /**
     * Loads the configuration information from the specified file. Unpopulated
     * configuration elements will be set to those provided by {@link
     * DefaultConfiguration}.
     *
     * @param path the path to the file
     * @return the configuration
     * @throws IOException         for any I/O error
     * @throws MarshalException    if there is an error during unmarshalling
     * @throws ValidationException if there is a validation error
     */
    public Configuration load(String path)
            throws IOException, MarshalException, ValidationException {

        Configuration result = null;
        FileReader reader = new FileReader(path);
        try {
            Unmarshaller stream = new Unmarshaller(Configuration.class);
            AttributeExpander handler = new AttributeExpander(reader);
            result = (Configuration) stream.unmarshal(handler);
        } finally {
            reader.close();
        }
        return load(result);
    }

    /**
     * Loads unpopulated elements in the supplied configuration with default
     * values. The default values are provided by {@link DefaultConfiguration}.
     *
     * @param config the configuration
     * @return the configuration, with unpopulated elements set to the defaults
     * @throws IOException         for any I/O error
     * @throws MarshalException    if there is an error during unmarshalling
     * @throws ValidationException if there is a validation error
     */
    public Configuration load(Configuration config)
            throws IOException, MarshalException, ValidationException {
        DefaultConfiguration defaults = getDefaults();

        if (config.getServerConfiguration() == null) {
            config.setServerConfiguration(defaults.getServerConfiguration());
        }
        if (config.getConnectors() == null) {
            config.setConnectors(defaults.getConnectors());
        }
        if (config.getLoggerConfiguration() == null) {
            config.setLoggerConfiguration(defaults.getLoggerConfiguration());
        }
        if (config.getTcpConfiguration() == null) {
            config.setTcpConfiguration(defaults.getTcpConfiguration());
        }
        if (config.getTcpsConfiguration() == null) {
            config.setTcpsConfiguration(defaults.getTcpsConfiguration());
        }
        if (config.getRmiConfiguration() == null) {
            config.setRmiConfiguration(defaults.getRmiConfiguration());
        }
        if (config.getHttpConfiguration() == null) {
            config.setHttpConfiguration(defaults.getHttpConfiguration());
        }
        if (config.getHttpsConfiguration() == null) {
            config.setHttpsConfiguration(defaults.getHttpsConfiguration());
        }
        if (config.getMessageManagerConfiguration() == null) {
            config.setMessageManagerConfiguration(
                    defaults.getMessageManagerConfiguration());
        }
        if (config.getSchedulerConfiguration() == null) {
            config.setSchedulerConfiguration(
                    defaults.getSchedulerConfiguration());
        }
        if (config.getGarbageCollectionConfiguration() == null) {
            config.setGarbageCollectionConfiguration(
                    defaults.getGarbageCollectionConfiguration());
        }
        if (config.getSecurityConfiguration() == null) {
            config.setSecurityConfiguration(
                    defaults.getSecurityConfiguration());
        }
        if (config.getServerConfiguration().getEmbeddedJNDI()) {
            // populate the JNDI configuration with the default values for
            // the connector
            config.setJndiConfiguration(
                    JndiConfigurationFactory.create(config));
        } else if (config.getJndiConfiguration() == null) {
            throw new ValidationException(
                    "JndiConfiguration must be provided when "
                    + "ServerConfiguration/embeddedJNDI is false");
        }
        return config;
    }

    /**
     * Returns the default configuration, loaded from {@link #DEFAULT_CONFIG}.
     *
     * @return the default configuration
     * @throws IOException         for any I/O error
     * @throws MarshalException    if there is an error during unmarshalling
     * @throws ValidationException if there is a validation error
     */
    private DefaultConfiguration getDefaults()
            throws IOException, MarshalException, ValidationException {

        DefaultConfiguration result = null;
        InputStream source = getClass().getResourceAsStream(DEFAULT_CONFIG);
        if (source == null) {
            throw new IOException(
                    "Failed to find default configuration: " + DEFAULT_CONFIG);
        }
        try {
            Unmarshaller stream = new Unmarshaller(DefaultConfiguration.class);
            AttributeExpander handler = new AttributeExpander(
                    new InputStreamReader(source));
            result = (DefaultConfiguration) stream.unmarshal(handler);
        } finally {
            try {
                source.close();
            } catch (IOException ignore) {
            }
        }
        return result;
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产1区2区| 国产成人鲁色资源国产91色综| 久久精品国产一区二区| 97久久精品人人澡人人爽| 欧美一区二区三区公司| 亚洲天天做日日做天天谢日日欢 | 国产乱对白刺激视频不卡| 日本道色综合久久| 国产午夜精品美女毛片视频| 爽好久久久欧美精品| www.视频一区| 国产日韩欧美精品综合| 美国欧美日韩国产在线播放| 日本韩国精品在线| 中文字幕日韩精品一区 | 亚洲午夜日本在线观看| 成人黄色软件下载| 久久精品一二三| 精品一区二区免费视频| 欧美日韩精品免费| 亚洲国产精品尤物yw在线观看| 91蜜桃视频在线| 亚洲欧美视频在线观看| av午夜精品一区二区三区| 久久精品人人做| 国产99久久久国产精品潘金网站| 日韩精品在线一区| 麻豆国产一区二区| 日韩视频在线你懂得| 奇米在线7777在线精品 | 免费在线观看精品| 日韩一级欧美一级| 美女视频网站久久| 日韩欧美一区二区在线视频| 欧美aaaaaa午夜精品| 日韩午夜三级在线| 加勒比av一区二区| 欧美精品一区二区三区很污很色的| 免费人成网站在线观看欧美高清| 在线综合视频播放| 看片的网站亚洲| 久久亚洲一区二区三区明星换脸 | 免费精品99久久国产综合精品| 欧美猛男男办公室激情| 免费一级片91| 国产欧美中文在线| 色一情一伦一子一伦一区| 亚洲一区二区三区四区在线观看 | 精品亚洲成a人| 国产亚洲欧美日韩在线一区| 国产成人av一区二区| 亚洲图片你懂的| 5858s免费视频成人| 极品尤物av久久免费看| 综合av第一页| 91精品国产色综合久久久蜜香臀| 老色鬼精品视频在线观看播放| 国产午夜亚洲精品不卡| av男人天堂一区| 日韩精品国产精品| 国产亚洲欧美一级| 欧美视频你懂的| 韩国成人精品a∨在线观看| 国产精品家庭影院| 777a∨成人精品桃花网| 国产成+人+日韩+欧美+亚洲| 亚洲黄色性网站| 久久久亚洲精品一区二区三区| 99精品久久只有精品| 日本一不卡视频| 中文字幕在线不卡视频| 在线成人免费视频| 成人18视频在线播放| 天堂va蜜桃一区二区三区| 欧美国产成人在线| 日韩一本二本av| 欧美又粗又大又爽| 国产一区二区三区精品欧美日韩一区二区三区| 成人欧美一区二区三区黑人麻豆| 555夜色666亚洲国产免| 97se亚洲国产综合在线| 国产一区不卡在线| 日韩av网站在线观看| 伊人婷婷欧美激情| 久久精品视频网| 日韩欧美一区在线| 欧美丝袜丝交足nylons| 成熟亚洲日本毛茸茸凸凹| 奇米影视在线99精品| 一区二区三区在线观看国产| 中文字幕欧美激情| 精品国产一二三区| 欧美精品亚洲二区| 日本福利一区二区| 成人做爰69片免费看网站| 久久精品国产精品亚洲红杏| 亚洲一区二区三区在线| 中文字幕在线观看一区二区| 久久亚洲免费视频| 日韩精品一区二区三区蜜臀| 欧美丰满高潮xxxx喷水动漫| 欧美中文字幕久久| 91久久精品一区二区三| 成人av在线资源网站| 风间由美一区二区三区在线观看| 性做久久久久久| 一区二区三区蜜桃| 一区二区三区毛片| 亚洲伦理在线精品| 亚洲精品免费在线| 一区二区三区国产精华| 夜夜精品视频一区二区| 亚洲日穴在线视频| 一区二区三区四区不卡在线 | 色综合天天在线| av不卡免费电影| 91亚洲国产成人精品一区二区三| 国产91精品在线观看| 成人一区二区三区在线观看| 国产精品一卡二| 成人午夜电影久久影院| 国产aⅴ综合色| 91一区二区三区在线观看| 99精品久久只有精品| 欧美在线观看一区| 欧美精三区欧美精三区| 日韩视频在线你懂得| 久久综合久久综合久久综合| 国产视频一区在线播放| 日韩码欧中文字| 亚洲小说欧美激情另类| 欧美aaa在线| 国产麻豆欧美日韩一区| 99久久精品99国产精品| 欧美中文字幕久久 | 精品国产免费一区二区三区四区| 欧美午夜片在线看| 亚洲三级在线看| 欧美精品18+| 欧美刺激午夜性久久久久久久 | 麻豆成人免费电影| 国产一区在线精品| 亚洲自拍与偷拍| 日韩免费观看2025年上映的电影| 99久久综合国产精品| 国产99久久久国产精品潘金| 国产在线视频一区二区| 久久福利资源站| 日本成人中文字幕| 五月婷婷另类国产| 亚洲高清视频中文字幕| 亚洲猫色日本管| 亚洲精品成人在线| 亚洲第一激情av| 亚洲国产欧美在线| 亚洲成人你懂的| 污片在线观看一区二区| 夜夜操天天操亚洲| 亚洲成在人线在线播放| 亚洲国产乱码最新视频 | 蜜臀91精品一区二区三区| 日本不卡高清视频| 日本不卡高清视频| 精品一区二区三区香蕉蜜桃 | 久久99精品国产.久久久久久| 麻豆精品视频在线观看视频| 久久国产福利国产秒拍| 国产福利一区二区| 91免费视频观看| 欧美精品久久久久久久多人混战 | 久久综合网色—综合色88| 久久综合九色综合欧美98| 国产婷婷色一区二区三区| 国产精品久久精品日日| 亚洲高清不卡在线观看| 九九精品视频在线看| 国产精品88888| 欧美中文字幕久久| 精品久久久久久久久久久院品网 | 国产精品毛片高清在线完整版| **性色生活片久久毛片| 亚洲一区二区成人在线观看| 美女视频黄 久久| 成人国产视频在线观看| 7777精品伊人久久久大香线蕉经典版下载 | 成人高清视频在线观看| 欧美午夜电影网| 久久伊人蜜桃av一区二区| 亚洲卡通动漫在线| 久久99国产精品久久99| 91蜜桃网址入口| www成人在线观看| 亚洲精品福利视频网站| 久久99蜜桃精品| 在线免费不卡电影| 久久精品亚洲乱码伦伦中文| 亚洲成人av电影| 不卡av电影在线播放| 欧美tk丨vk视频| 午夜精品一区二区三区三上悠亚 |