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

📄 remotejmsserversessionifc.java

📁 实现了Jms的服务器源码,支持多种适配器,DB,FTP,支持多种数据库
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/**
 * 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 2000-2003 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: RemoteJmsServerSessionIfc.java,v 1.18 2003/08/07 13:33:10 tanderson Exp $
 *
 * Date         Author  Changes
 * 04/07/2000   jima    Created
 * 05/09/2000	jima	Changed acknowledgeMessage signature to take
 * 			destination name instead of client identity
 */
package org.exolab.jms.server.rmi;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Vector;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;

import org.exolab.jms.client.JmsQueue;
import org.exolab.jms.client.JmsTopic;
import org.exolab.jms.client.rmi.RemoteJmsMessageListenerIfc;


/**
 * This is an RMI wrapper for the JmsServerSession object. It allows remote
 * access to this object.
 * <p>
 * For more semantic information on this object refer to org.exolab.jms.server.
 * JmsServerSession.
 * <p>
 * All the methods throw RemoteException which is used to indicate an RMI
 * specific error.
 *
 * @version     $Revision: 1.18 $ $Date: 2003/08/07 13:33:10 $
 * @author      <a href="mailto:jima@exoffice.com">Jim Alateras</a>
 * @see         org.exolab.jms.server.JmsServerSession
 * @see         org.exolab.jms.server.rmi.RemoteJmsServerConnectionIfc
 **/
public interface RemoteJmsServerSessionIfc
    extends Remote {

    /**
     * Return a reference to the client id.
     *
     * @return      String      client id
     * @exception   RemoteException
     */
    public String getClientId()
        throws RemoteException;

    /**
     * Return a reference to the session id
     *
     * @return      String      session id
     * @exception   RemoteException
     */
    public String getSessionId()
        throws JMSException, RemoteException;

    /**
     * Close and release any resource allocated to this session. Throw the
     * JMSException exception is a problem is encountered
     *
     * @exception   JMSException
     * @exception   RemoteException
     */
    public void close()
        throws JMSException, RemoteException;

    /**
     * Acknowledge that the message with the following id has been processed
     *
     * @param       clientId            the client identity
     * @param       messageId           id of message to ack
     * @exception   JMSException        if method does not complete
     * @exception   RemoteException
     */
    public void acknowledgeMessage(long clientId, String messageId)
        throws JMSException, RemoteException;

    /**
     * Send the specified message to the server. If there is any problem
     * then throw the JMSException exception
     *
     * @param       message             message to send
     * @exception   JMSException
     * @exception   RemoteException
     */
    public void sendMessage(Message message)
        throws JMSException, RemoteException;

    /**
     * Send the specified messages to the server. If there is any problem
     * then throw the JMSException exception
     *
     * @param       messages            messages to send
     * @exception   JMSException
     * @exception   RemoteException
     */
    public void sendMessages(Vector messages)
        throws JMSException, RemoteException;

    /**
     * Return the next message for the specified client. The <code>wait</code>
     * parameter indicates how long many milliseconds to wait for a message
     * before returning. If <code>wait</code> is 0 then do not wait at all. If
     * <code>wait</code> is -1 then wait indefinitely for the next message
     *
     * @param       clientId            the client identity
     * @param       wait                number of ms to wait
     * @return      Message             the next message or null
     * @exception   JMSException        if there is an app level problem
     * @exception   RemoteException     if there is a RMI based exception.
     */
    public Message receiveMessage(long clientId, long wait)
        throws JMSException, RemoteException;

    /**
     * Return upto count messages from the endpoint with the specified client
     * identity.
     *
     * @param       clientId            the client identity
     * @param       count               max number of messages to receive
     * @return      Message             the next message or null
     * @exception   JMSException        if there is an app level problem
     * @exception   RemoteException     if there is a RMI based exception.
     */
    public Vector receiveMessages(long clientId, int count)
        throws JMSException, RemoteException;

    /**
     * Create a queue with the specified name. If the queue already exists
     * then simply return a reference to it. If the queue does not exist
     * then create it. If it cannot create the queue then throw the
     * JMSException exception
     *
     * @param       queue               queue to create
     * @exception   JMSException
     * @exception   RemoteException
     */
    public void createQueue(JmsQueue queue)
        throws JMSException, RemoteException;

    /**
     * Create a topic with the specified name. If the topic already exists
     * then simply return a reference to it. If the topic does not exist
     * then create it. If it cannot create the topic then throw the
     * JMSException exception
     *
     * @param       topic               topic to create
     * @exception   JMSException
     * @exception   RemoteException
     */
    public void createTopic(JmsTopic topic)
        throws JMSException, RemoteException;

    /**
     * Create a receiver endpoint for this session. A reciever is a message
     * consumer specific to the queue message model. The receiver is
     * associated with a queue.
     * <p>
     * You cannot create more than one receiver for the same destination
     *
     * @param       queue               receiver destination
     * @param       clientId            the session allocated identifier of
     *                                  this consumer
     * @param       selector            the selector to filter messages.
     *                                  This may be null.
     * @exception   JMSException.
     * @exception   RemoteException
     */
    public void createReceiver(JmsQueue queue, long clientId, String selector)
        throws JMSException, RemoteException;

    /**
     * Create a sender endpoint for this session. A sender is a message
     * publisher specific to the queue message model. The sender is associated
     * with a queue.
     * <p>
     *
     * You cannot create more than one receiver for the same destination
     *
     * @param       queue               receiver destination
     * @exception   JMSException.
     * @exception   RemoteException
     */
    public void createSender(JmsQueue queue)
        throws JMSException, RemoteException;

    /**
     * Delete the receiver with the specified identity. If the receiver does
     * not exist or cannot be deleted throw JMSException
     *
     * @param       queue
     * @exception   JMSException.
     * @exception   RemoteException
     */

    /**
     * Create a queue browser for this session. This allows clients to browse
     * a queue without removing any messages.
     * <p>
     *
     * You cannot create more than one queue browser for the same queue
     * in a single session.
     *
     * @param       queue               queue to browse
     * @param       clientId            identity of the client
     * @param       selector            message selector. This may be null
     * @exception   JMSException
     * @exception   RemoteException
     */
    public void createBrowser(JmsQueue queue, long clientId, String selector)
        throws JMSException, RemoteException;

    /**
     * Delete the specified receiver
     *
     * @param       clientId            the identity of the receiver
     * @exception   JMSException.
     * @exception   RemoteException
     */
    public void deleteReceiver(long clientId)
        throws JMSException, RemoteException;

    /**
     * Delete the sender for the specified queue. If the sender does not
     * exist or the sender cannot be deleted then throw JMSException
     *
     * @param       clientId             the unique client identity
     * @exception   JMSException.
     * @exception   RemoteException
     */
    public void deleteSender(long clientId)
        throws JMSException, RemoteException;

⌨️ 快捷键说明

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