1 23 package org.objectweb.joram.client.connector; 24 25 import javax.jms.JMSException ; 26 import javax.jms.MessageConsumer ; 27 import javax.jms.Topic ; 28 import javax.jms.TopicSubscriber ; 29 import javax.jms.Session ; 30 31 import org.objectweb.util.monolog.api.BasicLevel; 32 33 37 public class OutboundTopicSession extends OutboundSession 38 implements javax.jms.TopicSession 39 { 40 43 OutboundTopicSession(Session sess, OutboundConnection cnx) { 44 super(sess, cnx); 45 46 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 47 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 48 "OutboundTopicSession(" + sess + 49 ", " + cnx + ")"); 50 } 51 52 55 OutboundTopicSession(Session sess, 56 OutboundConnection cnx, 57 boolean transacted) { 58 super(sess, cnx, transacted); 59 60 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 61 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 62 "OutboundTopicSession(" + sess + 63 ", " + cnx + ")"); 64 } 65 66 69 public javax.jms.TopicPublisher createPublisher(Topic topic) 70 throws JMSException { 71 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 72 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 73 this + " createPublisher(" + topic + ")"); 74 75 checkValidity(); 76 return new OutboundPublisher(sess.createProducer(topic), this); 77 } 78 79 82 public TopicSubscriber createSubscriber(Topic topic, 83 String selector, 84 boolean noLocal) 85 throws JMSException { 86 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 87 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 88 this + " createSubscriber(" + topic + 89 ", " + selector + 90 ", " + noLocal + ")"); 91 92 checkValidity(); 93 MessageConsumer cons = sess.createConsumer(topic, selector, noLocal); 94 return new OutboundSubscriber(topic, noLocal, cons, this); 95 } 96 97 100 public TopicSubscriber createSubscriber(Topic topic, String selector) 101 throws JMSException { 102 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 103 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 104 this + " createSubscriber(" + topic + 105 ", " + selector + ")"); 106 107 checkValidity(); 108 MessageConsumer cons = sess.createConsumer(topic, selector); 109 return new OutboundSubscriber(topic, false, cons, this); 110 } 111 112 115 public TopicSubscriber createSubscriber(Topic topic) 116 throws JMSException { 117 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 118 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 119 this + " createSubscriber(" + topic + ")"); 120 121 checkValidity(); 122 return new OutboundSubscriber(topic, 123 false, 124 sess.createConsumer(topic), 125 this); 126 } 127 128 133 public javax.jms.QueueBrowser 134 createBrowser(javax.jms.Queue queue, 135 String selector) 136 throws JMSException { 137 throw new javax.jms.IllegalStateException ("Forbidden call on a TopicSession."); 138 } 139 140 145 public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) 146 throws JMSException { 147 throw new javax.jms.IllegalStateException ("Forbidden call on a TopicSession."); 148 } 149 150 155 public javax.jms.Queue createQueue(String queueName) 156 throws JMSException { 157 throw new javax.jms.IllegalStateException ("Forbidden call on a TopicSession."); 158 } 159 160 165 public javax.jms.TemporaryQueue createTemporaryQueue() 166 throws JMSException { 167 throw new javax.jms.IllegalStateException ("Forbidden call on a TopicSession."); 168 } 169 } 170 | Popular Tags |