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

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

?? abstractmessagehandle.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 2005 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: AbstractMessageHandle.java,v 1.1 2005/03/18 03:58:38 tanderson Exp $
 */
package org.exolab.jms.messagemgr;

import java.sql.Connection;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;

import org.exolab.jms.client.JmsDestination;
import org.exolab.jms.message.MessageImpl;
import org.exolab.jms.persistence.PersistenceException;
import org.exolab.jms.server.ServerConnection;


/**
 * Abstract implementation of the {@link MessageHandle} interface
 *
 * @author <a href="mailto:tma@netspace.net.au">Tim Anderson</a>
 * @version $Revision: 1.1 $ $Date: 2005/03/18 03:58:38 $
 */
public abstract class AbstractMessageHandle implements MessageHandle {

    /**
     * The message reference.
     */
    private MessageRef _reference;

    /**
     * The message identifier.
     */
    private final String _messageId;

    /**
     * If <code>true</code>, indicates that the message associated with the
     * handle has been delivered, but not acknowledged.
     */
    private boolean _delivered = false;

    /**
     * The message priority.
     */
    private final int _priority;

    /**
     * The time that the message was accepted by the server, in milliseconds.
     */
    private long _acceptedTime;

    /**
     * The message sequence number, assigned by the {@link MessageMgr}, used to
     * help order the message. It also allows us to overcome the millisecond
     * resolution problem of _acceptedTime, when ordering messages
     */
    private final long _sequenceNumber;

    /**
     * The time that the message expires, in milliseconds.
     */
    private long _expiryTime;

    /**
     * The destination that this handle belongs to.
     */
    private final JmsDestination _destination;

    /**
     * The identity of the {@link ConsumerEndpoint} associated with the message,
     * or  <code>-1</code> if it isn't associated with any consumer.
     */
    private final long _consumerId;

    /**
     * The identity of the {@link ServerConnection} associated with the message,
     * or <code>-1</code> if it isn't associated with any connection.
     */
    private final long _connectionId;


    /**
     * Construct a new <code>AbstractMessageHandle</code>.
     *
     * @param reference the reference to the message
     * @param message   the message for which the handle is created
     * @throws JMSException if the handle cannot be constructed
     */
    public AbstractMessageHandle(MessageRef reference, MessageImpl message)
            throws JMSException {
        if (reference == null) {
            throw new IllegalArgumentException("Argument 'reference' is null");
        }
        if (message == null) {
            throw new IllegalArgumentException("Argument 'message' is null");
        }
        _messageId = message.getMessageId().getId();
        _delivered = message.getJMSRedelivered();
        _priority = message.getJMSPriority();
        _acceptedTime = message.getAcceptedTime();
        _sequenceNumber = message.getSequenceNumber();
        _expiryTime = message.getJMSExpiration();
        _destination = (JmsDestination) message.getJMSDestination();
        _consumerId = message.getConsumerId();
        _connectionId = message.getConnectionId();
        _reference = reference;
    }

    /**
     * Construct a new <code>AbstractMessageHandle</code>.
     *
     * @param messageId      the message identifier
     * @param priority       the message priority
     * @param acceptedTime   the time the message was accepted by the server
     * @param sequenceNumber the message sequence number
     * @param expiryTime     the time that the message will expire
     */
    public AbstractMessageHandle(String messageId, int priority,
                                 long acceptedTime, long sequenceNumber,
                                 long expiryTime, JmsDestination destination) {
        if (messageId == null) {
            throw new IllegalArgumentException("Argument 'messageId' is null");
        }
        if (destination == null) {
            throw new IllegalArgumentException(
                    "Argument 'destination' is null");
        }
        _messageId = messageId;
        _priority = priority;
        _acceptedTime = acceptedTime;
        _sequenceNumber = sequenceNumber;
        _expiryTime = expiryTime;
        _destination = destination;
        _consumerId = -1;
        _connectionId = -1;
    }

    /**
     * Returns the message identifier.
     *
     * @return the message identifier
     */
    public String getMessageId() {
        return _messageId;
    }

    /**
     * Returns the message associated with this handle.
     *
     * @return the associated message, or <code>null</code> if the handle is no
     *         longer valid
     * @throws JMSException for any error
     */
    public MessageImpl getMessage() throws JMSException {
        if (_reference == null) {
            throw new JMSException("Cannot get message with identifier="
                                   + _messageId + ": MessageRef null");
        }
        return _reference.getMessage();
    }


    /**
     * Indicates if a message has been delivered to a {@link MessageConsumer},
     * but not acknowledged.
     *
     * @param delivered if <code>true</code> indicates that an attempt has been
     *                  made to deliver the message
     */
    public void setDelivered(boolean delivered) {
        _delivered = delivered;
    }

    /**
     * Returns if an attempt has already been made to deliver the message.
     *
     * @return <code>true</code> if delivery has been attempted
     */
    public boolean getDelivered() {
        return _delivered;
    }

    /**
     * Returns the priority of the message.
     *
     * @return the message priority
     */
    public int getPriority() {
        return _priority;
    }

    /**
     * Returns the time that the corresponding message was accepted, in
     * milliseconds.
     *
     * @return the time that the corresponding message was accepted
     */
    public long getAcceptedTime() {
        return _acceptedTime;
    }

    /**
     * Returns the time that the message expires.
     *
     * @return the expiry time
     */
    public long getExpiryTime() {
        return _expiryTime;
    }

    /**
     * Determines if the message has expired.
     *
     * @return <code>true</code> if the message has expired, otherwise
     *         <code>false</code>
     */
    public boolean hasExpired() {
        return (_expiryTime != 0 && _expiryTime <= System.currentTimeMillis());
    }

    /**
     * Returns the handle's sequence number.
     *
     * @return the sequence number
     */
    public long getSequenceNumber() {
        return _sequenceNumber;
    }

    /**
     * Returns the message destination.
     *
     * @return the message destination
     */
    public JmsDestination getDestination() {
        return _destination;
    }

    /**
     * Returns the consumer identity associated with the message.
     *
     * @return the consumer identity associated with the message, or *
     *         <code>-1</code> if the message isn't associated with a consumer
     */
    public long getConsumerId() {
        return _consumerId;
    }

    /**
     * Returns the persistent identity of the the consumer endpoint that owns
     * this handle. If it is set, then a consumer owns it exclusively, otherwise
     * the handle may be shared across a number of consumers.
     *
     * @return <code>null</code>
     */
    public String getConsumerPersistentId() {
        return null;
    }

    /**
     * Returns the connection identity associated with this handle.
     *
     * @return the connection identity associated with this handle, or
     *         <code>-1</code> if this isn't associated with a connection
     */
    public long getConnectionId() {
        return _connectionId;
    }

    /**
     * Determines if the handle is persistent.
     *
     * @return <code>false</code>
     */
    public boolean isPersistent() {
        return false;
    }

    /**
     * Indicates whether some other object is "equal to" this one.
     *
     * @param object the reference object with which to compare.
     * @return <code>true</code> if <code>object</code> is a MessageHandle, and
     *         has the same {@link #getMessageId()
     */
    public boolean equals(Object object) {
        boolean result = (object instanceof MessageHandle);
        if (result) {
            result = _messageId.equals(((MessageHandle) object).getMessageId());
        }
        return result;
    }

    /**
     * Returns a hash code value for the object.
     *
     * @return a hash code value for this object
     */
    public int hashCode() {
        return _messageId.hashCode();
    }

    /**
     * Return a stringified version of the handle.
     *
     * @return a stringified version of the handle
     */
    public String toString() {
        return "MessageHandle : " + _priority + ":" + getAcceptedTime() +
                ":" + getSequenceNumber() + ":" + _messageId;
    }

    /**
     * Destroy this handle. If this is the last handle to reference the message,
     * also destroys the message.
     *
     * @throws JMSException for any error
     */
    public void destroy() throws JMSException {
        getMessageRef().dereference();
    }

    /**
     * Destroy this handle. If this is the last handle to reference the message,
     * also destroys the message.
     *
     * @param connection the connection to use
     * @throws JMSException         for any error
     * @throws PersistenceException for any persistence error
     */
    public void destroy(Connection connection) throws JMSException,
            PersistenceException {
        getMessageRef().dereference();
    }

    /**
     * Returns the message reference.
     *
     * @return the message reference, or <code>null</code> if none has been set
     */
    public MessageRef getMessageRef() {
        return _reference;
    }

    /**
     * Sets the message reference.
     *
     * @param reference the reference to the message
     */
    protected void setMessageRef(MessageRef reference) {
        _reference = reference;
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看日韩电影| 午夜精品123| 日韩av午夜在线观看| 国产91在线看| 日韩精品一区二区三区蜜臀 | 9191成人精品久久| 国产精品视频线看| 久草中文综合在线| 欧美精品日日鲁夜夜添| 亚洲色图.com| 成人久久视频在线观看| 精品电影一区二区| 日韩av在线免费观看不卡| 一本色道久久综合狠狠躁的推荐 | 99精品视频一区二区三区| 精品裸体舞一区二区三区| 亚洲综合一二区| 91在线小视频| 成人欧美一区二区三区1314| 激情文学综合网| 日韩精品一区二区三区三区免费 | 国产精品久久久久久久久晋中| 欧美aaaaaa午夜精品| 欧美日韩亚洲综合一区二区三区| 亚洲素人一区二区| 91蜜桃视频在线| 国产精品不卡视频| 99久久婷婷国产精品综合| 日本一区二区三区dvd视频在线| 国产一区二区不卡老阿姨| 精品久久99ma| 国产精品中文有码| 国产亲近乱来精品视频| 国产精品一二三在| 国产无遮挡一区二区三区毛片日本| 久草中文综合在线| 欧美精品一区男女天堂| 国产精品主播直播| 国产精品乱人伦| 色综合久久久久| 一区二区日韩av| 在线不卡中文字幕| 免费在线看成人av| 精品国产乱码久久久久久牛牛 | 久久影音资源网| 国产米奇在线777精品观看| 久久久99久久精品欧美| 成人精品免费视频| 怡红院av一区二区三区| 欧美男女性生活在线直播观看| 日韩成人一级片| 久久久久免费观看| 91网站黄www| 五月天亚洲精品| 久久一留热品黄| 91视频在线观看免费| 亚洲国产成人精品视频| 日韩欧美在线网站| 成人免费毛片aaaaa**| 一区二区久久久| 精品人伦一区二区色婷婷| www.久久精品| 日韩制服丝袜先锋影音| 欧美国产精品劲爆| 欧美日韩久久久| 国产精品白丝jk黑袜喷水| 亚洲乱码国产乱码精品精98午夜| 欧美一区二区三区不卡| 94色蜜桃网一区二区三区| 日韩精品1区2区3区| 国产精品美女久久久久久久久| 欧美午夜一区二区三区免费大片| 激情综合五月婷婷| 亚洲综合色网站| 久久精品人人做人人综合| 色婷婷av久久久久久久| 九九精品一区二区| 亚洲一卡二卡三卡四卡五卡| 国产亚洲一二三区| 欧美一区二区三区四区久久 | 国产一区二区三区在线观看免费 | 国产精品激情偷乱一区二区∴| 欧美色倩网站大全免费| 国产成人三级在线观看| 视频一区中文字幕| 亚洲视频综合在线| 国产亚洲美州欧州综合国| 69av一区二区三区| 日本丶国产丶欧美色综合| 国产精品亚洲一区二区三区妖精 | 欧美福利电影网| 色香色香欲天天天影视综合网| 国内精品写真在线观看| 亚洲一区二区在线免费看| 国产精品嫩草99a| 精品少妇一区二区三区视频免付费 | 99久久99久久精品国产片果冻 | 久久精品男人天堂av| 欧美一区二区久久| 欧美午夜在线观看| 色哟哟日韩精品| 91美女福利视频| 99精品视频中文字幕| 成人综合在线网站| 国产.精品.日韩.另类.中文.在线.播放| 日韩电影免费一区| 日韩成人一级片| 日本伊人色综合网| 日日摸夜夜添夜夜添国产精品| 亚洲一区二区三区影院| 亚洲精品成人精品456| 日韩久久一区二区| 亚洲色图第一区| 亚洲男人的天堂在线观看| 亚洲日本电影在线| 亚洲品质自拍视频| 一区二区视频在线看| 亚洲色图清纯唯美| 日韩毛片精品高清免费| 亚洲日本电影在线| 亚洲伊人色欲综合网| 亚洲mv在线观看| 日韩电影一区二区三区四区| 久久精品国产亚洲a| 国产精品自拍三区| 99国产精品99久久久久久| 色综合天天综合在线视频| 在线免费观看日本欧美| 欧美日韩一区 二区 三区 久久精品| 欧美日韩1234| 欧美videos大乳护士334| 国产亚洲自拍一区| 亚洲欧美国产高清| 日日夜夜免费精品| 久久激情五月激情| 粉嫩久久99精品久久久久久夜| aaa亚洲精品| 欧美日韩免费电影| 精品不卡在线视频| 国产精品久久久久久久久动漫 | 国内精品伊人久久久久av影院| 国产成人在线免费观看| av不卡免费在线观看| 欧美日韩精品一区二区| 精品国产免费久久| 中文字幕制服丝袜成人av| 亚洲成av人综合在线观看| 国产一区视频在线看| 99久久综合99久久综合网站| 欧美三级电影在线看| 久久青草欧美一区二区三区| 一区二区三区影院| 国产一区二区h| 欧美日本在线视频| 国产精品久久毛片a| 奇米色一区二区三区四区| 成人av网站免费| 日韩精品中文字幕一区| 亚洲欧美日本在线| 国产精品综合久久| 欧美精品xxxxbbbb| 中文字幕在线免费不卡| 日本美女一区二区三区视频| 99精品视频在线播放观看| 欧美成人综合网站| 亚洲影视在线观看| 不卡电影一区二区三区| 亚洲精品在线免费播放| 午夜精品久久久久久久久久久| 高清beeg欧美| 欧美变态凌虐bdsm| 香蕉久久一区二区不卡无毒影院| 成人动漫精品一区二区| 26uuu精品一区二区 | 一区二区三区高清| 成人精品国产一区二区4080| 精品国内二区三区| 日韩电影在线一区二区| 91成人网在线| 综合av第一页| av午夜一区麻豆| 久久久久成人黄色影片| 久久国产三级精品| 欧美丰满少妇xxxxx高潮对白 | 在线免费观看日本欧美| 国产精品欧美久久久久一区二区| 精一区二区三区| 91麻豆精品国产综合久久久久久| 亚洲免费观看高清完整版在线| 国产**成人网毛片九色| 久久久国产精品不卡| 精品综合免费视频观看| 欧美精品一区二| 久久66热re国产| 精品国产乱码久久久久久免费| 久久精品国产99国产| 欧美一区二区三区免费大片 | 亚洲狠狠丁香婷婷综合久久久| av午夜精品一区二区三区| 国产精品午夜久久|