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 TopicSession extends Session implements javax.jms.TopicSession 35 { 36 45 TopicSession(Connection cnx, 46 boolean transacted, 47 int acknowledgeMode, 48 RequestMultiplexer mtpx) 49 throws JMSException { 50 super(cnx, transacted, acknowledgeMode, mtpx); 51 } 52 53 54 55 public String toString() 56 { 57 return "TopicSess:" + getId(); 58 } 59 60 67 public javax.jms.TopicPublisher 68 createPublisher(javax.jms.Topic topic) throws JMSException 69 { 70 checkClosed(); 71 TopicPublisher tp = new TopicPublisher(this, (Destination) topic); 72 addProducer(tp); 73 return tp; 74 } 75 76 83 public javax.jms.TopicSubscriber 84 createSubscriber(javax.jms.Topic topic, String selector, 85 boolean noLocal) throws JMSException 86 { 87 checkClosed(); 88 TopicSubscriber ts = new TopicSubscriber( 89 this, (Destination) topic, null, selector, noLocal); 90 addConsumer(ts); 91 return ts; 92 } 93 94 101 public javax.jms.TopicSubscriber 102 createSubscriber(javax.jms.Topic topic) throws JMSException 103 { 104 checkClosed(); 105 TopicSubscriber ts = new TopicSubscriber( 106 this, (Destination) topic, null, null, false); 107 addConsumer(ts); 108 return ts; 109 } 110 111 116 public javax.jms.QueueBrowser 117 createBrowser(javax.jms.Queue queue, String selector) 118 throws JMSException 119 { 120 throw new IllegalStateException ("Forbidden call on a TopicSession."); 121 } 122 123 128 public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) 129 throws JMSException 130 { 131 throw new IllegalStateException ("Forbidden call on a TopicSession."); 132 } 133 134 139 public javax.jms.Queue createQueue(String queueName) throws JMSException 140 { 141 throw new IllegalStateException ("Forbidden call on a TopicSession."); 142 } 143 144 149 public javax.jms.TemporaryQueue createTemporaryQueue() throws JMSException 150 { 151 throw new IllegalStateException ("Forbidden call on a TopicSession."); 152 } 153 154 } 155 | Popular Tags |