001 package com.mockrunner.mock.jms; 002 003 import javax.jms.JMSException; 004 import javax.jms.Message; 005 import javax.jms.Topic; 006 import javax.jms.TopicPublisher; 007 008 /** 009 * Mock implementation of JMS <code>TopicPublisher</code>. 010 */ 011 public class MockTopicPublisher extends MockMessageProducer implements TopicPublisher 012 { 013 public MockTopicPublisher(MockConnection connection, MockSession session, MockTopic topic) 014 { 015 super(connection, session, topic); 016 } 017 018 public Topic getTopic() throws JMSException 019 { 020 return (Topic)getDestination(); 021 } 022 023 public void publish(Message message) throws JMSException 024 { 025 super.send(message); 026 } 027 028 public void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException 029 { 030 super.send(message, deliveryMode, priority, timeToLive); 031 } 032 033 public void publish(Topic topic, Message message) throws JMSException 034 { 035 super.send(topic, message); 036 } 037 038 public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException 039 { 040 super.send(topic, message, deliveryMode, priority, timeToLive); 041 } 042 }