|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mq.jms.MQSession
A JMS session is a single-threaded context for producing and consuming
messages.
Field Summary |
Fields inherited from interface javax.jms.Session |
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Method Summary | |
void |
close()
Closes the session. |
void |
commit()
Commits all messages done in this transaction and releases any locks currently held. |
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue)
Creates a QueueBrowser object to peek at the messages on the specified queue. |
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue,
java.lang.String messageSelector)
Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector. |
javax.jms.BytesMessage |
createBytesMessage()
Creates a BytesMessage object. |
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination)
Creates a MessageConsumer for the specified Destination. |
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
java.lang.String messageSelector)
Creates a MessageConsumer for the specified Destination, using a message selector. |
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
java.lang.String messageSelector,
boolean noLocal)
Creates MessageConsumer for the specified destination, using a message selector. |
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name)
Creates a durable Subscriber to the specified topic. |
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name,
java.lang.String selector,
boolean noLocal)
Creates a durable Subscriber to the specified topic. |
javax.jms.MapMessage |
createMapMessage()
Creates a MapMessage. |
javax.jms.Message |
createMessage()
Creates a Message. |
javax.jms.ObjectMessage |
createObjectMessage()
Creates an ObjectMessage. |
javax.jms.ObjectMessage |
createObjectMessage(java.io.Serializable object)
Creates an initialized ObjectMessage. |
javax.jms.MessageProducer |
createProducer(javax.jms.Destination destination)
Creates a MessageProducer to send messages to the specified destination. |
javax.jms.Queue |
createQueue(java.lang.String queueName)
Creates a queue object given a queue name. |
javax.jms.StreamMessage |
createStreamMessage()
Creates a StreamMessage object. |
javax.jms.TemporaryQueue |
createTemporaryQueue()
Creates a JMS temporary queue. |
javax.jms.TemporaryTopic |
createTemporaryTopic()
Creates a temporary topic. |
javax.jms.TextMessage |
createTextMessage()
Creates a TextMessage. |
javax.jms.TextMessage |
createTextMessage(java.lang.String string)
Creates an initialized TextMessage. |
javax.jms.Topic |
createTopic(java.lang.String topicName)
Creates a Topic given a Topic name. |
int |
getAcknowledgeMode()
Gets the acknowledgement mode of the session. |
javax.jms.MessageListener |
getMessageListener()
Gets the session's distinguished message listener. |
boolean |
getTransacted()
Indicates whether the session is in transacted mode. |
void |
recover()
Stops message delivery in this session and restarts message delivery with the oldest unacknowledged message. |
void |
rollback()
Rolls back any messages processed in this transaction and releases any locks currently held. |
void |
setMessageListener(javax.jms.MessageListener listener)
Sets the session's distinguished message listener. |
void |
unsubscribe(java.lang.String name)
Unsubscribes a durable subscription that has been created by a client. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void commit() throws javax.jms.JMSException
commit
in interface javax.jms.Session
javax.jms.JMSException
- with one of the following reasons:
public void recover() throws javax.jms.JMSException
recover
in interface javax.jms.Session
javax.jms.JMSException
- with one of the following reasons:
public void rollback() throws javax.jms.JMSException
rollback
in interface javax.jms.Session
javax.jms.JMSException
- with one of the following reasons:
public void close() throws javax.jms.JMSException
close
in interface javax.jms.Session
javax.jms.JMSException
- with one of the following reasons:
public javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
createBytesMessage
in interface javax.jms.Session
javax.jms.JMSException
- if JMS fails due to some internal JMS error.
javax.jms.JMSException
- with reason
MQJMS_E_SESSION_CLOSED
.public javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
createMapMessage
in interface javax.jms.Session
javax.jms.JMSException
- with reason
MQJMS_E_SESSION_CLOSED
public javax.jms.Message createMessage() throws javax.jms.JMSException
createMessage
in interface javax.jms.Session
javax.jms.JMSException
- with reason
MQJMS_E_SESSION_CLOSED
.public javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
javax.jms.IllegalStateException
- with reason
MQJMS_E_SESSION_CLOSED
.
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object) throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
object
- the object to use to initialize this message.
javax.jms.IllegalStateException
- with reason
MQJMS_E_SESSION_CLOSED
.
javax.jms.JMSException
public javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
createStreamMessage
in interface javax.jms.Session
javax.jms.JMSException
- IllegalStateException with reason
MQJMS_E_SESSION_CLOSED
.public javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
javax.jms.JMSException
- IllegalStateException with reason
MQJMS_E_SESSION_CLOSED
.public javax.jms.TextMessage createTextMessage(java.lang.String string) throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
string
- the string used to initialize this message.
javax.jms.JMSException
- IllegalStateException with reason
MQJMS_E_SESSION_CLOSED
.public boolean getTransacted() throws javax.jms.JMSException
getTransacted
in interface javax.jms.Session
javax.jms.JMSException
- with one of the following reasons:
public javax.jms.MessageListener getMessageListener() throws javax.jms.JMSException
getMessageListener
in interface javax.jms.Session
javax.jms.JMSException
- with reason
MQJMS_E_SESSION_CLOSED
.public void setMessageListener(javax.jms.MessageListener listener) throws javax.jms.JMSException
setMessageListener
in interface javax.jms.Session
listener
-
javax.jms.JMSException
- with one of the following reasons:
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) throws javax.jms.JMSException
createBrowser
in interface javax.jms.Session
queue
- the queue to access.
javax.jms.JMSException
- with one of the following reasons:
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String messageSelector) throws javax.jms.JMSException
createBrowser
in interface javax.jms.Session
queue
- the queue to access.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.
javax.jms.JMSException
- with one of the following reasons:
public javax.jms.Queue createQueue(java.lang.String queueName) throws javax.jms.JMSException
createQueue
in interface javax.jms.Session
queueName
- the name of the Queue to be created.
javax.jms.JMSException
- with one of the following reasons:
public javax.jms.TemporaryQueue createTemporaryQueue() throws javax.jms.JMSException
createTemporaryQueue
in interface javax.jms.Session
javax.jms.JMSException
- IllegalStateException
with one of the following reasons:
public javax.jms.Topic createTopic(java.lang.String topicName) throws javax.jms.JMSException
createTopic
in interface javax.jms.Session
topicName
- the name of this topic
javax.jms.JMSException
- if a Session fails to create a Topic due to an internal error.
javax.jms.IllegalStateException
- if the Session object has been closed.public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.Session
topic
- the topic to subscribe toname
- the name used to identify this subscription.
javax.jms.IllegalStateException
- if the session has been closed.
javax.jms.InvalidDestinationException
- if the topic specified is not valid.
javax.jms.JMSException
- if the Session fails to create a subscriber due to an internal error.public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name, java.lang.String selector, boolean noLocal) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.Session
topic
- the topic to subscribe toname
- the name used to identify this subscription.selector
- only messages with properties matching the message selector expression are
delivered. This value may be null.noLocal
- true inhibits the delivery of messages published by its own connection.
javax.jms.IllegalStateException
- if the session has been closed.
javax.jms.InvalidDestinationException
- if the topic specified is not valid.
javax.jms.JMSException
- if the Session fails to create a subscriber due to an internal error.public javax.jms.TemporaryTopic createTemporaryTopic() throws javax.jms.JMSException
createTemporaryTopic
in interface javax.jms.Session
javax.jms.JMSException
- if the Session fails to create a temporary topic due to an internal error.
javax.jms.IllegalStateException
- if the Session object has been closed.public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
destination
- the Destination to access.
javax.jms.JMSException
- if the command fails due to some internal JMS error.public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, java.lang.String messageSelector) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
destination
- the Destination to access.messageSelector
- the message selector
javax.jms.JMSException
- if the command fails due to some internal JMS error.public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, java.lang.String messageSelector, boolean noLocal) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
destination
- the Destination to access.messageSelector
- the message selectornoLocal
- when the destination is a topic, true inhibits the delivery of messages
published by its own connection. The behavior for NoLocal is ignored if the
destination is a queue.
javax.jms.JMSException
- with linked exception InvalidDestinationException with reason
MQJMS_EXCEPTION_INVALID_DESTINATION
.
javax.jms.JMSException
- with linked exception to whatever createQConsumer, createTConsumer and
addConsumer throw.public javax.jms.MessageProducer createProducer(javax.jms.Destination destination) throws javax.jms.JMSException
createProducer
in interface javax.jms.Session
destination
- the Destination to send to, or null if this is a producer which does not
have a specified destination.
javax.jms.JMSException
- with reason
MQJMS_EXCEPTION_MQ_NULL_QMGR
javax.jms.JMSException
- with reason
MQJMS_EXCEPTION_MQ_Q_OPEN_FAILED
javax.jms.InvalidDestinationException
- If the topic specified is not valid.
javax.jms.JMSException
- if the Session fails to create a producer because of an internal error.public final int getAcknowledgeMode() throws javax.jms.JMSException
getAcknowledgeMode
in interface javax.jms.Session
javax.jms.JMSException
public void unsubscribe(java.lang.String name) throws javax.jms.JMSException
For a direct connection to WebSphere MQ Event Broker, WebSphere Business Integration Event Broker, or WebSphere Business Integration Message Broker, this method throws a JMSException.
unsubscribe
in interface javax.jms.Session
javax.jms.JMSException
- if the Session fails to unsubscribe to the durable subscription due to an
internal error.
|
(c) Copyright IBM Corp. 2005. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |