Object id = r.getMessageID();  messages.remove(id);  MessageReference ref = new WeakMessageReference((Message)r, this); messageRefs.put(id, new WeakReference(ref)); messages.put(id, r); if (log.isTraceEnabled()) { log.trace("added message and reference to memory cache for " + r.getMessageID()); }
MessageReference ref = new WeakMessageReference(m, this);  messages.put(m.getMessageID(), new MessageHolder(ref, m));  if (log.isTraceEnabled()) { log.trace("added message and reference to memory cache for " + m.getMessageID()); }
   protected MessageReference createReference(Routable r)   {      Object id = r.getMessageID();      messages.remove(id); // TODO Why?      MessageReference ref = new WeakMessageReference((Message)r, this);      messageRefs.put(id, new WeakReference(ref));      messages.put(id, r);      if (log.isTraceEnabled()) { log.trace("added message and reference to memory cache for " + r.getMessageID()); }      return ref;   }