1 24 package com.scalagent.kjoram; 25 26 import com.scalagent.kjoram.excepts.JMSException; 27 import com.scalagent.kjoram.excepts.IllegalStateException; 28 29 public class TopicConnection extends Connection 30 { 31 40 public TopicConnection(FactoryParameters factoryParameters, 41 ConnectionItf connectionImpl) throws JMSException 42 { 43 super(factoryParameters, connectionImpl); 44 } 45 46 47 56 public ConnectionConsumer 57 createConnectionConsumer(Topic topic, String selector, 58 ServerSessionPool sessionPool, 59 int maxMessages) throws JMSException 60 { 61 if (closed) 62 throw new IllegalStateException ("Forbidden call on a closed" 63 + " connection."); 64 65 return new ConnectionConsumer(this, (Topic) topic, selector, 66 sessionPool, maxMessages); 67 } 68 69 78 public ConnectionConsumer 79 createDurableConnectionConsumer(Topic topic, String subName, 80 String selector, 81 ServerSessionPool sessPool, 82 int maxMessages) throws JMSException 83 { 84 if (closed) 85 throw new IllegalStateException ("Forbidden call on a closed" 86 + " connection."); 87 88 return new ConnectionConsumer(this, (Topic) topic, subName, selector, 89 sessPool, maxMessages); 90 } 91 92 98 public TopicSession 99 createTopicSession(boolean transacted, int acknowledgeMode) 100 throws JMSException 101 { 102 if (closed) 103 throw new IllegalStateException ("Forbidden call on a closed" 104 + " connection."); 105 106 return new TopicSession(this, transacted, acknowledgeMode); 107 } 108 } 109 | Popular Tags |