1 24 package com.scalagent.kjoram; 25 26 import com.scalagent.kjoram.excepts.IllegalStateException; 27 import com.scalagent.kjoram.excepts.JMSException; 28 29 30 public class QueueSession extends Session 31 { 32 41 QueueSession(Connection cnx, boolean transacted, 42 int acknowledgeMode) throws JMSException 43 { 44 super(cnx, transacted, acknowledgeMode); 45 } 46 47 48 public String toString() 49 { 50 return "QueueSess:" + ident; 51 } 52 53 54 61 public QueueSender createSender(Queue queue) 62 throws JMSException 63 { 64 if (closed) 65 throw new IllegalStateException ("Forbidden call on a closed session."); 66 67 return new QueueSender(this, (Queue) queue); 68 } 69 70 77 public QueueReceiver 78 createReceiver(Queue queue, String selector) 79 throws JMSException 80 { 81 if (closed) 82 throw new IllegalStateException ("Forbidden call on a closed session."); 83 84 return new QueueReceiver(this, (Queue) queue, selector); 85 } 86 87 94 public QueueReceiver createReceiver(Queue queue) 95 throws JMSException 96 { 97 if (closed) 98 throw new IllegalStateException ("Forbidden call on a closed session."); 99 100 return new QueueReceiver(this, (Queue) queue, null); 101 } 102 103 108 public TopicSubscriber 109 createDurableSubscriber(Topic topic, String name, 110 String selector, 111 boolean noLocal) throws JMSException 112 { 113 throw new IllegalStateException ("Forbidden call on a QueueSession."); 114 } 115 116 121 public TopicSubscriber 122 createDurableSubscriber(Topic topic, String name) 123 throws JMSException 124 { 125 throw new IllegalStateException ("Forbidden call on a QueueSession."); 126 } 127 128 133 public Topic createTopic(String topicName) throws JMSException 134 { 135 throw new IllegalStateException ("Forbidden call on a QueueSession."); 136 } 137 138 143 public TemporaryTopic createTemporaryTopic() throws JMSException 144 { 145 throw new IllegalStateException ("Forbidden call on a QueueSession."); 146 } 147 148 153 public void unsubscribe(String name) throws JMSException 154 { 155 throw new IllegalStateException ("Forbidden call on a QueueSession."); 156 } 157 } 158 | Popular Tags |