com/scalagent/kjoram/QueueSession.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 
00030 public class QueueSession extends Session
00031 {
00041   QueueSession(Connection cnx, boolean transacted,
00042                int acknowledgeMode) throws JMSException
00043   {
00044     super(cnx, transacted, acknowledgeMode);
00045   }
00046 
00048   public String toString()
00049   {
00050     return "QueueSess:" + ident;
00051   }
00052 
00053 
00061   public QueueSender createSender(Queue queue)
00062        throws JMSException
00063   {
00064     if (closed)
00065       throw new IllegalStateException("Forbidden call on a closed session.");
00066 
00067     return new QueueSender(this, (Queue) queue);
00068   }
00069 
00077   public QueueReceiver
00078          createReceiver(Queue queue, String selector)
00079          throws JMSException
00080   {
00081     if (closed)
00082       throw new IllegalStateException("Forbidden call on a closed session.");
00083 
00084     return new QueueReceiver(this, (Queue) queue, selector);
00085   }
00086 
00094   public QueueReceiver createReceiver(Queue queue)
00095          throws JMSException
00096   {
00097     if (closed)
00098       throw new IllegalStateException("Forbidden call on a closed session.");
00099 
00100     return new QueueReceiver(this, (Queue) queue, null);
00101   }
00102 
00108   public TopicSubscriber
00109          createDurableSubscriber(Topic topic, String name,
00110                                  String selector,
00111                                  boolean noLocal) throws JMSException
00112   {
00113     throw new IllegalStateException("Forbidden call on a QueueSession.");
00114   }
00115 
00121   public TopicSubscriber
00122          createDurableSubscriber(Topic topic, String name)
00123          throws JMSException
00124   {
00125     throw new IllegalStateException("Forbidden call on a QueueSession.");
00126   }
00127 
00133   public Topic createTopic(String topicName) throws JMSException
00134   {
00135     throw new IllegalStateException("Forbidden call on a QueueSession.");
00136   }
00137 
00143   public TemporaryTopic createTemporaryTopic() throws JMSException
00144   {
00145     throw new IllegalStateException("Forbidden call on a QueueSession.");
00146   }
00147 
00153   public void unsubscribe(String name) throws JMSException
00154   {
00155     throw new IllegalStateException("Forbidden call on a QueueSession.");
00156   }
00157 }

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