All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.jms.QueueSender Maven / Gradle / Ivy

The newest version!
/**
 * Copyright 2013 ScalAgent Distributed Technologies
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  ---------------------------------------------------------------------
 *  $Id: QueueSender.java 6347 2013-03-13 08:52:02Z tachker $
 *  ---------------------------------------------------------------------
 */

package javax.jms;

/**
 * A client uses a {@code QueueSender} object to send messages to a queue.
 * 
 * @see javax.jms.MessageProducer
 * @see javax.jms.Session#createProducer(Destination)
 * @see javax.jms.QueueSession#createSender(Queue)
 * 
 * @version JMS 2.0
 * @since JMS 1.0
 * 
 */

public interface QueueSender extends MessageProducer {

  /**
   * Gets the queue associated with this {@code QueueSender}.
   * 
   * @return this sender's queue
   * 
   * @exception JMSException
   *              if the JMS provider fails to get the queue for this
   *              {@code QueueSender} due to some internal error.
   */

  Queue getQueue() throws JMSException;

  /**
   * Sends a message to the queue. Uses the {@code QueueSender}'s default
   * delivery mode, priority, and time to live.
   * 
   * @param message
   *          the message to send
   * 
   * @exception JMSException
   *              if the JMS provider fails to send the message due to some
   *              internal error.
   * @exception MessageFormatException
   *              if an invalid message is specified.
   * @exception InvalidDestinationException
   *              if a client uses this method with a {@code QueueSender} with
   *              an invalid queue.
   * @exception java.lang.UnsupportedOperationException
   *              if a client uses this method with a {@code QueueSender} that
   *              did not specify a queue at creation time.
   * 
   * @see javax.jms.MessageProducer#getDeliveryMode()
   * @see javax.jms.MessageProducer#getTimeToLive()
   * @see javax.jms.MessageProducer#getPriority()
   */

  void send(Message message) throws JMSException;

  /**
   * Sends a message to the queue, specifying delivery mode, priority, and time
   * to live.
   * 
   * @param message
   *          the message to send
   * @param deliveryMode
   *          the delivery mode to use
   * @param priority
   *          the priority for this message
   * @param timeToLive
   *          the message's lifetime (in milliseconds)
   * 
   * @exception JMSException
   *              if the JMS provider fails to send the message due to some
   *              internal error.
   * @exception MessageFormatException
   *              if an invalid message is specified.
   * @exception InvalidDestinationException
   *              if a client uses this method with a {@code QueueSender} with
   *              an invalid queue.
   * @exception java.lang.UnsupportedOperationException
   *              if a client uses this method with a {@code QueueSender} that
   *              did not specify a queue at creation time.
   */

  void send(Message message, int deliveryMode, int priority, long timeToLive)
      throws JMSException;

  /**
   * Sends a message to a queue for an unidentified message producer. Uses the
   * {@code QueueSender}'s default delivery mode, priority, and time to live.
   * 
   * @param queue
   *          the queue to send this message to
   * @param message
   *          the message to send
   * 
   * @exception JMSException
   *              if the JMS provider fails to send the message due to some
   *              internal error.
   * @exception MessageFormatException
   *              if an invalid message is specified.
   * @exception InvalidDestinationException
   *              if a client uses this method with an invalid queue.
   * 
   * @see javax.jms.MessageProducer#getDeliveryMode()
   * @see javax.jms.MessageProducer#getTimeToLive()
   * @see javax.jms.MessageProducer#getPriority()
   */

  void send(Queue queue, Message message) throws JMSException;

  /**
   * Sends a message to a queue for an unidentified message producer, specifying
   * delivery mode, priority and time to live.
   * 
   * @param queue
   *          the queue to send this message to
   * @param message
   *          the message to send
   * @param deliveryMode
   *          the delivery mode to use
   * @param priority
   *          the priority for this message
   * @param timeToLive
   *          the message's lifetime (in milliseconds)
   * 
   * @exception JMSException
   *              if the JMS provider fails to send the message due to some
   *              internal error.
   * @exception MessageFormatException
   *              if an invalid message is specified.
   * @exception InvalidDestinationException
   *              if a client uses this method with an invalid queue.
   */

  void send(Queue queue, Message message, int deliveryMode, int priority,
      long timeToLive) throws JMSException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy