1 7 package org.jboss.jms.serverless; 8 9 import org.jboss.logging.Logger; 10 import javax.jms.Topic ; 11 import javax.jms.JMSException ; 12 13 14 19 public class GroupTopic implements Topic { 20 21 private static final Logger log = Logger.getLogger(GroupTopic.class); 22 23 private String name; 24 25 public GroupTopic(String name) { 26 this.name = name; 27 } 28 29 public String getTopicName() throws JMSException { 30 return name; 31 } 32 33 public String toString() { 34 try { 35 return Destinations.stringRepresentation(this); 36 } 37 catch(JMSException e) { 38 return "Invalid GroupTopic"; 39 } 40 } 41 42 public boolean equals(Object o) { 43 44 if (this == o) { 45 return true; 46 } 47 if (!(o instanceof GroupTopic)) { 48 return false; 49 } 50 51 GroupTopic that = (GroupTopic)o; 52 53 if (name == null) { 54 return false; 55 } 56 return name.equals(that.name); 57 } 58 59 public int hashCode() { 60 61 63 if (name == null) { 64 return 0; 65 } 66 return name.hashCode(); 67 } 68 69 } 70 | Popular Tags |