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

javax.jms.QueueConnection 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: QueueConnection.java 6347 2013-03-13 08:52:02Z tachker $
 *  ---------------------------------------------------------------------
 */

package javax.jms;

/**
 * A {@code QueueConnection} object is an active connection to a point-to-point
 * JMS provider. A client uses a {@code QueueConnection} object to create one or
 * more {@code QueueSession} objects for producing and consuming messages.
 * 
 * @see javax.jms.Connection
 * @see javax.jms.ConnectionFactory
 * @see javax.jms.QueueConnectionFactory
 * 
 * @version JMS 2.0
 * @since JMS 1.0
 * 
 */

public interface QueueConnection extends Connection {

  /**
   * Creates a {@code QueueSession} object.
   * 
   * @param transacted
   *          indicates whether the session is transacted
   * @param acknowledgeMode
   *          indicates whether the consumer or the client will acknowledge any
   *          messages it receives; ignored if the session is transacted. Legal
   *          values are {@code Session.AUTO_ACKNOWLEDGE},
   *          {@code Session.CLIENT_ACKNOWLEDGE}, and
   *          {@code Session.DUPS_OK_ACKNOWLEDGE}.
   * 
   * @return a newly created queue session
   * 
   * @exception JMSException
   *              if the {@code QueueConnection} object fails to create a
   *              session due to some internal error or lack of support for the
   *              specific transaction and acknowledgement mode.
   * 
   * @see Session#AUTO_ACKNOWLEDGE
   * @see Session#CLIENT_ACKNOWLEDGE
   * @see Session#DUPS_OK_ACKNOWLEDGE
   */

  QueueSession createQueueSession(boolean transacted, int acknowledgeMode)
      throws JMSException;

  /**
   * Creates a connection consumer for this connection (optional operation).
   * 
   * @param queue
   *          the queue to access
   * @param messageSelector
   *          only messages with properties matching the message selector
   *          expression are delivered. A value of null or an empty string
   *          indicates that there is no message selector for the message
   *          consumer.
   * @param sessionPool
   *          the server session pool to associate with this connection consumer
   * @param maxMessages
   *          the maximum number of messages that can be assigned to a server
   *          session at one time
   * 
   * @return the connection consumer
   * 
   * @exception JMSException
   *              if the {@code QueueConnection} object fails to create a
   *              connection consumer due to some internal error or invalid
   *              arguments for {@code sessionPool} and {@code messageSelector}.
   * @exception InvalidDestinationException
   *              if an invalid queue is specified.
   * @exception InvalidSelectorException
   *              if the message selector is invalid.
   * @see javax.jms.ConnectionConsumer
   */

  ConnectionConsumer createConnectionConsumer(Queue queue,
      String messageSelector, ServerSessionPool sessionPool, int maxMessages)
      throws JMSException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy