1 package com.ubermq.jms.client.impl; 2 3 import com.ubermq.jms.client.*; 4 import com.ubermq.kernel.overflow.*; 5 import javax.jms.*; 6 7 11 public final class LocalQueue 12 extends LocalDestination 13 implements java.io.Serializable , 14 javax.jms.Queue , 15 javax.jms.TemporaryQueue 16 { 17 public static final long serialVersionUID = 1L; 18 19 private transient Session s; 20 private String name; 21 22 public LocalQueue(Session s, String name) 23 { 24 this.s = s; 25 this.name = name; 26 } 27 28 public LocalQueue(String name) 29 { 30 this.s = null; 31 this.name = name; 32 } 33 34 40 public String getQueueName() 41 { 42 return name; 43 } 44 45 52 public void delete() throws JMSException 53 { 54 try 55 { 56 if (s == null) 57 throw new javax.jms.IllegalStateException ("not temporary"); 58 59 if (!s.conn.getClientProcessor().controlSequence(s.conn.factories.controlFactory().queueDelete(name), 60 new DropIncoming())) 61 throw new JMSException("The queue is still in use."); 62 } 63 catch (java.io.IOException e) { 64 throw new JMSIOException(e); 65 } 66 } 67 68 71 public String getInternalTopicName() 72 { 73 return QUEUE_TOPIC_PREFIX + name; 74 } 75 76 public String toString() 77 { 78 return name; 79 } 80 } 81 82 | Popular Tags |