1 23 package org.objectweb.joram.client.connector; 24 25 import javax.jms.JMSException ; 26 import javax.jms.Message ; 27 import javax.jms.MessageProducer ; 28 import javax.jms.Queue ; 29 30 import org.objectweb.util.monolog.api.BasicLevel; 31 32 36 public class OutboundSender extends OutboundProducer 37 implements javax.jms.QueueSender 38 { 39 42 OutboundSender(MessageProducer producer, OutboundSession session) { 43 super(producer, session); 44 45 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 46 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 47 "OutboundSender(" + producer + 48 ", " + session + ")"); 49 } 50 51 52 53 public Queue getQueue() throws JMSException { 54 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 55 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 56 this + " getQueue() = " + producer.getDestination()); 57 58 checkValidity(); 59 return (Queue ) producer.getDestination(); 60 } 61 62 63 public void send(Queue queue, 64 Message message, 65 int deliveryMode, 66 int priority, 67 long timeToLive) 68 throws JMSException { 69 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 70 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 71 this + " send(" + queue + 72 ", " + message + 73 ", " + deliveryMode + 74 ", " + priority + 75 ", " + timeToLive + ")"); 76 77 checkValidity(); 78 producer.send(queue, message, deliveryMode, priority, timeToLive); 79 } 80 81 82 public void send(Queue queue, Message message) 83 throws JMSException { 84 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 85 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 86 this + " send(" + queue + 87 ", " + message + ")"); 88 89 checkValidity(); 90 producer.send(queue, message); 91 } 92 } 93 | Popular Tags |