public class XASession extends Object implements javax.jms.XASession
javax.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).
|
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue)
Delegates the call to the wrapped JMS session.
|
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue,
String selector)
Delegates the call to the wrapped JMS session.
|
javax.jms.BytesMessage |
createBytesMessage()
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination dest)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination dest,
String selector)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination dest,
String selector,
boolean noLocal)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createDurableConsumer(javax.jms.Topic topic,
String name)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createDurableConsumer(javax.jms.Topic topic,
String name,
String messageSelector,
boolean noLocal)
Delegates the call to the wrapped JMS session.
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
String name)
Delegates the call to the wrapped JMS session.
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
String name,
String selector,
boolean noLocal)
Delegates the call to the wrapped JMS session.
|
javax.jms.MapMessage |
createMapMessage()
Delegates the call to the wrapped JMS session.
|
javax.jms.Message |
createMessage()
Delegates the call to the wrapped JMS session.
|
javax.jms.ObjectMessage |
createObjectMessage()
Delegates the call to the wrapped JMS session.
|
javax.jms.ObjectMessage |
createObjectMessage(Serializable obj)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageProducer |
createProducer(javax.jms.Destination dest)
Delegates the call to the wrapped JMS session.
|
javax.jms.Queue |
createQueue(String queueName)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createSharedConsumer(javax.jms.Topic topic,
String sharedSubscriptionName)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createSharedConsumer(javax.jms.Topic topic,
String sharedSubscriptionName,
String messageSelector)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createSharedDurableConsumer(javax.jms.Topic topic,
String name)
Delegates the call to the wrapped JMS session.
|
javax.jms.MessageConsumer |
createSharedDurableConsumer(javax.jms.Topic topic,
String name,
String messageSelector)
Delegates the call to the wrapped JMS session.
|
javax.jms.StreamMessage |
createStreamMessage()
Delegates the call to the wrapped JMS session.
|
javax.jms.TemporaryQueue |
createTemporaryQueue()
Delegates the call to the wrapped JMS session.
|
javax.jms.TemporaryTopic |
createTemporaryTopic()
Delegates the call to the wrapped JMS session.
|
javax.jms.TextMessage |
createTextMessage()
Delegates the call to the wrapped JMS session.
|
javax.jms.TextMessage |
createTextMessage(String text)
Delegates the call to the wrapped JMS session.
|
javax.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() |
javax.jms.MessageListener |
getMessageListener()
Delegates the call to the wrapped JMS session.
|
javax.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(javax.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 javax.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.javax.jms.JMSException
- Actually never thrown.public final Session getDelegateSession()
public String toString()
public javax.jms.Session getSession() throws javax.jms.JMSException
getSession
in interface javax.jms.XASession
javax.jms.IllegalStateException
- If the session is closed.javax.jms.JMSException
public XAResource getXAResource()
getXAResource
in interface javax.jms.XASession
public boolean getTransacted() throws javax.jms.JMSException
getTransacted
in interface javax.jms.Session
getTransacted
in interface javax.jms.XASession
javax.jms.IllegalStateException
- If the session is closed.javax.jms.JMSException
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, String selector) throws javax.jms.JMSException
createBrowser
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) throws javax.jms.JMSException
createBrowser
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageProducer createProducer(javax.jms.Destination dest) throws javax.jms.JMSException
createProducer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest, String selector, boolean noLocal) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest, String selector) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String name, String selector, boolean noLocal) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String name) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.Session
javax.jms.JMSException
public void commit() throws javax.jms.JMSException
commit
in interface javax.jms.Session
commit
in interface javax.jms.XASession
javax.jms.IllegalStateException
- Systematically thrown.javax.jms.JMSException
public void rollback() throws javax.jms.JMSException
rollback
in interface javax.jms.Session
rollback
in interface javax.jms.XASession
javax.jms.IllegalStateException
- Systematically thrown.javax.jms.JMSException
public void recover() throws javax.jms.JMSException
recover
in interface javax.jms.Session
javax.jms.IllegalStateException
- Systematically thrown.javax.jms.JMSException
public void close() throws javax.jms.JMSException
close
in interface AutoCloseable
close
in interface javax.jms.Session
javax.jms.JMSException
- Actually never thrown.Session.close
public void run()
public void unsubscribe(String name) throws javax.jms.JMSException
unsubscribe
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TemporaryQueue createTemporaryQueue() throws javax.jms.JMSException
createTemporaryQueue
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TemporaryTopic createTemporaryTopic() throws javax.jms.JMSException
createTemporaryTopic
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Topic createTopic(String topicName) throws javax.jms.JMSException
createTopic
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Queue createQueue(String queueName) throws javax.jms.JMSException
createQueue
in interface javax.jms.Session
javax.jms.JMSException
public void setMessageListener(javax.jms.MessageListener messageListener) throws javax.jms.JMSException
setMessageListener
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageListener getMessageListener() throws javax.jms.JMSException
getMessageListener
in interface javax.jms.Session
javax.jms.JMSException
public int getAcknowledgeMode() throws javax.jms.JMSException
getAcknowledgeMode
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TextMessage createTextMessage(String text) throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
createStreamMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage(Serializable obj) throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Message createMessage() throws javax.jms.JMSException
createMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
createMapMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
createBytesMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createSharedConsumer(javax.jms.Topic topic, String sharedSubscriptionName) throws javax.jms.JMSException
createSharedConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createSharedConsumer(javax.jms.Topic topic, String sharedSubscriptionName, String messageSelector) throws javax.jms.JMSException
createSharedConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createDurableConsumer(javax.jms.Topic topic, String name) throws javax.jms.JMSException
createDurableConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createDurableConsumer(javax.jms.Topic topic, String name, String messageSelector, boolean noLocal) throws javax.jms.JMSException
createDurableConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createSharedDurableConsumer(javax.jms.Topic topic, String name) throws javax.jms.JMSException
createSharedDurableConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createSharedDurableConsumer(javax.jms.Topic topic, String name, String messageSelector) throws javax.jms.JMSException
createSharedDurableConsumer
in interface javax.jms.Session
javax.jms.JMSException
Copyright © 2018 ScalAgent D.T.. All Rights Reserved.