1 24 package org.objectweb.joram.client.jms; 25 26 import javax.jms.IllegalStateException ; 27 import javax.jms.JMSException ; 28 29 import org.objectweb.joram.client.jms.connection.RequestMultiplexer; 30 31 34 public class QueueSession extends Session implements javax.jms.QueueSession 35 { 36 45 QueueSession(Connection cnx, 46 boolean transacted, 47 int acknowledgeMode, 48 RequestMultiplexer mtpx) throws JMSException 49 { 50 super(cnx, transacted, acknowledgeMode, mtpx); 51 } 52 53 54 public String toString() 55 { 56 return "QueueSess:" + getId(); 57 } 58 59 60 67 public synchronized javax.jms.QueueSender createSender(javax.jms.Queue queue) 68 throws JMSException { 69 checkClosed(); 70 QueueSender qc = new QueueSender(this, (Destination) queue); 71 addProducer(qc); 72 return qc; 73 } 74 75 82 public javax.jms.QueueReceiver 83 createReceiver(javax.jms.Queue queue, String selector) 84 throws JMSException { 85 checkClosed(); 86 QueueReceiver qr = new QueueReceiver(this, (Destination) queue, selector); 87 addConsumer(qr); 88 return qr; 89 } 90 91 98 public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue) 99 throws JMSException { 100 checkClosed(); 101 QueueReceiver qr = new QueueReceiver(this, (Destination) queue, null); 102 addConsumer(qr); 103 return qr; 104 } 105 106 111 public javax.jms.TopicSubscriber 112 createDurableSubscriber(javax.jms.Topic topic, String name, 113 String selector, 114 boolean noLocal) throws JMSException 115 { 116 throw new IllegalStateException ("Forbidden call on a QueueSession."); 117 } 118 119 124 public javax.jms.TopicSubscriber 125 createDurableSubscriber(javax.jms.Topic topic, String name) 126 throws JMSException 127 { 128 throw new IllegalStateException ("Forbidden call on a QueueSession."); 129 } 130 131 136 public javax.jms.Topic createTopic(String topicName) throws JMSException 137 { 138 throw new IllegalStateException ("Forbidden call on a QueueSession."); 139 } 140 141 146 public javax.jms.TemporaryTopic createTemporaryTopic() throws JMSException 147 { 148 throw new IllegalStateException ("Forbidden call on a QueueSession."); 149 } 150 151 156 public void unsubscribe(String name) throws JMSException 157 { 158 throw new IllegalStateException ("Forbidden call on a QueueSession."); 159 } 160 } 161 | Popular Tags |