📄 jmssessionstubifc.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 2000-2003 (C) Exoffice Technologies Inc. All Rights Reserved.
*
* $Id: JmsSessionStubIfc.java,v 1.20 2003/08/17 01:32:21 tanderson Exp $
*
* Date Author Changes
* 04/12/2000 jima Created
*/
package org.exolab.jms.client;
import java.util.Vector;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
/**
* This is the interface that session stubs must implement in order to
* support remote invocations. This level of indirection will enable us to
* support different ORB environments. The only restriction is that the
* stubs must support this interface and that it must have a default
* constructor.
*
* @version $Revision: 1.20 $ $Date: 2003/08/17 01:32:21 $
* @author <a href="mailto:jima@exoffice.com">Jim Alateras</a>
*/
public interface JmsSessionStubIfc {
/**
* Return the client id associated with this session.
*
* @return the client id associated with this session
* @throws JMSException for any JMS error
*/
String getClientId() throws JMSException;
/**
* Return the session identity. Session identities are unique
* within the context of a server.
*
* @return the session identity
* @throws JMSException for any JMS error
*/
String getSessionId() throws JMSException;
/**
* This method is called before the call to <code>close</code>, so that the
* stub can do some local clean up
*
* @throws JMSException for any JMS error
*/
void beforeClose() throws JMSException;
/**
* Close and release any resource allocated to this session.
*
* @throws JMSException for any JMS error
*/
void close() throws JMSException;
/**
* Acknowledge the following message If this method does not complete then
* throw JMSException.
*
* @param clientId the identity ofthe client
* @param messageId the message identity to ack
* @throws JMSException for any JMS error
*/
void acknowledgeMessage(long clientId, String messageId)
throws JMSException;
/**
* Send the specified message to the server. If there is any problem
* then throw the JMSException exception
*
* @param message the message to send
* @throws JMSException for any JMS error
*/
void sendMessage(Message message) throws JMSException;
/**
* Send the specified messages to the server. If there is any problem
* then throw the JMSException exception
*
* @param messages the messages to send
* @throws JMSException for any JMS error
*/
void sendMessages(Vector messages) throws JMSException;
/**
* Return the next message for the specified client. The client id
* maps to a consumer on the server side. The caller can also specify
* how long to wait if no messages are currently available. If the caller
* specifies 0 then the call will return immediately if there are no
* messages available. If the caller specified -1 then the call will
* block until a message becomes available.
*
* @param clientId the client identity
* @param wait the number of ms to wait. -1 means wait indefinitely.
* @return the next message or null
* @throws JMSException for any JMS error
*/
Message receiveMessage(long clientId, long wait) throws JMSException;
/**
* Return a collection of messages from the specified client upto the
* nominated count. This method may return less than count messages
* but it will never return more than count messages
*
* @param client the client identity
* @param count max messages to return
* @return collection of MessageImpl objects
* @throws JMSException for any JMS error
*/
Vector receiveMessages(long clientId, int count) throws JMSException;
/**
* 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.
*
* @param queue the queue to create
* @throws JMSException for any JMS error
*/
void createQueue(JmsQueue queue) throws JMSException;
/**
* 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.
*
* @param topic the topic to create
* @throws JMSException for any JMS error
*/
void createTopic(JmsTopic topic) throws JMSException;
/**
* 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 the receiver destination
* @param clientId the session allocated identifier of this consumer
* @param selector the message selector. This may be null.
* @return the unique consumer identifier
* @throws JMSException for any JMS error
*/
void createReceiver(JmsQueue queue, long clientId, String selector)
throws JMSException;
/**
* 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 the receiver destination
* @throws JMSException for any JMS error
*/
void createSender(JmsQueue queue) throws JMSException;
/**
* 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 the queue to browse
* @param clientId the client identity
* @param selector the message selector. This may be null
* @throws JMSException for any JMS error
*/
void createBrowser(JmsQueue queue, long clientId, String selector)
throws JMSException;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -