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

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

?? jmstopic.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 1999 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: JmsTopic.java,v 1.1 2004/11/26 01:50:40 tanderson Exp $
 *
 * Date         Author  Changes
 * 3/21/2000    jima    Created
 */
package org.exolab.jms.client;


import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.StringTokenizer;

import javax.jms.JMSException;
import javax.jms.Topic;
import javax.naming.Reference;
import javax.naming.Referenceable;
import javax.naming.StringRefAddr;


/**
 * A topic is a destination specific for the puiblish-subscribe messaging
 * model. OpenJMS also supports topic hierarchy and wild carding.
 *
 * @version     $Revision: 1.1 $ $Date: 2004/11/26 01:50:40 $
 * @author      <a href="mailto:jima@exoffice.com">Jim Alateras</a>
 * @author      <a href="mailto:mourikis@exoffice.com">Jim Mourikis</a>
 * @see         org.exolab.jms.client.JmsDestination
 **/
public class JmsTopic
    extends JmsDestination
    implements Topic, Externalizable, Referenceable {

    /**
     * Used for serialization
     */
    static final long serialVersionUID = 1;

    // The wildcard character.
    public static final String WILDCARD = "*";

    //Wilcard for this and subsequent levels
    public static final String ALL_WILDCARD = "**";

    // The separator character for each topic level.
    public static final String SEPARATOR = ".";


    /**
     * Need a default constructor for the serialization
     */
    public JmsTopic() {
    }

    /**
     * Instantiate an instance of this object with the specified string
     *
     * @param       name            name of the queue
     */
    public JmsTopic(String name) {
        super(name);
    }

    /**
     * Return the name of the topic
     *
     * @return      name        name of  the topic
     * @exception   JMSException
     */
    public String getTopicName()
        throws JMSException {
        return getName();
    }


    // implementation of Object.equals(Object)
    public boolean equals(Object object) {
        boolean result = false;

        if ((object instanceof JmsTopic) &&
            (((JmsTopic) object).getName().equals(this.getName()))) {
            result = true;
        }

        return result;
    }

    // implementation of Externalizable.writeExternal
    public void writeExternal(ObjectOutput stream)
        throws IOException {
        stream.writeLong(serialVersionUID);
        super.writeExternal(stream);
    }

    // implementation of Externalizable.writeExternal
    public void readExternal(ObjectInput stream)
        throws IOException, ClassNotFoundException {
        long version = stream.readLong();
        if (version == serialVersionUID) {
            super.readExternal(stream);
        } else {
            throw new IOException("JmsTopic with version " +
                version + " is not supported.");
        }
    }

    // implementation of Object.hashCode
    public int hashCode() {
        return getName().hashCode();
    }

    /**
     * Check whether this topic represents a wildcard expression.
     *
     * @return boolean true if the topic contains wildcards
     */
    public boolean isWildCard() {
        return isWildCard(this.getName());
    }

    /**
     * A static method which checks a topic to determine whether or not it
     * complies to a wildcard definition.
     *
     * @param topic - the topic to check
     * @return boolean - true if it does
     */
    public static boolean isWildCard(String topic) {
        // if the topic contains the "**" wildcard ensure that it is
        // the last item, and no further tokens exist after it.
        int pos = topic.indexOf(ALL_WILDCARD);

        if (pos >= 0 && (pos != topic.length() - 2)) {
            return false;
        }

        pos = topic.indexOf(WILDCARD);

        // if we have any wildcards, tokenize them and ensure that a
        // "*" or "**" appear on their own with no characters mixed in.
        if (pos >= 0) {
            StringTokenizer tokens = new StringTokenizer(topic, SEPARATOR);
            String token = null;

            while (tokens.hasMoreTokens()) {
                token = tokens.nextToken();
                // contains a wildcard
                if (token.indexOf(WILDCARD) >= 0) {
                    if (!(token.equals(WILDCARD) ||
                        token.equals(ALL_WILDCARD))) {
                        return false;
                    }
                }
            }
        }

        return (pos >= 0);
    }

    /**
     * If it is a wildcard check to see that it matches the specified topic.
     *
     * if wildcard is **, its a an imediate match for every topic.
     * else
     *  tokenize both the wildcard and the topic.
     *  if the wildcard has less or equal no of tokens than the topic and
     *      ends in "**" check tokens
     *  if both wildcard and topic contain the same no of tokens check tokens
     *  Otherwise topic and wildcard do not match so return false.
     *
     * <P>Note we treat "a.b.c.*.*" and "a.b.c" as not a match at this stage,
     * since the wildcard is attempting to match more levels than exist in the
     * topic. if this proves to be unpopular with the masses, its a very
     * trivial change below to fix this problem.
     *
     * <P>Tokens are compared and must either be identical or the wildcard
     * token must be a "*" to match at this level. Once a mismatch is detected
     * the comparison is stopped and a false returned.
     *
     * <P>NOTE: This check assumes both the topic and wildcard topic have both
     * already been validated. if the topics are inavlid this test can return
     * arbitrary results.
     *
     * @param destination The specific topic to match to
     * @return True if the wildcard matches.
     */
    public boolean match(JmsTopic destination) {
        boolean matches = false;
        String topic = destination.getName();
        String wildcard = this.getName();
        if (wildcard.equals(ALL_WILDCARD)) {
            // Every topic match.
            matches = true;
        } else {
            StringTokenizer wildTokens =
                new StringTokenizer(wildcard, SEPARATOR);
            StringTokenizer topicTokens =
                new StringTokenizer(topic, SEPARATOR);
            String wildToken = null;
            String topicToken = null;
            int tokenCountDiff =
                topicTokens.countTokens() - wildTokens.countTokens();
            if ((tokenCountDiff == 0) ||
                (tokenCountDiff == -1) ||
                (tokenCountDiff > 0 && wildcard.indexOf(ALL_WILDCARD) >= 0)) {
                while (wildTokens.hasMoreTokens() &&
                    topicTokens.hasMoreTokens()) {
                    wildToken = wildTokens.nextToken();
                    topicToken = topicTokens.nextToken();
                    if (wildToken.equals(ALL_WILDCARD)) {
                        // we have a match.
                        matches = true;
                        break;
                    } else if (wildToken.equals(WILDCARD)) {
                        // this token matches.
                        matches = true;
                        continue;
                    } else if (wildToken.equals(topicToken)) {
                        // this token matches.
                        matches = true;
                        continue;
                    } else {
                        // no match. No point continuing further.
                        matches = false;
                        break;
                    }
                }
            }
        }

        return matches;
    }

    // implementation of Referenceable.getReference
    public Reference getReference() {
        Reference reference = null;

        // create the reference
        reference = new Reference(JmsTopic.class.getName(),
            new StringRefAddr("name", getName()),
            JmsDestinationFactory.class.getName(), null);

        // add the persistence attribute
        reference.add(new StringRefAddr("persistent",
            (getPersistent() ? "true" : "false")));

        return reference;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆精品国产91久久久使用方法| 亚洲第一二三四区| 欧美另类高清zo欧美| 99re成人精品视频| 风流少妇一区二区| 国产精品一二三区在线| 国产成人精品亚洲777人妖| 国产一区二区伦理片| 国产一区二区三区在线观看免费视频| 久久成人麻豆午夜电影| 麻豆精品视频在线观看免费| 另类调教123区 | 国产自产2019最新不卡| 免费久久99精品国产| 久久精品国产精品亚洲综合| 久久国产乱子精品免费女| 久久69国产一区二区蜜臀| 蜜臀av一区二区在线免费观看 | 精品国产凹凸成av人网站| 精品久久人人做人人爱| 国产区在线观看成人精品| 国产精品嫩草99a| 亚洲裸体xxx| 日韩高清不卡一区| 蜜桃视频在线观看一区二区| 国产一区二区三区久久悠悠色av| 国产成人在线影院 | av亚洲精华国产精华精| 国产呦萝稀缺另类资源| 在线视频国内一区二区| 在线国产电影不卡| 欧美高清激情brazzers| 久久免费视频一区| 亚洲欧美日韩在线不卡| 日韩国产欧美三级| 国产91综合一区在线观看| 91一区二区在线| 日韩一区和二区| 亚洲欧洲三级电影| 蜜臀va亚洲va欧美va天堂| 99免费精品视频| 91精品国产一区二区三区香蕉 | 91精品国产91久久久久久一区二区| 日韩一级片在线播放| 欧美日产在线观看| 蜜桃一区二区三区在线| 国产v日产∨综合v精品视频| 欧洲精品视频在线观看| 久久麻豆一区二区| 亚洲福利一区二区三区| 国产99久久久精品| 337p亚洲精品色噜噜噜| 中文字幕亚洲区| 精品在线播放免费| 欧美三级中文字幕在线观看| 国产精品久久久久永久免费观看| 激情六月婷婷久久| 91香蕉视频污| 中文字幕欧美激情| 精品一区二区影视| 91麻豆精品国产无毒不卡在线观看 | 午夜精品在线视频一区| 不卡av在线免费观看| 国产精品欧美久久久久无广告| ...xxx性欧美| 中文字幕 久热精品 视频在线| 日本三级亚洲精品| 欧美三级视频在线观看| 一区二区三区欧美| 成人激情午夜影院| 国产日韩欧美精品电影三级在线| 免费观看91视频大全| 欧美精品xxxxbbbb| 午夜精品久久久久久久99水蜜桃 | 婷婷中文字幕综合| 日本精品一区二区三区高清 | 欧美日韩国产美女| 一区二区三区国产精品| 久久久久久久久久久久久女国产乱| 亚洲成人动漫在线观看| 蜜臀av一级做a爰片久久| 欧美日韩精品系列| 午夜av一区二区三区| 欧美二区乱c少妇| 日韩成人精品在线| 欧美一区二区三区啪啪| 日本sm残虐另类| 日韩三级中文字幕| 狠狠v欧美v日韩v亚洲ⅴ| 久久综合狠狠综合久久综合88| 国内精品国产成人国产三级粉色 | 蜜桃91丨九色丨蝌蚪91桃色| 91.com视频| 精品一区二区三区在线播放视频| 日韩视频一区二区在线观看| 国精产品一区一区三区mba视频| 精品国产免费久久| 成人午夜免费电影| 亚洲成在人线在线播放| av在线一区二区三区| 欧美日韩中文字幕一区| 亚洲丰满少妇videoshd| 91精品国产91热久久久做人人| 毛片基地黄久久久久久天堂| 精品久久一二三区| 99久久婷婷国产综合精品| 亚洲午夜免费电影| 日韩精品在线网站| 成人av在线播放网址| 亚洲国产精品精华液网站| 久久综合丝袜日本网| 色综合中文字幕国产| 亚洲在线视频免费观看| 精品国产欧美一区二区| 色域天天综合网| 久久国产尿小便嘘嘘尿| 亚洲乱码中文字幕| 26uuu成人网一区二区三区| 972aa.com艺术欧美| 蜜臀国产一区二区三区在线播放| 成人免费视频播放| 亚洲欧洲日韩女同| 99久久99久久免费精品蜜臀| 天堂蜜桃91精品| 国产精品毛片无遮挡高清| 欧美人牲a欧美精品| aaa亚洲精品| 国产美女主播视频一区| 天天综合天天做天天综合| 一区在线观看免费| 久久色成人在线| 欧美一区永久视频免费观看| 色综合久久综合中文综合网| 国产麻豆精品一区二区| 人人精品人人爱| 一区二区三区成人| 国产精品九色蝌蚪自拍| 精品国产99国产精品| 91精品国产综合久久精品麻豆| 99热在这里有精品免费| 国产乱码精品一区二区三| 美女一区二区视频| 性欧美大战久久久久久久久| 成人免费一区二区三区在线观看| 久久精品这里都是精品| 欧美成人官网二区| 日韩欧美电影一二三| 欧美一区中文字幕| 91精品国产一区二区三区香蕉| 欧美日韩一区中文字幕| 欧美色精品在线视频| 欧美午夜精品免费| 欧美日本高清视频在线观看| 欧美三区在线观看| 欧美日韩亚洲综合| 欧美视频一区二区在线观看| 欧美最猛黑人xxxxx猛交| 色天天综合久久久久综合片| 91丨九色丨黑人外教| 在线亚洲免费视频| 欧美日韩一卡二卡三卡 | 国产精品欧美久久久久无广告| 久久免费偷拍视频| 欧美激情艳妇裸体舞| 欧美激情中文字幕| 亚洲女同一区二区| 亚洲专区一二三| 五月婷婷欧美视频| 蜜桃视频第一区免费观看| 久久爱另类一区二区小说| 国内成人免费视频| 99久久国产综合精品麻豆| 欧美色区777第一页| 日韩三级在线免费观看| 欧美国产欧美综合| 亚洲天堂精品在线观看| 午夜精品一区二区三区电影天堂| 毛片不卡一区二区| 成人av网在线| 欧美在线观看你懂的| 日韩精品在线看片z| 国产精品欧美久久久久一区二区| 亚洲一区二区精品久久av| 奇米一区二区三区| 成人91在线观看| 欧美日韩二区三区| 国产清纯美女被跳蛋高潮一区二区久久w | 精品对白一区国产伦| 中文字幕精品一区二区精品绿巨人 | 欧美mv和日韩mv国产网站| 国产欧美精品区一区二区三区| 一区二区三区四区中文字幕| 久久色在线观看| 精品国产不卡一区二区三区| 国产日产欧美一区二区三区| 日日夜夜精品视频免费| 91免费版在线| 国产一区二区电影| 欧美少妇一区二区| 国产情人综合久久777777|