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

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

?? jndiconfiguration.java

?? java servlet著名論壇源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package net.myvietnam.mvncore.configuration;
/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2003 The Apache Software Foundation.  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 acknowledgement:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgement may appear in the software itself,
 *    if and wherever such third-party acknowledgements normally appear.
 *
 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Software Foundation.
 *
 * 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 THE APACHE SOFTWARE FOUNDATION 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 the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Properties;
import java.util.Vector;
import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
 * This Configuration class allows you to interface with a JNDI datasource.
 *
 * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
 * @version $Id: JNDIConfiguration.java,v 1.2 2004/05/28 22:02:58 skoehler Exp $
 */
public class JNDIConfiguration
    extends BaseConfiguration
    implements Configuration
{
    private static Log log = LogFactory.getLog(JNDIConfiguration.class);
    private String prefix;
    private Context envCtx;
    private List clearedProperties = new ArrayList();
    /**
     * Creates an empty JNDIConfiguration object which can then
     * be added some other Configuration files
     */
    public JNDIConfiguration()
    {
    }
    /**
     * JNDIConfigurations can not be added to
     *
     * @param key The Key to add the property to.
     * @param token The Value to add.
     */
    public void addProperty(String key, Object token)
    {
        throw new Error("This operation is not supported");
    }
    /**
     * This method recursive traverse the JNDI tree, looking for Context objects.
     * When it finds them, it traverses them as well.  Otherwise it just adds the
     * values to the list of keys found.
     * @param keys All the keys that have been found.
     * @param enum An enumeration of all the elements found at a specific context
     * @param key What key we are building on.
     * @throws NamingException If JNDI has an issue.
     */
    private void recursiveGetKeys(
        List keys,
        NamingEnumeration enum,
        String key)
        throws NamingException
    {
        while (enum.hasMoreElements())
        {
            Binding binding = (Binding) enum.next();
            StringBuffer newKey = new StringBuffer();
            newKey.append(key);
            if (newKey.length() > 0)
            {
                newKey.append(".");
            }
            newKey.append(binding.getName());
            if (binding.getObject() instanceof Context)
            {
                Context c = (Context) binding.getObject();
                NamingEnumeration enum2 = c.listBindings("");
                recursiveGetKeys(keys, enum2, newKey.toString());
            }
            else
            {
                if (!keys.contains(newKey.toString()))
                {
                    keys.add(newKey.toString());
                }
            }
        }
    }
    /**
     * Get the list of the keys contained in the configuration
     * repository.
     *
     * @return An Iterator.
     */
    public Iterator getKeys()
    {
        return getKeys("");
    }
    /**
     * Get the list of the keys contained in the configuration
     * repository that match a passed in beginning pattern.
     *
     * @param key the key pattern to match on.
     * @return An Iterator.
     */
    public Iterator getKeys(String key)
    {
        List keys = new ArrayList();
        try
        {
            String[] splitKeys = StringUtils.split(key, ".");
            for (int i = 0; i < splitKeys.length; i++)
            {
                keys.add(splitKeys[i]);
            }
            Context context = null;
            if (keys.size() == 0)
            {
                context = getContext();
            }
            else
            {
                context =
                    getStartingContextPoint(
                        keys,
                        getContext().listBindings(""));
            }
            if (context != null)
            {
                NamingEnumeration enum = context.listBindings("");
                recursiveGetKeys(keys, enum, key);
            }
        }
        catch (NamingException ne)
        {
            log.warn(ne);
        }
        return keys.iterator();
    }
    /**
     * Because JNDI is based on a tree configuration, we need to filter down the
     * tree, till we find the Context specified by the key to start from.
     * Otherwise return null.
     *
     * @param The key (or name) of the Context we are looking to start from.
     * @return The context at that key's location in the JNDI tree, or null if not found
     * @throws NamingException if JNDI has an issue
     */
    private Context getStartingContextPoint(List keys, NamingEnumeration enum)
        throws NamingException
    {
        String keyToSearchFor = (String) keys.get(0);
        log.debug("Key to search for is " + keyToSearchFor);
        while (enum.hasMoreElements())
        {
            Binding binding = (Binding) enum.next();
            log.debug(
                "Binding for name: "
                    + binding.getName()
                    + ", object:"
                    + binding.getObject()
                    + ", class:"
                    + binding.getClassName());
            if (binding.getObject() instanceof Context
                && binding.getName().equals(keyToSearchFor))
            {
                keys.remove(0);
                Context c = (Context) binding.getObject();
                if (keys.size() > 0)
                {
                    return getStartingContextPoint(keys, c.listBindings(""));
                }
                else
                {
                    return c;
                }
            }
        }
        return null;
    }
    /**
     * Get a list of properties associated with the given
     * configuration key.
     *
     * @param key The configuration key.
     * @return The associated properties if key is found.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a String/Vector.
     * @throws IllegalArgumentException if one of the tokens is
     * malformed (does not contain an equals sign).
     * @see #getProperties(String, Properties)
     */
    public Properties getProperties(String key)
    {
        throw new Error("This operation is not supported");
    }
    public boolean isEmpty()
    {
        try
        {
            NamingEnumeration enum = getContext().listBindings("");
            return !enum.hasMore();
        }
        catch (NamingException ne)
        {
            log.warn(ne);
            return true;
        }
    }
    /**
     *  Gets a property from the configuration.
     *
     *  @param key property to retrieve
     *  @return value as object. Will return user value if exists,
     *          if not then default value if exists, otherwise null
     */
    public Object getProperty(String key)
    {
        throw new Error("This operation is not supported");
    }
    /**
     * Set a property, this will replace any previously
     * set values. Set values is implicitly a call
     * to clearProperty(key), addProperty(key,value).
     *
     * @param key
     * @param value
     */
    public void setProperty(String key, Object value)
    {
        throw new Error("This operation is not supported");
    }
    /**
     * Clear a property in the configuration.  Just marks it as cleared,
     * doesn't change the underlying JNDI data source.
     *
     * @param key the key to remove along with corresponding value.
     */
    public void clearProperty(String key)
    {
        if (!clearedProperties.contains(key))
        {
            clearedProperties.add(key);
        }
    }
    /**
     * check if the configuration contains the key, or the key
     * has been removed.
     */
    public boolean containsKey(String key)
    {
        if (clearedProperties.contains(key))
        {
            return false;
        }
        key = StringUtils.replace(key, ".", "/");
        try
        {
        	// throws a NamingException if JNDI doesn't contain the key.
            getContext().lookup(key);
            return true;
        }
        catch (javax.naming.NamingException ne)
        {
            return false;
        }
    }
    /**
     * Create an ExtendedProperties object that is a subset
     * of this one. Take into account duplicate keys
     * by using the setProperty() in ExtendedProperties.
     *
     * @param prefix
     */
    public Configuration subset(String prefix)
    {
        BaseConfiguration c = new BaseConfiguration();
        Iterator keys = this.getKeys();
        boolean validSubset = false;
        while (keys.hasNext())
        {
            Object key = keys.next();
            if (key instanceof String && ((String) key).startsWith(prefix))
            {
                if (!validSubset)
                {
                    validSubset = true;
                }
                String newKey = null;
                /*
                 * Check to make sure that c.subset(prefix) doesn't blow up when
                 * there is only a single property with the key prefix. This is
                 * not a useful subset but it is a valid subset.
                 */
                if (((String) key).length() == prefix.length())
                {
                    newKey = prefix;
                }
                else
                {
                    newKey = ((String) key).substring(prefix.length() + 1);
                }
                /*
                 * use addPropertyDirect() - this will plug the data as is into
                 * the Map, but will also do the right thing re key accounting
                 */
                Object value = getValueFromJNDI(key.toString());
                if (value instanceof String)
                {
                    c.addPropertyDirect(newKey, interpolate((String) value));
                }
                else
                {
                    c.addPropertyDirect(newKey, value);
                }
            }
        }
        if (validSubset)
        {
            return c;
        }
        else
        {
            return null;
        }
    }

    /**
     * Get a boolean associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     * @return The associated boolean if key is found and has valid
     * format, default value otherwise.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Boolean.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩在线视频| 日本不卡视频一二三区| k8久久久一区二区三区| 久久综合99re88久久爱| 成人性生交大合| 亚洲大片在线观看| 国产精品2024| 精品国免费一区二区三区| 韩国女主播成人在线| 中文字幕免费观看一区| 91色在线porny| 婷婷成人综合网| 日韩精品专区在线影院重磅| 豆国产96在线|亚洲| 综合欧美亚洲日本| 69久久夜色精品国产69蝌蚪网| 精品一区二区三区免费观看| 中文字幕国产一区二区| 在线免费观看日本一区| 日本成人在线一区| 亚洲国产精品成人综合| 欧美日韩一区在线| 国产精品自拍av| 亚洲精品va在线观看| 日韩女优av电影| 91麻豆自制传媒国产之光| 婷婷综合另类小说色区| 国产三级精品三级在线专区| 91极品美女在线| 国产一区二区三区视频在线播放| 国产精品白丝在线| 日韩一二三区不卡| 91免费视频大全| 极品少妇xxxx精品少妇偷拍| 一区二区三区蜜桃| 久久综合资源网| 欧洲生活片亚洲生活在线观看| 看电视剧不卡顿的网站| 伊人色综合久久天天| 2021久久国产精品不只是精品| 欧美艳星brazzers| 高清不卡一区二区| 免费在线一区观看| 亚洲永久免费视频| 国产清纯在线一区二区www| 欧美人xxxx| 97超碰欧美中文字幕| 国产精品综合av一区二区国产馆| 一区二区三区在线免费| 欧美激情中文不卡| 精品国产一区二区三区久久影院| 在线亚洲免费视频| www.久久久久久久久| 国产一区视频在线看| 日韩精品久久理论片| 亚洲精品亚洲人成人网在线播放| 久久久国产精品不卡| 欧美精品自拍偷拍| 色哟哟国产精品| 丁香五精品蜜臀久久久久99网站 | 亚洲精品久久久蜜桃| 国产欧美一区二区精品仙草咪| 日韩一区二区视频在线观看| 欧美中文一区二区三区| 99久久伊人久久99| 丁香激情综合国产| 国产激情精品久久久第一区二区| 美女国产一区二区| 免费看欧美女人艹b| 日韩av午夜在线观看| 亚洲日本电影在线| 亚洲欧美aⅴ...| 中文字幕在线不卡一区二区三区| 中文字幕免费一区| 国产精品久久久久桃色tv| 中文字幕第一区| 国产欧美日韩另类视频免费观看| 日韩精品一区二区三区视频播放 | 精品久久久久久无| 欧美一区二区福利视频| 91精品欧美久久久久久动漫| 在线播放中文字幕一区| 911精品产国品一二三产区| 日本不卡在线视频| 亚洲电影激情视频网站| 五月婷婷久久综合| 日本中文字幕不卡| 免费在线观看精品| 蜜臀精品久久久久久蜜臀| 日本怡春院一区二区| 日本中文字幕一区二区视频 | 国产精品中文字幕一区二区三区| 国产伦精品一区二区三区免费迷 | 欧美日韩一区二区三区四区五区| 91麻豆国产香蕉久久精品| 色婷婷精品久久二区二区蜜臀av | 日韩午夜中文字幕| 欧美大片在线观看一区二区| 精品日韩在线观看| 日本一区二区动态图| 亚洲视频在线一区观看| 亚洲午夜影视影院在线观看| 视频一区二区欧美| 久久99国产精品尤物| 成人av电影免费在线播放| 在线亚洲人成电影网站色www| 欧美色国产精品| 日韩西西人体444www| 中文字幕免费一区| 天堂一区二区在线| 国产激情偷乱视频一区二区三区| 99久久亚洲一区二区三区青草| 欧洲色大大久久| 欧美va日韩va| 亚洲男女一区二区三区| 免费成人性网站| 波多野结衣在线aⅴ中文字幕不卡| 欧美在线看片a免费观看| 精品免费99久久| 国产精品久久久久久久第一福利| 性做久久久久久免费观看欧美| 极品销魂美女一区二区三区| 色婷婷久久久综合中文字幕| 久久久久综合网| 亚洲成人激情av| 国产成人无遮挡在线视频| 欧美群妇大交群的观看方式| 国产精品欧美久久久久无广告| 视频一区视频二区中文字幕| av激情成人网| 久久一日本道色综合| 亚洲亚洲精品在线观看| 国产福利精品导航| 91精品国产综合久久精品app| 国产精品久久久久精k8| 美洲天堂一区二卡三卡四卡视频| 日本电影欧美片| 亚洲国产高清aⅴ视频| 秋霞影院一区二区| 欧美色精品天天在线观看视频| 国产精品久久久久久久久久免费看| 免费在线观看一区| 欧美夫妻性生活| 亚洲午夜免费视频| 99在线精品观看| 国产欧美一区二区精品婷婷| 国产精品伦理一区二区| 午夜久久久久久久久| 成人激情文学综合网| 7777精品伊人久久久大香线蕉的 | 色久优优欧美色久优优| 国产欧美日韩精品a在线观看| 日韩国产高清在线| 欧美综合久久久| 亚洲女人小视频在线观看| 国产不卡视频在线播放| 精品99久久久久久| 奇米色一区二区三区四区| 欧美日韩视频在线第一区| 亚洲激情在线激情| 色呦呦日韩精品| 亚洲综合色网站| 91蝌蚪porny九色| 亚洲婷婷综合色高清在线| 成人精品鲁一区一区二区| 国产欧美日韩亚州综合| 激情久久久久久久久久久久久久久久| 欧美一区二区美女| 五月天激情小说综合| 欧美精品 国产精品| 丝袜国产日韩另类美女| 欧美一区二区三区白人| 三级欧美在线一区| 欧美一卡2卡3卡4卡| 美国欧美日韩国产在线播放| 日韩欧美高清在线| 国产一区二区三区免费播放| 国产午夜精品美女毛片视频| 国产成人精品亚洲午夜麻豆| 中文字幕av一区二区三区高| 成人综合激情网| 17c精品麻豆一区二区免费| 91视频国产观看| 一区二区三区精品视频| 欧美精品久久久久久久多人混战 | 欧美国产精品专区| 成人午夜视频免费看| 亚洲品质自拍视频网站| 欧美亚洲动漫另类| 奇米四色…亚洲| 国产精品系列在线| 日本丰满少妇一区二区三区| 丝袜a∨在线一区二区三区不卡| 日韩美女一区二区三区四区| 国产iv一区二区三区| 亚洲色图都市小说| 555www色欧美视频| 国产传媒一区在线| 一区二区三区在线视频播放| 欧美一级在线免费|