if (r.isReference())
try
   protected MessageReference ref(Routable r)   {      MessageReference ref = null;            if (r.isReference())      {         return (MessageReference)r;      }      else      {         //Convert to reference         try         {            ref = ms.reference(r);            return ref;         }         catch (Throwable t)         {            log.error("Failed to reference routable", t);            return null;         }      }   }