1 23 package org.objectweb.joram.client.connector; 24 25 import javax.jms.*; 26 import javax.jms.IllegalStateException ; 27 28 import org.objectweb.util.monolog.api.BasicLevel; 29 30 36 public class OutboundTopicConnection 37 extends OutboundConnection 38 implements javax.jms.TopicConnection 39 { 40 46 OutboundTopicConnection(ManagedConnectionImpl managedCx, 47 XATopicConnection xac) { 48 super(managedCx, xac); 49 50 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 51 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 52 "OutboundTopicConnection(" + managedCx + 53 ", " + xac + ")"); 54 } 55 56 57 64 public TopicSession 65 createTopicSession(boolean transacted, int acknowledgeMode) 66 throws JMSException { 67 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 68 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 69 this + " createTopicSession(" + transacted + 70 ", " + acknowledgeMode + ")"); 71 72 if (! valid) 73 throw new javax.jms.IllegalStateException ("Invalid connection handle."); 74 75 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 76 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 77 this + " createTopicSession sess = " + managedCx.session); 78 79 Session sess = managedCx.session; 80 if (sess == null) 81 sess = xac.createSession(false, acknowledgeMode); 82 83 return new OutboundTopicSession(sess, this, transacted); 84 } 85 86 90 public ConnectionConsumer 91 createConnectionConsumer(Topic topic, 92 String messageSelector, 93 ServerSessionPool sessionPool, 94 int maxMessages) 95 throws JMSException { 96 throw new IllegalStateException ("Forbidden call on a component's " 97 + "connection."); 98 } 99 } 100 | Popular Tags |