1 29 30 package com.caucho.jms.amq; 31 32 import com.caucho.jms.session.MessageConsumerImpl; 33 import com.caucho.jms.session.SessionImpl; 34 import com.caucho.util.L10N; 35 36 import javax.jms.JMSException ; 37 import javax.jms.MessageProducer ; 38 import javax.jms.Queue ; 39 import javax.jms.QueueBrowser ; 40 import java.io.IOException ; 41 import java.util.logging.Logger ; 42 43 46 public class AmqQueue extends AmqDestination implements Queue { 47 private static final Logger log 48 = Logger.getLogger(AmqQueue.class.getName()); 49 private static final L10N L = new L10N(AmqQueue.class); 50 51 private int _id; 52 53 public AmqQueue() 54 { 55 } 56 57 60 public String getQueueName() 61 { 62 return getName(); 63 } 64 65 68 public int getId() 69 { 70 return _id; 71 } 72 73 76 public MessageProducer createProducer(SessionImpl session) 77 { 78 return new AmqProducer(session, this); 79 } 80 81 84 public MessageConsumerImpl createConsumer(SessionImpl session, 85 String selector, 86 boolean noWait) 87 throws JMSException 88 { 89 return new AmqQueueConsumer(session, selector, this); 90 } 91 92 95 public QueueBrowser createBrowser(SessionImpl session, String selector) 96 throws JMSException 97 { 98 throw new UnsupportedOperationException (); 99 } 100 101 104 AmqClientChannel openChannel() 105 throws IOException 106 { 107 AmqClient client = getClient(); 108 109 AmqClientChannel channel = client.openChannel(); 110 111 channel.openQueue(getQueueName()); 112 113 return channel; 114 } 115 116 119 public void commit(int session) 120 throws JMSException 121 { 122 } 123 124 127 public String toString() 128 { 129 return "AmqQueue[" + getName() + "]"; 130 } 131 } 132 133 | Popular Tags |