if (r.isReliable()) { try { pm.storeMessage((Message)r); if (log.isTraceEnabled()) { log.trace("stored " + r + " on disk"); } } catch (Exception e) { log.error("Failed to store message " + r, e); return null; } }  ref = super.createReference((Message)r); }
   public MessageReference reference(Routable r)   {      if (r.isReference())      {         if (log.isTraceEnabled()) { log.trace("message " + r + " is already a reference"); }         return (MessageReference)r;      }            MessageReference ref = super.getReference(r.getMessageID());            if (ref != null)      {                 if (log.isTraceEnabled()) { log.trace("retrieved " + ref + " from memory cache"); }         return ref;      }            if (ref == null)      {         // Message doesn't exist either in memory or on disc         if (log.isTraceEnabled()) { log.trace(this + " referencing " + r); }         if (r.isReliable())         {            try            {               pm.storeMessage((Message)r);               if (log.isTraceEnabled()) { log.trace("stored " + r + " on disk"); }            }            catch (Exception e)            {               log.error("Failed to store message " + r, e);               return null;            }         }         ref = super.createReference((Message)r);      }      return ref;   }