com.ibm.mq.jms
Class MQQueueConnection
java.lang.Object
|
+--com.ibm.mq.jms.MQConnection
|
+--com.ibm.mq.jms.MQQueueConnection
- All Implemented Interfaces:
- javax.jms.Connection, javax.jms.QueueConnection
- Direct Known Subclasses:
- MQXAQueueConnection
- public class MQQueueConnection
- extends MQConnection
- implements javax.jms.QueueConnection
An MQueueConnection is an active connection to a JMS point-to-point provider.
A client uses an MQQueueConnection to create one or more MQQueueSessions for producing
and consuming messages.
- See Also:
Connection
,
QueueConnectionFactory
,
XAQueueConnection
Method Summary |
void |
close()
Closes this connection and release its resources. |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Topic topic,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessageCount)
Creates a connection consumer for this connection.
|
javax.jms.QueueSession |
createQueueSession(boolean transacted,
int acknowledgeMode)
Creates an MQQueueSession object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.jms.QueueConnection |
createConnectionConsumer |
Methods inherited from interface javax.jms.Connection |
createConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop |
createQueueSession
public javax.jms.QueueSession createQueueSession(boolean transacted,
int acknowledgeMode)
throws javax.jms.JMSException
- Creates an MQQueueSession object.
- Specified by:
createQueueSession
in interface javax.jms.QueueConnection
- Parameters:
transacted
- - indicates whether the session is transacted.acknowledgeMode
- - indicates whether the consumer or the client will
acknowledge any messages it receives; ignored if the session is
transacted. Legal values are Session.AUTO_ACKNOWLEDGE,
Session.CLIENT_ACKNOWLEDGE, and Session.DUPS_OK_ACKNOWLEDGE.
- Returns:
- a newly created queue session.
- Throws:
javax.jms.JMSException
- if JMS Provider fails to create an MQQueueSession due
to an internal error.
close
public void close()
throws javax.jms.JMSException
- Closes this connection and release its resources.
- Specified by:
close
in interface javax.jms.Connection
- Overrides:
close
in class MQConnection
- Throws:
javax.jms.JMSException
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessageCount)
throws javax.jms.JMSException
- Creates a connection consumer for this connection.
This is an expert facility that is not used by regular JMS clients.
- Overrides:
createConnectionConsumer
in class MQConnection
- Parameters:
topic
- the topic to access.messageSelector
- only messages with properties that match the message
selector expression are delivered.sessionPool
- the server session pool to associate with this connection consumer.maxMessageCount
- the maximum number of messages that can be assigned to a
server session at one time.
- Returns:
- the connection consumer.
- Throws:
javax.jms.JMSException
- if the JMS connection fails to create a connection consumer
because of an internal error, or incorrect arguments for sessionPool and message selector.
javax.jms.InvalidDestinationException
- if the queue is not valid.
javax.jms.InvalidSelectorException
- if the message selector is not valid.- See Also:
ConnectionConsumer