1 24 package com.scalagent.kjoram; 25 26 import com.scalagent.kjoram.excepts.IllegalStateException; 27 import com.scalagent.kjoram.excepts.JMSException; 28 29 public class TopicPublisher extends MessageProducer 30 { 31 40 TopicPublisher(TopicSession sess, Topic topic) throws JMSException 41 { 42 super(sess, topic); 43 } 44 45 46 public String toString() 47 { 48 return "TopicPub:" + sess.ident; 49 } 50 51 56 public Topic getTopic() throws JMSException 57 { 58 if (closed) 59 throw new IllegalStateException ("Forbidden call on a closed publisher."); 60 61 return (Topic) super.dest; 62 } 63 64 71 public void publish(Message message, int deliveryMode, 72 int priority, long timeToLive) throws JMSException 73 { 74 super.send(message, deliveryMode, priority, timeToLive); 75 } 76 77 84 public void publish(Message message) throws JMSException 85 { 86 super.send(message); 87 } 88 89 96 public void publish(Topic topic, Message message) 97 throws JMSException 98 { 99 super.send(topic, message); 100 } 101 102 109 public void publish(Topic topic, Message message, 110 int deliveryMode, int priority, 111 long timeToLive) throws JMSException 112 { 113 super.send(topic, message, deliveryMode, priority, timeToLive); 114 } 115 } 116 | Popular Tags |