
javax.jms.TopicConnection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ow2-jms-2.0-spec Show documentation
Show all versions of ow2-jms-2.0-spec Show documentation
The Java Message Service (JMS) API, version 2.0
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: TopicConnection.java 6347 2013-03-13 08:52:02Z tachker $
* ---------------------------------------------------------------------
*/
package javax.jms;
/**
* A {@code TopicConnection} object is an active connection to a
* publish/subscribe JMS provider. A client uses a {@code TopicConnection} object
* to create one or more {@code TopicSession} objects for producing and consuming
* messages.
*
* @see javax.jms.Connection
* @see javax.jms.ConnectionFactory
* @see javax.jms.TopicConnectionFactory
*
* @version JMS 2.0
* @since JMS 1.0
*
*/
public interface TopicConnection extends Connection {
/**
* Creates a {@code TopicSession} 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 topic session
*
* @exception JMSException
* if the {@code TopicConnection} 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
*/
TopicSession createTopicSession(boolean transacted, int acknowledgeMode)
throws JMSException;
/**
* Creates a connection consumer for this connection (optional operation).
* This is an expert facility not used by regular JMS clients.
*
* @param topic
* the topic 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 TopicConnection} 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 topic is specified.
* @exception InvalidSelectorException
* if the message selector is invalid.
* @see javax.jms.ConnectionConsumer
*/
ConnectionConsumer createConnectionConsumer(Topic topic,
String messageSelector, ServerSessionPool sessionPool, int maxMessages)
throws JMSException;
/**
* Create a durable connection consumer for this connection (optional
* operation). This is an expert facility not used by regular JMS clients.
*
* @param topic
* the topic to access
* @param subscriptionName
* durable subscription name
* @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 durable connection
* consumer
* @param maxMessages
* the maximum number of messages that can be assigned to a server
* session at one time
*
* @return the durable connection consumer
*
* @exception JMSException
* if the {@code TopicConnection} 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 topic is specified.
* @exception InvalidSelectorException
* if the message selector is invalid.
* @see javax.jms.ConnectionConsumer
*/
ConnectionConsumer createDurableConnectionConsumer(Topic topic,
String subscriptionName, String messageSelector,
ServerSessionPool sessionPool, int maxMessages) throws JMSException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy