1 23 package org.objectweb.joram.client.connector; 24 25 import javax.jms.JMSException ; 26 import javax.jms.MessageConsumer ; 27 import javax.jms.Queue ; 28 import javax.jms.JMSSecurityException ; 29 30 import org.objectweb.joram.client.jms.TemporaryQueue; 31 import javax.jms.Connection ; 32 33 import org.objectweb.util.monolog.api.BasicLevel; 34 35 39 public class OutboundReceiver extends OutboundConsumer 40 implements javax.jms.QueueReceiver 41 { 42 43 private Queue queue; 44 45 46 49 OutboundReceiver(Queue queue, 50 MessageConsumer consumer, 51 OutboundSession session) 52 throws JMSException { 53 super(consumer, session); 54 this.queue = queue; 55 56 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 57 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 58 "OutboundReceiver(" + queue + 59 ", " + consumer + 60 ", " + session + ")"); 61 62 if (queue instanceof TemporaryQueue) { 63 Connection tempQCnx = ((TemporaryQueue) queue).getCnx(); 64 65 if (tempQCnx == null || !session.cnx.cnxEquals(tempQCnx)) 66 throw new JMSSecurityException ("Forbidden consumer on this " 67 + "temporary destination."); 68 } 69 } 70 71 72 73 public Queue getQueue() throws JMSException { 74 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 75 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, this + " getQueue() = " + queue); 76 77 checkValidity(); 78 return queue; 79 } 80 } 81 | Popular Tags |