1 43 package org.exolab.jms.client; 44 45 import javax.jms.JMSException ; 46 import javax.jms.Queue ; 47 import javax.jms.QueueReceiver ; 48 import javax.jms.QueueSender ; 49 import javax.jms.QueueSession ; 50 import javax.jms.TemporaryTopic ; 51 import javax.jms.Topic ; 52 import javax.jms.TopicSubscriber ; 53 54 55 61 class JmsQueueSession 62 extends JmsSession 63 implements QueueSession { 64 65 78 public JmsQueueSession(JmsQueueConnection connection, boolean transacted, 79 int ackMode) throws JMSException { 80 super(connection, transacted, ackMode); 81 } 82 83 90 public QueueReceiver createReceiver(Queue queue) throws JMSException { 91 return createReceiver(queue, null); 92 } 93 94 103 public QueueReceiver createReceiver(Queue queue, String selector) 104 throws JMSException { 105 long consumerId = allocateConsumer(queue, selector, false); 106 JmsQueueReceiver receiver = new JmsQueueReceiver(this, consumerId, 107 queue, selector); 108 addConsumer(receiver); 109 return receiver; 110 } 111 112 120 public QueueSender createSender(Queue queue) throws JMSException { 121 ensureOpen(); 122 JmsQueueSender sender = new JmsQueueSender(this, (JmsQueue) queue); 123 addProducer(sender); 124 return sender; 125 } 126 127 133 public TopicSubscriber createDurableSubscriber(Topic topic, String name, 134 String messageSelector, 135 boolean noLocal) 136 throws JMSException { 137 throw new IllegalStateException ("Invalid operation for QueueSession"); 138 } 139 140 146 public Topic createTopic(String topicName) throws JMSException { 147 throw new IllegalStateException ("Invalid operation for QueueSession"); 148 } 149 150 156 public TemporaryTopic createTemporaryTopic() throws JMSException { 157 throw new IllegalStateException ("Invalid operation for QueueSession"); 158 } 159 160 166 public void unsubscribe(String name) throws JMSException { 167 throw new IllegalStateException ("Invalid operation for QueueSession"); 168 } 169 170 } 171 | Popular Tags |