com.ibm.mq.jms
Class MQSession
- java.lang.Object
- com.ibm.mq.jms.MQRoot
- com.ibm.mq.jms.MQSession
- public class MQSession
- extends MQRoot
- implements javax.jms.Session, JmsSession
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary
Fields inherited from interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Method Summary
Modifier and Type | Method and Description |
---|---|
|
clearMessageReferences()
Allows a JmsSession to clear any message references that it might have.
|
|
close()
Closes the session.
|
|
commit()
Commits all messages done in this transaction and releases any locks currently held.
|
|
createBrowser(javax.jms.Queue queue)
Creates a QueueBrowser object to peek at the messages on the specified queue.
|
|
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.
|
|
createBytesMessage()
Creates a BytesMessage object.
|
|
createConsumer(javax.jms.Destination destination)
Creates a message consumer for the specified destination.
|
|
createConsumer(javax.jms.Destination destination,java.lang.String messageSelector)
Creates a message consumer for the specified destination, using a message selector.
|
|
createConsumer(javax.jms.Destination destination,java.lang.String messageSelector,boolean noLocal)
Creates a message consumer for the specified destination, using a message selector.
|
|
createDurableSubscriber(javax.jms.Topic topic,java.lang.String name)
Creates a durable subscriber to the specified topic.
|
|
createDurableSubscriber(javax.jms.Topic topic,java.lang.String name,java.lang.String selector,boolean noLocal)
Creates a durable subscriber to the specified topic.
|
|
createMapMessage()
Creates a MapMessage.
|
|
createMessage()
Creates a Message.
|
|
createObjectMessage()
Creates an ObjectMessage.
|
|
createObjectMessage(java.io.Serializable object)
Creates an initialized ObjectMessage.
|
|
createProducer(javax.jms.Destination destination)
Creates a message producer to send messages to the specified destination.
|
|
createQueue(java.lang.String queueName)
Creates a queue object given a queue name.
|
|
createStreamMessage()
Creates a StreamMessage object.
|
|
createTemporaryQueue()
Creates a JMS temporary queue.
|
|
createTemporaryTopic()
Creates a temporary topic.
|
|
createTextMessage()
Creates a TextMessage.
|
|
createTextMessage(java.lang.String string)
Creates an initialized TextMessage.
|
|
createTopic(java.lang.String topicName)
Creates a Topic given a Topic name.
|
|
getAcknowledgeMode()
Gets the acknowledgement mode of the session.
|
|
getMessageListener()
Gets the session's distinguished message listener.
|
|
getTransacted()
Indicates whether the session is in transacted mode.
|
|
recover()
Stops message delivery in this session and restarts message delivery with the oldest
unacknowledged message.
|
|
rollback()
Rolls back any messages processed in this transaction and releases any locks currently held.
|
|
setMessageListener(javax.jms.MessageListener listener)
Sets the session's distinguished message listener.
|
|
unsubscribe(java.lang.String name)
Unsubscribes a durable subscription that has been created by a client.
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.msg.client.jms.JmsPropertyContext |
---|
setBatchProperties, setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty, setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty, setObjectProperty, setShortProperty, setStringProperty |
Methods inherited from interface com.ibm.msg.client.jms.JmsReadablePropertyContext |
---|
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from interface javax.jms.Session |
---|
run |
Method Detail
close
- public void close()
- throws javax.jms.JMSException
close
in interface javax.jms.Session
javax.jms.JMSException
commit
- public void commit()
- throws javax.jms.JMSException
commit
in interface javax.jms.Session
javax.jms.JMSException
createBrowser
- 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
- if the operation fails createBrowser
- 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
- if the operation fails createBytesMessage
- 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. createConsumer
- 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. createConsumer
- 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. createConsumer
- 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 selector noLocal
- 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
- if the operation fails createDurableSubscriber
- 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 to name
- the name used to identify this subscription. java.lang.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. createDurableSubscriber
- 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 to name
- 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. java.lang.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. createMapMessage
- public javax.jms.MapMessage createMapMessage( )
- throws javax.jms.JMSException
createMapMessage
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails createMessage
- public javax.jms.Message createMessage( )
- throws javax.jms.JMSException
createMessage
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails createObjectMessage
- public javax.jms.ObjectMessage createObjectMessage( )
- throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed createObjectMessage
- 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.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed createProducer
- 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
- if the session fails to create a producer because of an internal error createQueue
- 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
- if the operation fails createStreamMessage
- public javax.jms.StreamMessage createStreamMessage( )
- throws javax.jms.JMSException
createStreamMessage
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed. createTemporaryQueue
- public javax.jms.TemporaryQueue createTemporaryQueue( )
- throws javax.jms.JMSException
This session will have been created from a connection that was created from a Connection Factory.
If that Connection Factory has a Model Queue defined on it that is a permanent dynamic queue (or the default
queue has been modified to have that behaviour), the temporary queue created from this method
is only deleted when an explicit MQTemporaryQueue.delete()
call is made.
The difference is within the WebSphere Application Server, MQTemporaryQueue.delete()
will be called
by the application server when a connection is being closed. Therefore even if a permanent dynamic
model queue is used, the created temporary queue will be destroyed.
createTemporaryQueue
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed. createTemporaryTopic
- 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. java.lang.IllegalStateException
- if the Session object has been closed. createTextMessage
- public javax.jms.TextMessage createTextMessage( )
- throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed createTextMessage
- 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
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed createTopic
- 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 java.lang.IllegalStateException
- if the Session object has been closed getAcknowledgeMode
- public int getAcknowledgeMode()
- throws javax.jms.JMSException
getAcknowledgeMode
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails getMessageListener
- public javax.jms.MessageListener getMessageListener( )
- throws javax.jms.JMSException
getMessageListener
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed getTransacted
- public boolean getTransacted()
- throws javax.jms.JMSException
getTransacted
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed recover
- public void recover()
- throws javax.jms.JMSException
recover
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed rollback
- public void rollback()
- throws javax.jms.JMSException
rollback
in interface javax.jms.Session
javax.jms.JMSException
- if the operation fails due to some internal error java.lang.IllegalStateException
- if the Session object has been closed setMessageListener
- public void setMessageListener( javax.jms.MessageListener listener)
- throws javax.jms.JMSException
setMessageListener
in interface javax.jms.Session
listener
- the listener to set javax.jms.JMSException
- if the operation fails unsubscribe
- public void unsubscribe(java.lang.String name)
- throws javax.jms.JMSException
For a real-time 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
name
- the name used to identify this subscription javax.jms.JMSException
- if the session fails to unsubscribe to the durable subscription due to an
internal error. clearMessageReferences
- public void clearMessageReferences( )
com.ibm.msg.client.jms.JmsSession#clearMessageReferences()