public class XASession extends Object implements jakarta.jms.XASession
jakarta.jms.XASession
interface.
An XA session actually extends the behaviour of a normal session by providing an XA resource representing it to a Transaction Manager, so that it is part of a distributed transaction. The XASession wraps what looks like a "normal" Session object. This object takes care of producing and consuming messages, the actual sendings and acknowledgement being managed by this XA wrapper.
This class offers support to transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.
Modifier and Type | Field and Description |
---|---|
protected Session |
sess |
private XAResource |
xaResource
The XA resource representing the session to the transaction manager.
|
Constructor and Description |
---|
XASession(Connection cnx,
Session sess,
XAResourceMngr rm)
Constructs an
XASession . |
Modifier and Type | Method and Description |
---|---|
void |
close()
API method.
|
void |
commit()
API method inherited from session, but intercepted here for
forbidding its use in the XA context (as defined by the API).
|
jakarta.jms.QueueBrowser |
createBrowser(jakarta.jms.Queue queue)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.QueueBrowser |
createBrowser(jakarta.jms.Queue queue,
String selector)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.BytesMessage |
createBytesMessage()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createConsumer(jakarta.jms.Destination dest)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createConsumer(jakarta.jms.Destination dest,
String selector)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createConsumer(jakarta.jms.Destination dest,
String selector,
boolean noLocal)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createDurableConsumer(jakarta.jms.Topic topic,
String name)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createDurableConsumer(jakarta.jms.Topic topic,
String name,
String messageSelector,
boolean noLocal)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.TopicSubscriber |
createDurableSubscriber(jakarta.jms.Topic topic,
String name)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.TopicSubscriber |
createDurableSubscriber(jakarta.jms.Topic topic,
String name,
String selector,
boolean noLocal)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MapMessage |
createMapMessage()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.Message |
createMessage()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.ObjectMessage |
createObjectMessage()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.ObjectMessage |
createObjectMessage(Serializable obj)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageProducer |
createProducer(jakarta.jms.Destination dest)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.Queue |
createQueue(String queueName)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createSharedConsumer(jakarta.jms.Topic topic,
String sharedSubscriptionName)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createSharedConsumer(jakarta.jms.Topic topic,
String sharedSubscriptionName,
String messageSelector)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createSharedDurableConsumer(jakarta.jms.Topic topic,
String name)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.MessageConsumer |
createSharedDurableConsumer(jakarta.jms.Topic topic,
String name,
String messageSelector)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.StreamMessage |
createStreamMessage()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.TemporaryQueue |
createTemporaryQueue()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.TemporaryTopic |
createTemporaryTopic()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.TextMessage |
createTextMessage()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.TextMessage |
createTextMessage(String text)
Delegates the call to the wrapped JMS session.
|
jakarta.jms.Topic |
createTopic(String topicName)
Delegates the call to the wrapped JMS session.
|
int |
getAcknowledgeMode()
Delegates the call to the wrapped JMS session.
|
Session |
getDelegateSession() |
jakarta.jms.MessageListener |
getMessageListener()
Delegates the call to the wrapped JMS session.
|
jakarta.jms.Session |
getSession()
API method.
|
boolean |
getTransacted()
API method.
|
XAResource |
getXAResource()
API method.
|
void |
recover()
API method inherited from session, but intercepted here for
forbidding its use in the XA context (as defined by the API).
|
void |
rollback()
API method inherited from session, but intercepted here for
forbidding its use in the XA context (as defined by the API).
|
void |
run()
Delegates the call to the wrapped JMS session.
|
void |
setMessageListener(jakarta.jms.MessageListener messageListener)
Delegates the call to the wrapped JMS session.
|
String |
toString()
Returns a String image of this session.
|
void |
unsubscribe(String name)
Delegates the call to the wrapped JMS session.
|
private XAResource xaResource
protected Session sess
public XASession(Connection cnx, Session sess, XAResourceMngr rm) throws jakarta.jms.JMSException
XASession
.
This constructor is called by subclasses.
cnx
- The connection the session belongs to.sess
- The wrapped "regular" session.rm
- The resource manager.jakarta.jms.JMSException
- Actually never thrown.public final Session getDelegateSession()
public String toString()
public jakarta.jms.Session getSession() throws jakarta.jms.JMSException
getSession
in interface jakarta.jms.XASession
jakarta.jms.IllegalStateException
- If the session is closed.jakarta.jms.JMSException
public XAResource getXAResource()
getXAResource
in interface jakarta.jms.XASession
public boolean getTransacted() throws jakarta.jms.JMSException
getTransacted
in interface jakarta.jms.Session
getTransacted
in interface jakarta.jms.XASession
jakarta.jms.IllegalStateException
- If the session is closed.jakarta.jms.JMSException
public jakarta.jms.QueueBrowser createBrowser(jakarta.jms.Queue queue, String selector) throws jakarta.jms.JMSException
createBrowser
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.QueueBrowser createBrowser(jakarta.jms.Queue queue) throws jakarta.jms.JMSException
createBrowser
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageProducer createProducer(jakarta.jms.Destination dest) throws jakarta.jms.JMSException
createProducer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination dest, String selector, boolean noLocal) throws jakarta.jms.JMSException
createConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination dest, String selector) throws jakarta.jms.JMSException
createConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination dest) throws jakarta.jms.JMSException
createConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.TopicSubscriber createDurableSubscriber(jakarta.jms.Topic topic, String name, String selector, boolean noLocal) throws jakarta.jms.JMSException
createDurableSubscriber
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.TopicSubscriber createDurableSubscriber(jakarta.jms.Topic topic, String name) throws jakarta.jms.JMSException
createDurableSubscriber
in interface jakarta.jms.Session
jakarta.jms.JMSException
public void commit() throws jakarta.jms.JMSException
commit
in interface jakarta.jms.Session
commit
in interface jakarta.jms.XASession
jakarta.jms.IllegalStateException
- Systematically thrown.jakarta.jms.JMSException
public void rollback() throws jakarta.jms.JMSException
rollback
in interface jakarta.jms.Session
rollback
in interface jakarta.jms.XASession
jakarta.jms.IllegalStateException
- Systematically thrown.jakarta.jms.JMSException
public void recover() throws jakarta.jms.JMSException
recover
in interface jakarta.jms.Session
jakarta.jms.IllegalStateException
- Systematically thrown.jakarta.jms.JMSException
public void close() throws jakarta.jms.JMSException
close
in interface jakarta.jms.Session
close
in interface AutoCloseable
jakarta.jms.JMSException
- Actually never thrown.Session.close
public void run()
public void unsubscribe(String name) throws jakarta.jms.JMSException
unsubscribe
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.TemporaryQueue createTemporaryQueue() throws jakarta.jms.JMSException
createTemporaryQueue
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.TemporaryTopic createTemporaryTopic() throws jakarta.jms.JMSException
createTemporaryTopic
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.Topic createTopic(String topicName) throws jakarta.jms.JMSException
createTopic
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.Queue createQueue(String queueName) throws jakarta.jms.JMSException
createQueue
in interface jakarta.jms.Session
jakarta.jms.JMSException
public void setMessageListener(jakarta.jms.MessageListener messageListener) throws jakarta.jms.JMSException
setMessageListener
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageListener getMessageListener() throws jakarta.jms.JMSException
getMessageListener
in interface jakarta.jms.Session
jakarta.jms.JMSException
public int getAcknowledgeMode() throws jakarta.jms.JMSException
getAcknowledgeMode
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.TextMessage createTextMessage() throws jakarta.jms.JMSException
createTextMessage
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.TextMessage createTextMessage(String text) throws jakarta.jms.JMSException
createTextMessage
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.StreamMessage createStreamMessage() throws jakarta.jms.JMSException
createStreamMessage
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.ObjectMessage createObjectMessage() throws jakarta.jms.JMSException
createObjectMessage
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.ObjectMessage createObjectMessage(Serializable obj) throws jakarta.jms.JMSException
createObjectMessage
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.Message createMessage() throws jakarta.jms.JMSException
createMessage
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MapMessage createMapMessage() throws jakarta.jms.JMSException
createMapMessage
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.BytesMessage createBytesMessage() throws jakarta.jms.JMSException
createBytesMessage
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createSharedConsumer(jakarta.jms.Topic topic, String sharedSubscriptionName) throws jakarta.jms.JMSException
createSharedConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createSharedConsumer(jakarta.jms.Topic topic, String sharedSubscriptionName, String messageSelector) throws jakarta.jms.JMSException
createSharedConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createDurableConsumer(jakarta.jms.Topic topic, String name) throws jakarta.jms.JMSException
createDurableConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createDurableConsumer(jakarta.jms.Topic topic, String name, String messageSelector, boolean noLocal) throws jakarta.jms.JMSException
createDurableConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createSharedDurableConsumer(jakarta.jms.Topic topic, String name) throws jakarta.jms.JMSException
createSharedDurableConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
public jakarta.jms.MessageConsumer createSharedDurableConsumer(jakarta.jms.Topic topic, String name, String messageSelector) throws jakarta.jms.JMSException
createSharedDurableConsumer
in interface jakarta.jms.Session
jakarta.jms.JMSException
Copyright © 2023 ScalAgent D.T.. All rights reserved.