KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > jms > session > TopicPublisherImpl


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.jms.session;
30
31 import javax.jms.JMSException JavaDoc;
32 import javax.jms.Message JavaDoc;
33 import javax.jms.Topic JavaDoc;
34 import javax.jms.TopicPublisher JavaDoc;
35
36 /**
37  * A basic topic.
38  */

39 public class TopicPublisherImpl extends MessageProducerImpl
40   implements TopicPublisher JavaDoc {
41   public TopicPublisherImpl(SessionImpl session, Topic JavaDoc topic)
42   {
43     super(session, topic);
44   }
45
46   /**
47    * Returns the topic
48    */

49   public Topic JavaDoc getTopic()
50   {
51     return (Topic JavaDoc) super.getDestination();
52   }
53
54   /**
55    * Publishes a message to the topic
56    *
57    * @param message the message to publish
58    */

59   public void publish(Message JavaDoc message)
60     throws JMSException JavaDoc
61   {
62     send(message);
63   }
64   
65   /**
66    * Publishes a message to the topic
67    *
68    * @param message the message to publish
69    * @param deliveryMode the delivery mode
70    * @param priority the priority
71    * @param timeToLive how long the message should live
72    */

73   public void publish(Message JavaDoc message,
74                       int deliveryMode,
75                       int priority,
76                       long timeToLive)
77     throws JMSException JavaDoc
78   {
79     send(message, deliveryMode, priority, timeToLive);
80   }
81
82   /**
83    * Publishes a message to the topic
84    *
85    * @param topic the topic the message should be publish to
86    * @param message the message to publish
87    */

88   public void publish(Topic JavaDoc topic, Message JavaDoc message)
89     throws JMSException JavaDoc
90   {
91     send(topic, message);
92   }
93   
94   /**
95    * Publishes a message to the topic
96    *
97    * @param topic the topic the message should be publish to
98    * @param message the message to publish
99    * @param deliveryMode the delivery mode
100    * @param priority the priority
101    * @param timeToLive how long the message should live
102    */

103   public void publish(Topic JavaDoc topic,
104                       Message JavaDoc message,
105                       int deliveryMode,
106                       int priority,
107                       long timeToLive)
108     throws JMSException JavaDoc
109   {
110     send(topic, message, deliveryMode, priority, timeToLive);
111   }
112 }
113
114
115
116
Popular Tags