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 TopicSession extends Session 31 { 32 41 TopicSession(Connection cnx, boolean transacted, 42 int acknowledgeMode) throws JMSException 43 { 44 super(cnx, transacted, acknowledgeMode); 45 } 46 47 48 49 public String toString() 50 { 51 return "TopicSess:" + ident; 52 } 53 54 61 public TopicPublisher 62 createPublisher(Topic topic) throws JMSException 63 { 64 return new TopicPublisher(this, (Topic) topic); 65 } 66 67 74 public TopicSubscriber 75 createSubscriber(Topic topic, String selector, 76 boolean noLocal) throws JMSException 77 { 78 if (closed) 79 throw new IllegalStateException ("Forbidden call on a closed session."); 80 81 return new TopicSubscriber(this, (Topic) topic, null, selector, noLocal); 82 } 83 84 91 public TopicSubscriber 92 createSubscriber(Topic topic) throws JMSException 93 { 94 if (closed) 95 throw new IllegalStateException ("Forbidden call on a closed session."); 96 97 return new TopicSubscriber(this, (Topic) topic, null, null, false); 98 } 99 100 105 public QueueBrowser 106 createBrowser(Queue queue, String selector) 107 throws JMSException 108 { 109 throw new IllegalStateException ("Forbidden call on a TopicSession."); 110 } 111 112 117 public QueueBrowser createBrowser(Queue queue) 118 throws JMSException 119 { 120 throw new IllegalStateException ("Forbidden call on a TopicSession."); 121 } 122 123 128 public Queue createQueue(String queueName) throws JMSException 129 { 130 throw new IllegalStateException ("Forbidden call on a TopicSession."); 131 } 132 133 138 public TemporaryQueue createTemporaryQueue() throws JMSException 139 { 140 throw new IllegalStateException ("Forbidden call on a TopicSession."); 141 } 142 143 } 144 | Popular Tags |