1 45 package org.exolab.jms.client; 46 47 import javax.jms.JMSException ; 48 import javax.jms.QueueSession ; 49 import javax.jms.Session ; 50 import javax.jms.TransactionInProgressException ; 51 import javax.jms.XAQueueSession ; 52 import javax.transaction.xa.XAResource ; 53 54 55 63 public class JmsXAQueueSession 64 extends JmsQueueSession 65 implements XAQueueSession { 66 67 70 private JmsXAResource _xares; 71 72 73 79 JmsXAQueueSession(JmsXAQueueConnection connection) throws JMSException { 80 super(connection, true, Session.CLIENT_ACKNOWLEDGE); 81 _xares = new JmsXAResource(getServerSession()); 82 } 83 84 89 public QueueSession getQueueSession() { 90 return this; 91 } 92 93 98 public Session getSession() { 99 return this; 100 } 101 102 107 public XAResource getXAResource() { 108 return _xares; 109 } 110 111 116 public boolean getTransacted() { 117 return true; 118 } 119 120 126 public void commit() throws JMSException { 127 throw new TransactionInProgressException ( 128 "Cannot call commit on XAQueueession"); 129 } 130 131 137 public void rollback() throws JMSException { 138 throw new TransactionInProgressException ( 139 "Cannot call rollback on XAQueueSession"); 140 } 141 } 142 | Popular Tags |