1 26 package org.objectweb.joram.client.jms; 27 28 import javax.jms.JMSException ; 29 import javax.jms.IllegalStateException ; 30 import javax.jms.TransactionInProgressException ; 31 32 import org.objectweb.joram.shared.client.*; 33 34 import org.objectweb.util.monolog.api.BasicLevel; 35 36 46 public class XASession implements javax.jms.XASession { 47 48 49 private javax.transaction.xa.XAResource xaResource; 50 51 protected Session sess; 52 53 64 public XASession(Connection cnx, 65 Session sess, 66 XAResourceMngr rm) 67 throws JMSException { 68 this.sess = sess; 69 xaResource = new XAResource(rm, sess); 70 } 71 72 public final Session getDelegateSession() { 73 return sess; 74 } 75 76 77 public String toString() 78 { 79 return "XASess:" + sess.getId(); 80 } 81 82 87 public javax.jms.Session getSession() throws JMSException 88 { 89 return sess; 90 } 91 92 93 public javax.transaction.xa.XAResource getXAResource() 94 { 95 return xaResource; 96 } 97 98 103 public boolean getTransacted() throws JMSException 104 { 105 return sess.getTransacted(); 106 } 107 108 111 public javax.jms.QueueBrowser 112 createBrowser(javax.jms.Queue queue, String selector) 113 throws JMSException 114 { 115 return sess.createBrowser(queue, selector); 116 } 117 118 121 public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) 122 throws JMSException 123 { 124 return sess.createBrowser(queue); 125 } 126 127 130 public javax.jms.MessageProducer createProducer(javax.jms.Destination dest) 131 throws JMSException 132 { 133 return sess.createProducer(dest); 134 } 135 136 139 public javax.jms.MessageConsumer 140 createConsumer(javax.jms.Destination dest, 141 String selector, 142 boolean noLocal) 143 throws JMSException 144 { 145 return sess.createConsumer(dest, selector, noLocal); 146 } 147 148 151 public javax.jms.MessageConsumer 152 createConsumer(javax.jms.Destination dest, String selector) 153 throws JMSException 154 { 155 return sess.createConsumer(dest, selector); 156 } 157 158 161 public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest) 162 throws JMSException 163 { 164 return sess.createConsumer(dest); 165 } 166 167 170 public javax.jms.TopicSubscriber 171 createDurableSubscriber(javax.jms.Topic topic, 172 String name, 173 String selector, 174 boolean noLocal) 175 throws JMSException 176 { 177 return sess.createDurableSubscriber(topic, name, selector, noLocal); 178 } 179 180 183 public javax.jms.TopicSubscriber 184 createDurableSubscriber(javax.jms.Topic topic, String name) 185 throws JMSException 186 { 187 return sess.createDurableSubscriber(topic, name); 188 } 189 190 196 public void commit() throws JMSException 197 { 198 throw new IllegalStateException ("Forbidden call on an XA session."); 199 } 200 201 207 public void rollback() throws JMSException 208 { 209 throw new IllegalStateException ("Forbidden call on an XA session."); 210 } 211 212 218 public void recover() throws JMSException 219 { 220 throw new IllegalStateException ("Forbidden call on an XA session."); 221 } 222 223 227 public void close() throws JMSException { 228 sess.close(); 229 } 230 231 234 public void run() { 235 sess.run(); 236 } 237 238 public void unsubscribe(String name) 239 throws JMSException { 240 sess.unsubscribe(name); 241 } 242 243 public synchronized javax.jms.TemporaryQueue createTemporaryQueue() 244 throws JMSException { 245 return sess.createTemporaryQueue(); 246 } 247 248 public synchronized javax.jms.TemporaryTopic createTemporaryTopic() 249 throws JMSException { 250 return sess.createTemporaryTopic(); 251 } 252 253 public synchronized javax.jms.Topic createTopic( 254 String topicName) 255 throws JMSException { 256 return sess.createTopic(topicName); 257 } 258 259 public javax.jms.Queue createQueue(String queueName) 260 throws JMSException { 261 return sess.createQueue(queueName); 262 } 263 264 public void setMessageListener( 265 javax.jms.MessageListener messageListener) 266 throws JMSException { 267 sess.setMessageListener(messageListener); 268 } 269 270 public javax.jms.MessageListener 271 getMessageListener() 272 throws JMSException { 273 return sess.getMessageListener(); 274 } 275 276 public int getAcknowledgeMode() 277 throws JMSException { 278 return sess.getAcknowledgeMode(); 279 } 280 281 public javax.jms.TextMessage createTextMessage() 282 throws JMSException { 283 return sess.createTextMessage(); 284 } 285 286 public javax.jms.TextMessage createTextMessage(String text) 287 throws JMSException { 288 return sess.createTextMessage(text); 289 } 290 291 public javax.jms.StreamMessage createStreamMessage() 292 throws JMSException { 293 return sess.createStreamMessage(); 294 } 295 296 public javax.jms.ObjectMessage createObjectMessage() 297 throws JMSException { 298 return sess.createObjectMessage(); 299 } 300 301 public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable obj) 302 throws JMSException { 303 return sess.createObjectMessage(obj); 304 } 305 306 public javax.jms.Message createMessage() 307 throws JMSException { 308 return sess.createMessage(); 309 } 310 311 public javax.jms.MapMessage createMapMessage() 312 throws JMSException { 313 return sess.createMapMessage(); 314 } 315 316 public javax.jms.BytesMessage createBytesMessage() 317 throws JMSException { 318 return sess.createBytesMessage(); 319 } 320 } 321 | Popular Tags |