|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.codehaus.activemq.ActiveMQSession
org.codehaus.activemq.ActiveMQXASession
The XASession interface extends the capability of Session by adding access to a JMS provider's support for the Java Transaction API (JTA) (optional). This support takes the form of a javax.transaction.xa.XAResource object. The functionality of this object closely resembles that defined by the standard X/Open XA Resource interface.
An application server controls the transactional assignment of an XASession by obtaining its XAResource. It uses the XAResource to assign the session to a transaction, prepare and commit work on the transaction, and so on. An XAResource provides some fairly sophisticated facilities for interleaving work on multiple transactions, recovering a list of transactions in progress, and so on. A JTA aware JMS provider must fully implement this functionality. This could be done by using the services of a database that supports XA, or a JMS provider may choose to implement this functionality from scratch. A client of the application server is given what it thinks is a regular JMS Session. Behind the scenes, the application server controls the transaction management of the underlying XASession. The XASession interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.
Session,
QueueSession,
TopicSession,
XASession| Field Summary |
| Fields inherited from class org.codehaus.activemq.ActiveMQSession |
closed, connection, consumers, currentTransactionId, packetIdGenerator, producers |
| Fields inherited from interface javax.jms.Session |
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
| Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
| Constructor Summary | |
ActiveMQXASession(ActiveMQXAConnection theConnection)
|
|
| Method Summary | |
protected void |
checkClosedXA()
|
void |
commit()
Commits all messages done in this transaction and releases any locks currently held. |
void |
commit(Xid xid,
boolean onePhase)
|
protected void |
doStartTransaction()
This is called before transacted work is done by the session. |
void |
end(Xid xid,
int flags)
|
void |
forget(Xid xid)
|
protected java.lang.String |
getNextTransactionId()
|
QueueSession |
getQueueSession()
|
Session |
getSession()
|
TopicSession |
getTopicSession()
|
boolean |
getTransacted()
Indicates whether the session is in transacted mode. |
int |
getTransactionTimeout()
|
XAResource |
getXAResource()
|
boolean |
isSameRM(XAResource xaResource)
|
protected boolean |
isXaTransacted()
|
int |
prepare(Xid xid)
|
Xid[] |
recover(int flag)
|
void |
rollback()
Rolls back any messages done in this transaction and releases any locks currently held. |
void |
rollback(Xid xid)
|
boolean |
setTransactionTimeout(int seconds)
|
void |
start(Xid xid,
int flags)
Associates a transaction with the resource. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ActiveMQXASession(ActiveMQXAConnection theConnection)
throws JMSException
| Method Detail |
public boolean getTransacted()
throws JMSException
ActiveMQSession
getTransacted in interface XASessiongetTransacted in class ActiveMQSessionJMSException - if there is some internal error.
public void rollback()
throws JMSException
ActiveMQSession
rollback in interface XASessionrollback in class ActiveMQSessionJMSException - if the JMS provider fails to roll back the transaction due to some internal error.
public void commit()
throws JMSException
ActiveMQSession
commit in interface XASessioncommit in class ActiveMQSessionJMSException - if the JMS provider fails to commit the transaction due to some internal error.
public Session getSession()
throws JMSException
getSession in interface XASessionJMSExceptionpublic XAResource getXAResource()
getXAResource in interface XASession
public QueueSession getQueueSession()
throws JMSException
getQueueSession in interface XAQueueSessionJMSException
public TopicSession getTopicSession()
throws JMSException
getTopicSession in interface XATopicSessionJMSException
public void start(Xid xid,
int flags)
throws XAException
start in interface XAResourceXAException
public void end(Xid xid,
int flags)
throws XAException
end in interface XAResourceXAException
public int prepare(Xid xid)
throws XAException
prepare in interface XAResourceXAException
public void rollback(Xid xid)
throws XAException
rollback in interface XAResourceXAException
public void commit(Xid xid,
boolean onePhase)
throws XAException
commit in interface XAResourceXAException
public void forget(Xid xid)
throws XAException
forget in interface XAResourceXAException
public boolean isSameRM(XAResource xaResource)
throws XAException
isSameRM in interface XAResourceXAException
public Xid[] recover(int flag)
throws XAException
recover in interface XAResourceXAException
public int getTransactionTimeout()
throws XAException
getTransactionTimeout in interface XAResourceXAException
public boolean setTransactionTimeout(int seconds)
throws XAException
setTransactionTimeout in interface XAResourceXAException
protected void checkClosedXA()
throws XAException
XAException - if the Session is closedprotected boolean isXaTransacted()
isXaTransacted in class ActiveMQSessionprotected java.lang.String getNextTransactionId()
getNextTransactionId in class ActiveMQSession
protected void doStartTransaction()
throws JMSException
doStartTransaction in class ActiveMQSessionJMSException - not associated with an Xid
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||