1 46 package org.mr.api.jms; 47 48 import java.io.ByteArrayInputStream ; 49 import java.io.ByteArrayOutputStream ; 50 import java.io.IOException ; 51 import java.io.ObjectInputStream ; 52 import java.io.ObjectOutputStream ; 53 import java.util.ArrayList ; 54 import java.util.Collection ; 55 import java.util.Iterator ; 56 57 import javax.jms.JMSException ; 58 import javax.jms.QueueSession ; 59 import javax.jms.Session ; 60 import javax.jms.TextMessage ; 61 import javax.jms.TopicSession ; 62 import javax.jms.TransactionInProgressException ; 63 import javax.jms.XAQueueSession ; 64 import javax.jms.XASession ; 65 import javax.jms.XATopicSession ; 66 import javax.transaction.xa.XAException ; 67 import javax.transaction.xa.XAResource ; 68 import javax.transaction.xa.Xid ; 69 70 import org.mr.core.persistent.PersistentMap; 71 import org.mr.core.protocol.MantaBusMessage; 72 import org.mr.core.util.byteable.ByteableByteArray; 73 74 75 85 public class MantaXASession extends MantaSession implements XASession , XATopicSession , XAQueueSession 86 { 87 88 96 MantaXASession(MantaConnection cnx) throws JMSException 97 { 98 super(cnx.messageChannel.getMessageId(), cnx, Session.SESSION_TRANSACTED,true); } 100 101 106 public Session getSession() throws JMSException 107 { 108 checkLegalOperation(); 109 110 return this; 111 } 112 113 118 public XAResource getXAResource() 119 { 120 return transactionContext; 121 } 122 123 124 129 public void commit() throws JMSException { 130 throw new TransactionInProgressException ("MNJMS00019 : CAN NOT commit() AN XA SESSION."); 131 } 132 133 138 public void rollback() throws JMSException { 139 throw new TransactionInProgressException ("MNJMS0001A : CAN NOT rollback() AN XA SESSION."); 140 } 141 142 143 public TopicSession getTopicSession() throws JMSException { 144 return (TopicSession )this; 145 } 146 147 public QueueSession getQueueSession() throws JMSException { 148 return (QueueSession )this; 149 } 150 151 void startLocalTransactionIfNeeded() throws JMSException { 154 } 156 157 } 158 | Popular Tags |