org.objectweb.joram.client.jms

Class XASession

Implemented Interfaces:
javax.jms.Session, javax.jms.XASession
Known Direct Subclasses:
XAQueueSession, XATopicSession

public class XASession
extends Session
implements javax.jms.XASession

Implements the 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.

Field Summary

protected Session
sess
An XA Session actually wraps what looks like a "normal" session object.

Fields inherited from class org.objectweb.joram.client.jms.Session

messageListener

Constructor Summary

XASession(Connection cnx, Session sess, XAResourceMngr rm)
Constructs an XASession.

Method Summary

void
close()
API method inherited from session, but intercepted here for adapting its behaviour to the XA context.
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.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.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.MessageProducer
createProducer(javax.jms.Destination dest)
Delegates the call to the wrapped JMS session.
javax.jms.Session
getSession()
API method.
boolean
getTransacted()
API method.
javax.transaction.xa.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()
API method inherited from session, but intercepted here for adapting its behaviour to the XA context.
String
toString()
Returns a String image of this session.

Methods inherited from class org.objectweb.joram.client.jms.Session

close, commit, createBrowser, createBrowser, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createQueue, createStreamMessage, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, getTransacted, recover, rollback, run, setMessageListener, setTransacted, toString, unsubscribe

Field Details

sess

protected Session sess
An XA Session actually wraps what looks like a "normal" session object.

Constructor Details

XASession

public XASession(Connection cnx,
                 Session sess,
                 XAResourceMngr rm)
            throws JMSException
Constructs an XASession.

This constructor is called by subclasses.

Parameters:
cnx - The connection the session belongs to.
sess - The wrapped "regular" session.
rm - The resource manager.

Method Details

close

public void close()
            throws JMSException
API method inherited from session, but intercepted here for adapting its behaviour to the XA context.
Overrides:
close in interface Session


commit

public void commit()
            throws JMSException
API method inherited from session, but intercepted here for forbidding its use in the XA context (as defined by the API).
Overrides:
commit in interface Session


createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
            throws JMSException
Delegates the call to the wrapped JMS session.
Overrides:
createBrowser in interface Session


createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
                                            String selector)
            throws JMSException
Delegates the call to the wrapped JMS session.
Overrides:
createBrowser in interface Session


createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest)
            throws JMSException
Delegates the call to the wrapped JMS session.
Overrides:
createConsumer in interface Session


createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest,
                                                String selector)
            throws JMSException
Delegates the call to the wrapped JMS session.
Overrides:
createConsumer in interface Session


createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest,
                                                String selector,
                                                boolean noLocal)
            throws JMSException
Delegates the call to the wrapped JMS session.
Overrides:
createConsumer in interface Session


createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         String name)
            throws JMSException
Delegates the call to the wrapped JMS session.
Overrides:
createDurableSubscriber in interface Session


createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         String name,
                                                         String selector,
                                                         boolean noLocal)
            throws JMSException
Delegates the call to the wrapped JMS session.
Overrides:
createDurableSubscriber in interface Session


createProducer

public javax.jms.MessageProducer createProducer(javax.jms.Destination dest)
            throws JMSException
Delegates the call to the wrapped JMS session.
Overrides:
createProducer in interface Session


getSession

public javax.jms.Session getSession()
            throws JMSException
API method.


getTransacted

public boolean getTransacted()
            throws JMSException
API method.
Overrides:
getTransacted in interface Session


getXAResource

public javax.transaction.xa.XAResource getXAResource()
API method.


recover

public void recover()
            throws JMSException
API method inherited from session, but intercepted here for forbidding its use in the XA context (as defined by the API).
Overrides:
recover in interface Session


rollback

public void rollback()
            throws JMSException
API method inherited from session, but intercepted here for forbidding its use in the XA context (as defined by the API).
Overrides:
rollback in interface Session


run

public void run()
API method inherited from session, but intercepted here for adapting its behaviour to the XA context.

This method processes asynchronous deliveries coming from a connection consumer by passing them to the wrapped session.

Overrides:
run in interface Session


toString

public String toString()
Returns a String image of this session.
Overrides:
toString in interface Session


Copyright B) 2004 Scalagent - All rights reserved