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 OutboundQueueConnection 37 extends OutboundConnection 38 implements javax.jms.QueueConnection 39 { 40 46 OutboundQueueConnection(ManagedConnectionImpl managedCx, 47 XAQueueConnection xac) 48 { 49 super(managedCx, xac); 50 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 51 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 52 "OutboundQueueConnection(" + managedCx + 53 ", " + xac + ")"); 54 } 55 56 57 64 public QueueSession 65 createQueueSession(boolean transacted, int acknowledgeMode) 66 throws JMSException { 67 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 68 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 69 this + " createQueueSession(" + 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 + " createQueueSession sess = " + managedCx.session); 78 Session sess = managedCx.session; 79 if (sess == null) 80 sess = xac.createSession(false, acknowledgeMode); 81 82 return new OutboundQueueSession(sess, this, transacted); 83 } 84 85 89 public ConnectionConsumer 90 createConnectionConsumer(Queue queue, 91 String messageSelector, 92 ServerSessionPool sessionPool, 93 int maxMessages) 94 throws JMSException 95 { 96 throw new IllegalStateException ("Forbidden call on a component's " 97 + "connection."); 98 } 99 } 100 | Popular Tags |