1 45 package org.exolab.jms.client; 46 47 import javax.jms.JMSException ; 48 import javax.jms.Session ; 49 import javax.jms.TopicSession ; 50 import javax.jms.TransactionInProgressException ; 51 import javax.jms.XATopicSession ; 52 import javax.transaction.xa.XAResource ; 53 54 55 62 public class JmsXATopicSession 63 extends JmsTopicSession 64 implements XATopicSession { 65 66 69 private JmsXAResource _xares; 70 71 72 78 JmsXATopicSession(JmsXATopicConnection connection) 79 throws JMSException { 80 super(connection, true, Session.CLIENT_ACKNOWLEDGE); 81 _xares = new JmsXAResource(getServerSession()); 82 } 83 84 89 public TopicSession getTopicSession() { 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 XATopicession"); 129 } 130 131 137 public void rollback() throws JMSException { 138 throw new TransactionInProgressException ( 139 "Cannot call rollback on XATopicSession"); 140 } 141 } 142 | Popular Tags |