1 package com.ubermq.jms.client.impl; 2 3 import javax.jms.*; 4 5 import com.ubermq.jms.common.datagram.*; 6 import com.ubermq.kernel.*; 7 8 17 final class TopicSession 18 extends Session 19 implements javax.jms.TopicSession 20 { 21 30 TopicSession(Connection conn, 31 IMessageDatagramFactory factory, 32 int ackMode) 33 { 34 super(conn, factory, ackMode); 35 } 36 37 public TopicSubscriber createSubscriber(Topic topic) 38 throws JMSException 39 { 40 return createSubscriber(topic, null, Session.DEFAULT_NO_LOCAL); 41 } 42 43 public TopicSubscriber createSubscriber(Topic topic, 44 java.lang.String messageSelector, 45 boolean noLocal) 46 throws JMSException 47 { 48 return (TopicSubscriber)createConsumer(topic, messageSelector, noLocal); 49 } 50 51 public TopicPublisher createPublisher(Topic topic) 52 throws JMSException 53 { 54 return new LocalTopicPublisher(topic); 55 } 56 57 60 final private class LocalTopicPublisher 61 extends AbstractProducer 62 implements javax.jms.TopicPublisher , IDatagramEndpoint 63 { 64 68 private LocalTopicPublisher(Topic t) 69 { 70 super(t, TopicSession.this); 71 } 72 73 public Topic getTopic() 74 throws JMSException 75 { 76 return (Topic)getDestination(); 77 } 78 79 public void publish(Message message) 80 throws JMSException 81 { 82 super.send(message); 83 } 84 85 public void publish(Message message, 86 int deliveryMode, 87 int priority, 88 long timeToLive) 89 throws JMSException 90 { 91 super.send(message, deliveryMode, priority, timeToLive); 92 } 93 94 public void publish(Topic topic, 95 Message message) 96 throws JMSException 97 { 98 super.send(topic, message); 99 } 100 101 public void publish(Topic topic, 102 Message message, 103 int deliveryMode, 104 int priority, 105 long timeToLive) 106 throws JMSException 107 { 108 super.send(topic, 109 message, 110 deliveryMode, 111 priority, 112 timeToLive); 113 } 114 } 115 } 116 | Popular Tags |