1 22 package org.jboss.mq; 23 24 import java.io.Serializable ; 25 26 import javax.jms.Queue ; 27 import javax.naming.Reference ; 28 import javax.naming.Referenceable ; 29 import javax.naming.StringRefAddr ; 30 31 40 public class SpyQueue extends SpyDestination implements Serializable , Queue , Referenceable 41 { 42 44 45 static final long serialVersionUID = 3040902899515975733L; 46 47 49 50 private String toStringStr; 51 53 55 56 61 public SpyQueue(String queueName) 62 { 63 super(queueName); 64 toStringStr = "QUEUE." + name; 65 hash++; 66 } 67 68 70 72 public String getQueueName() 73 { 74 return name; 75 } 76 77 79 public Reference getReference() throws javax.naming.NamingException 80 { 81 82 return new Reference ("org.jboss.mq.SpyQueue", new StringRefAddr ("name", name), 83 "org.jboss.mq.referenceable.SpyDestinationObjectFactory", null); 84 } 85 86 88 public String toString() 89 { 90 return toStringStr; 91 } 92 93 public boolean equals(Object obj) 94 { 95 if (!(obj instanceof SpyQueue)) 96 return false; 97 if (obj.hashCode() != hash) 98 return false; 99 return ((SpyQueue) obj).name.equals(name); 100 } 101 102 104 106 108 } | Popular Tags |