1 21 package com.presumo.jms.client; 22 23 import com.presumo.util.log.Logger; 24 import com.presumo.util.log.LoggerFactory; 25 import com.presumo.jms.resources.Resources; 26 import com.presumo.jms.router.Router; 27 28 import javax.jms.ConnectionConsumer ; 29 import javax.jms.JMSException ; 30 import javax.jms.TopicConnection ; 31 import javax.jms.TopicSession ; 32 import javax.jms.ServerSessionPool ; 33 import javax.jms.Session ; 34 import javax.jms.Topic ; 35 36 40 public class JmsTopicConnection 41 extends JmsConnection implements TopicConnection 42 { 43 44 48 public JmsTopicConnection(Router router) 49 { 50 super(router); 51 } 52 53 public JmsTopicConnection(Router router, String host, int port) 54 throws JMSException 55 { 56 super(router, host, port); 57 } 58 59 63 public synchronized TopicSession 64 createTopicSession(boolean transacted, int acknowledgeMode) 65 throws JMSException 66 { 67 logger.entry("createTopicSession"); 68 69 JmsTopicSession retval = 72 new JmsTopicSession(router, transacted, acknowledgeMode, this); 73 74 sessions.add(retval); 75 76 if (started) 77 retval.start(); 78 79 logger.exit("createTopicSession"); 80 return retval; 81 } 82 83 84 87 public ConnectionConsumer createConnectionConsumer(Topic topic, 88 String messageSelector, 89 ServerSessionPool sessionPool, 90 int maxMessages) 91 throws JMSException 92 { 93 throw new IllegalStateException ("Operation not permited"); 94 } 95 96 99 public ConnectionConsumer createDurableConnectionConsumer(Topic topic, 100 String subscriptionName, 101 String messageSelector, 102 ServerSessionPool sessionPool, 103 int maxMessages) 104 throws JMSException 105 { 106 throw new IllegalStateException ("Operation not permitted."); 107 } 108 109 110 private static Logger logger = 112 LoggerFactory.getLogger(JmsTopicConnection.class, Resources.getBundle()); 113 115 } 116 117 118 119 | Popular Tags |