1 21 package com.presumo.jms.client; 22 23 import javax.jms.Queue ; 24 import javax.jms.JMSException ; 25 import javax.jms.InvalidDestinationException ; 26 27 28 31 public final class JmsQueue extends JmsDestination 32 implements Queue , java.io.Serializable 33 { 34 35 public static final String QUEUE_PREFIX = "queue:"; 36 37 private final String queueName; 38 39 43 46 public JmsQueue(String queueName) throws JMSException 47 { 48 if (queueName == null) throw new 49 InvalidDestinationException ("Can not create a null queue"); 50 51 if (queueName.startsWith(QUEUE_PREFIX)) 52 this.queueName = queueName; 53 else 54 this.queueName = QUEUE_PREFIX + queueName; 55 } 56 57 58 62 public String toString() 63 { 64 return queueName; 65 } 66 67 public String getQueueName() 68 { 69 return queueName; 70 } 71 72 } 73 | Popular Tags |