messagecache.java

来自「一个java方面的消息订阅发送的源码」· Java 代码 · 共 69 行

JAVA
69
字号
package org.exolab.jms.messagemgr;

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

import org.exolab.jms.message.MessageImpl;


/**
 * MessageCache is responsible for managing a collection of messages.
 * Messages in the cache are referenced via {@link MessageRef} instances
 *
 * @version     $Revision: 1.2 $ $Date: 2005/03/18 03:58:39 $
 * @author      <a href="mailto:tma@netspace.net.au">Tim Anderson</a>
 */
public interface MessageCache {

    /**
     * Add a reference and its corresponding message to the cache
     *
     * @param reference the reference to the message
     * @param message the message
     */
    void addMessage(MessageRef reference, MessageImpl message);

    /**
     * Adds a message reference to the cache
     *
     * @param reference the message reference to add
     */
    void addMessageRef(MessageRef reference);

    /**
     * Returns a message reference, given its identifier
     *
     * @param messageId the message identifier
     * @return the message reference associated with <code>messageId</code>,
     * or <code>null</code>  if none exists
     */
    MessageRef getMessageRef(String messageId);

    /**
     * Returns the message corresponding to the specified reference
     *
     * @param reference the message reference
     * @return the associated message, or <code>null</code> if none exists
     * @throws JMSException for any error
     */
    MessageImpl getMessage(MessageRef reference)
            throws JMSException;

    /**
     * Destroys the message corresponding to the reference
     *
     * @throws JMSException for any error
     */
    void destroy(MessageRef reference) throws JMSException;

    /**
     * Destroys the message corresponding to the reference
     *
     * @param connection the database connection to use
     * @throws JMSException for any error
     */
    void destroy(MessageRef reference, Connection connection)
            throws JMSException;

}

⌨️ 快捷键说明

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