22 public MessageQueue() {
26 public synchronized void enqueue(Message msg) {
37 public synchronized void enqueueUnique(Message msg) {
38 for (Message m = head; m != null; m = m.next) {
39 if (m.id == msg.id && m.field == msg.field) {
47 public synchronized Message dequeue() {
48 if (tail == null)
return null;
56 msg.prev = msg.next = null;
60 public boolean isEmpty() {