1 45 package org.exolab.jms.client; 46 47 import javax.jms.JMSException ; 48 import javax.jms.Session ; 49 import javax.jms.TransactionInProgressException ; 50 import javax.jms.XASession ; 51 import javax.transaction.xa.XAResource ; 52 53 54 60 class JmsXASession 61 extends JmsSession 62 implements XASession { 63 64 67 private JmsXAResource _xares; 68 69 70 76 public JmsXASession(JmsConnection connection) throws JMSException { 77 super(connection, true, Session.CLIENT_ACKNOWLEDGE); 78 _xares = new JmsXAResource(getServerSession()); 79 } 80 81 86 public Session getSession() { 87 return this; 88 } 89 90 95 public XAResource getXAResource() { 96 return _xares; 97 } 98 99 104 public boolean getTransacted() { 105 return true; 106 } 107 108 114 public void commit() throws JMSException { 115 throw new TransactionInProgressException ( 116 "Cannot call commit on XASession"); 117 } 118 119 125 public void rollback() throws JMSException { 126 throw new TransactionInProgressException ( 127 "Cannot call rollback on XASession"); 128 } 129 130 } 131 | Popular Tags |