1 24 package org.objectweb.joram.client.jms; 25 26 import java.util.Vector ; 27 import java.util.Hashtable ; 28 29 import javax.jms.JMSException ; 30 import javax.jms.JMSSecurityException ; 31 import javax.naming.NamingException ; 32 33 import org.objectweb.joram.shared.client.TempDestDeleteRequest; 34 35 import org.objectweb.util.monolog.api.BasicLevel; 36 import org.objectweb.joram.shared.JoramTracing; 37 38 41 public class TemporaryTopic extends Topic implements javax.jms.TemporaryTopic 42 { 43 private final static String TMP_TOPIC_TYPE = "topic.tmp"; 44 45 public static boolean isTemporaryTopic(String type) { 46 return Destination.isAssignableTo(type, TMP_TOPIC_TYPE); 47 } 48 49 50 private Connection cnx; 51 52 public TemporaryTopic() {} 54 55 62 public TemporaryTopic(String agentId, Connection cnx) { 63 super(agentId, TMP_TOPIC_TYPE); 64 this.cnx = cnx; 65 } 66 67 68 public String toString() 69 { 70 return "TempTopic:" + agentId; 71 } 72 73 79 public void delete() throws JMSException 80 { 81 if (cnx == null) 82 throw new JMSSecurityException ("Forbidden call as this TemporaryQueue" 83 + " does not belong to this connection."); 84 85 if (JoramTracing.dbgClient.isLoggable(BasicLevel.DEBUG)) 86 JoramTracing.dbgClient.log(BasicLevel.DEBUG, "--- " + this 87 + ": deleting..."); 88 89 cnx.checkConsumers(agentId); 91 92 cnx.syncRequest(new TempDestDeleteRequest(agentId)); 94 95 if (JoramTracing.dbgClient.isLoggable(BasicLevel.DEBUG)) 96 JoramTracing.dbgClient.log(BasicLevel.DEBUG, this + ": deleted."); 97 } 98 99 103 Connection getCnx() 104 { 105 return cnx; 106 } 107 } 108 | Popular Tags |