1 23 package org.objectweb.joram.client.connector; 24 25 import javax.jms.JMSException ; 26 import javax.jms.Queue ; 27 import javax.jms.Session ; 28 29 import org.objectweb.util.monolog.api.BasicLevel; 30 31 35 public class OutboundQueueSession extends OutboundSession 36 implements javax.jms.QueueSession 37 { 38 41 OutboundQueueSession(Session sess, OutboundConnection cnx) { 42 super(sess, cnx); 43 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 44 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 45 "OutboundQueueSession(" + sess + 46 ", " + cnx + ")"); 47 } 48 49 52 OutboundQueueSession(Session sess, 53 OutboundConnection cnx, 54 boolean transacted) { 55 super(sess, cnx, transacted); 56 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 57 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 58 "OutboundQueueSession(" + sess + 59 ", " + cnx + ")"); 60 } 61 62 65 public javax.jms.QueueSender createSender(Queue queue) 66 throws JMSException { 67 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 68 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, this + " createSender(" + queue + ")"); 69 70 checkValidity(); 71 return new OutboundSender(sess.createProducer(queue), this); 72 } 73 74 77 public javax.jms.QueueReceiver createReceiver(Queue queue, String selector) 78 throws JMSException { 79 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 80 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 81 this + " createReceiver(" + queue + 82 ", " + selector + ")"); 83 84 checkValidity(); 85 return new OutboundReceiver(queue, 86 sess.createConsumer(queue, selector), 87 this); 88 } 89 90 93 public javax.jms.QueueReceiver createReceiver(Queue queue) 94 throws JMSException { 95 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 96 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, this + " createReceiver(" + queue + ")"); 97 98 checkValidity(); 99 return new OutboundReceiver(queue, sess.createConsumer(queue), this); 100 } 101 102 107 public javax.jms.TopicSubscriber 108 createDurableSubscriber(javax.jms.Topic topic, 109 String name, 110 String selector, 111 boolean noLocal) 112 throws JMSException { 113 throw new javax.jms.IllegalStateException ("Forbidden call on a OutboundQueueSession."); 114 } 115 116 121 public javax.jms.TopicSubscriber 122 createDurableSubscriber(javax.jms.Topic topic, 123 String name) 124 throws JMSException { 125 throw new javax.jms.IllegalStateException ("Forbidden call on a OutboundQueueSession."); 126 } 127 128 133 public javax.jms.Topic createTopic(String topicName) 134 throws JMSException { 135 throw new javax.jms.IllegalStateException ("Forbidden call on a OutboundQueueSession."); 136 } 137 138 143 public javax.jms.TemporaryTopic createTemporaryTopic() 144 throws JMSException { 145 throw new javax.jms.IllegalStateException ("Forbidden call on a OutboundQueueSession."); 146 } 147 148 153 public void unsubscribe(String name) 154 throws JMSException { 155 throw new javax.jms.IllegalStateException ("Forbidden call on a OutboundQueueSession."); 156 } 157 158 public String toString() { 159 if (sess != null) 160 return sess.toString(); 161 return null; 162 } 163 } 164 | Popular Tags |