⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messagehandle.java

📁 实现了Jms的服务器源码,支持多种适配器,DB,FTP,支持多种数据库
💻 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 2001-2003 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: MessageHandle.java,v 1.9 2003/08/17 01:32:24 tanderson Exp $
 *
 * Date         Author  Changes
 * 3/1/2001     jima    Created
 */
package org.exolab.jms.message;

import java.io.Externalizable;

import javax.jms.DeliveryMode;
import javax.jms.JMSException;
import javax.jms.Message;

import org.exolab.jms.client.JmsDestination;


/**
 * A message handle is used to indirectly reference a message in
 * the message manager.
 *
 * @version     $Revision: 1.9 $ $Date: 2003/08/17 01:32:24 $
 * @author      <a href="mailto:jima@exoffice.com">Jim Alateras</a>
 * @see         org.exolab.jms.messagemgr.MessageMgr
 * @see         org.exolab.jms.messagemgr.TransientMessageHandle
 * @see         org.exolab.jms.messagemgr.PersistentMessageHandle
 */
public interface MessageHandle
    extends Externalizable {

    /**
     * Return the message id
     *
     * @return MessgeId
     */
    public MessageId getMessageId();

    /**
     * Set the message, corresponding to this handle, has already been
     * delivered once before
     */
    public void setDelivered();

    /**
     * Set the state of the delivered flag to the specified value
     *
     * @param boolean value
     */
    public void setDelivered(boolean value);

    /**
     * Check whether an attempt has already been made to deliver the message
     * before.
     *
     * @return boolean - true implies redelivery attempted
     */
    public boolean getDelivered();

    /**
     * Set the priority of the message handle
     *
     * @param priority
     */
    public void setPriority(int priority);

    /**
     * Return the priority of the underlying message
     */
    public int getPriority();

    /**
     * Set the time that the message was accepted by the server
     *
     * @param time - time that it was set in ms
     */
    public void setAcceptedTime(long time);

    /**
     * Return time that the corresponding message was accepted.
     */
    public long getAcceptedTime();

    /**
     * Set the time that the message will expire
     *
     * @param time - time that it was set in ms
     */
    public void setExpiryTime(long time);

    /**
     * Return time that the message expires.
     */
    public long getExpiryTime();

    /**
     * Set the sequence nmber for the handle. This is set by the
     * message manager.
     *
     * @param seq - the sequence number
     */
    public void setSequenceNumber(long seq);

    /**
     * Retrieve the handle's sequence number
     *
     * @return long
     */
    public long getSequenceNumber();

    /**
     * Set the destination for this handle
     *
     * @param dest - the message destination
     */
    public void setDestination(JmsDestination dest);

    /**
     * Retrieve the destination for this handle
     *
     * @return JmsDestination
     */
    public JmsDestination getDestination();

    /**
     * Set the client id, that owns this handle
     *
     * @param clientId - client identity
     */
    public void setClientId(long clientId);

    /**
     * Retrieve the client identity associated with this handle
     *
     * @return long
     */
    public long getClientId();

    /**
     * Set 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.
     *
     * @param name - consumer name
     */
    public void setConsumerName(String name);

    /**
     * Check whether the the {@link DeliveryMode} of the underlying message
     * is PERSISTENT
     */
    public boolean isPersistent();

    /**
     * Return the consumer namne
     *
     * @return String
     */
    public String getConsumerName();

    /**
     * Return the associated message or null if it is invalid
     *
     * @return  MessageImpl
     */
    public MessageImpl getMessage();

    /**
     * Destory this handle
     */
    public void destroy();

    /**
     * Clear the message handle
     */
    public void clear();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -