com/scalagent/kjoram/TopicPublisher.java

00001 /*
00002  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
00003  * Copyright (C) 2001 - ScalAgent Distributed Technologies
00004  * Copyright (C) 1996 - Dyade
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA.
00020  *
00021  * Initial developer(s): Frederic Maistre (INRIA)
00022  * Contributor(s): Nicolas Tachker (ScalAgent)
00023  */
00024 package com.scalagent.kjoram;
00025 
00026 import com.scalagent.kjoram.excepts.IllegalStateException;
00027 import com.scalagent.kjoram.excepts.JMSException;
00028 
00029 public class TopicPublisher extends MessageProducer
00030 {
00040   TopicPublisher(TopicSession sess, Topic topic) throws JMSException
00041   {
00042     super(sess, topic);
00043   }
00044 
00046   public String toString()
00047   {
00048     return "TopicPub:" + sess.ident;
00049   }
00050 
00056   public Topic getTopic() throws JMSException
00057   {
00058     if (closed)
00059       throw new IllegalStateException("Forbidden call on a closed publisher.");
00060 
00061     return (Topic) super.dest;
00062   }
00063 
00071   public void publish(Message message, int deliveryMode,
00072                       int priority, long timeToLive) throws JMSException
00073   {
00074     super.send(message, deliveryMode, priority, timeToLive);
00075   }
00076     
00084   public void publish(Message message) throws JMSException
00085   {
00086     super.send(message);
00087   }
00088 
00096   public void publish(Topic topic, Message message)
00097             throws JMSException
00098   {
00099     super.send(topic, message);
00100   }
00101 
00109   public void publish(Topic topic, Message message,
00110                       int deliveryMode, int priority,
00111                       long timeToLive) throws JMSException
00112   {
00113     super.send(topic, message, deliveryMode, priority, timeToLive);
00114   }
00115 }

Generated on Tue Sep 16 16:14:25 2008 for joram by  doxygen 1.5.0