00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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 TopicSession extends Session
00031 {
00041 TopicSession(Connection cnx, boolean transacted,
00042 int acknowledgeMode) throws JMSException
00043 {
00044 super(cnx, transacted, acknowledgeMode);
00045 }
00046
00047
00049 public String toString()
00050 {
00051 return "TopicSess:" + ident;
00052 }
00053
00061 public TopicPublisher
00062 createPublisher(Topic topic) throws JMSException
00063 {
00064 return new TopicPublisher(this, (Topic) topic);
00065 }
00066
00074 public TopicSubscriber
00075 createSubscriber(Topic topic, String selector,
00076 boolean noLocal) throws JMSException
00077 {
00078 if (closed)
00079 throw new IllegalStateException("Forbidden call on a closed session.");
00080
00081 return new TopicSubscriber(this, (Topic) topic, null, selector, noLocal);
00082 }
00083
00091 public TopicSubscriber
00092 createSubscriber(Topic topic) throws JMSException
00093 {
00094 if (closed)
00095 throw new IllegalStateException("Forbidden call on a closed session.");
00096
00097 return new TopicSubscriber(this, (Topic) topic, null, null, false);
00098 }
00099
00105 public QueueBrowser
00106 createBrowser(Queue queue, String selector)
00107 throws JMSException
00108 {
00109 throw new IllegalStateException("Forbidden call on a TopicSession.");
00110 }
00111
00117 public QueueBrowser createBrowser(Queue queue)
00118 throws JMSException
00119 {
00120 throw new IllegalStateException("Forbidden call on a TopicSession.");
00121 }
00122
00128 public Queue createQueue(String queueName) throws JMSException
00129 {
00130 throw new IllegalStateException("Forbidden call on a TopicSession.");
00131 }
00132
00138 public TemporaryQueue createTemporaryQueue() throws JMSException
00139 {
00140 throw new IllegalStateException("Forbidden call on a TopicSession.");
00141 }
00142
00143 }