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.Topic ; 29 30 import org.objectweb.util.monolog.api.BasicLevel; 31 32 36 public class OutboundPublisher extends OutboundProducer 37 implements javax.jms.TopicPublisher 38 { 39 45 OutboundPublisher(MessageProducer producer, OutboundSession session) { 46 super(producer, session); 47 48 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 49 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 50 "OutboundPublisher(" + producer + 51 ", " + session + ")"); 52 } 53 54 55 56 public Topic getTopic() throws JMSException 57 { 58 checkValidity(); 59 return (Topic ) producer.getDestination(); 60 } 61 62 63 public void publish(Message message, 64 int deliveryMode, 65 int priority, 66 long timeToLive) 67 throws JMSException { 68 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 69 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 70 this + " publish(" + message + 71 ", " + deliveryMode + 72 ", " + priority + 73 ", " + timeToLive + ")"); 74 75 checkValidity(); 76 producer.send(message, deliveryMode, priority, timeToLive); 77 } 78 79 80 public void publish(Message message) throws JMSException { 81 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 82 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 83 this + " publish(" + message + ")"); 84 85 checkValidity(); 86 producer.send(message); 87 } 88 89 90 public void publish(Topic topic, 91 Message message, 92 int deliveryMode, 93 int priority, 94 long timeToLive) 95 throws JMSException { 96 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 97 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 98 this + " publish(" + topic + 99 ", " + message + 100 ", " + deliveryMode + 101 ", " + priority + 102 ", " + timeToLive + ")"); 103 104 checkValidity(); 105 producer.send(topic, message, deliveryMode, priority, timeToLive); 106 } 107 108 109 public void publish(Topic topic, Message message) throws JMSException { 110 if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG)) 111 AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, 112 this + " publish(" + topic + 113 ", " + message + ")"); 114 115 checkValidity(); 116 producer.send(topic, message); 117 } 118 } 119 | Popular Tags |