public int getDestinationIndex(String name) {
   if (delegate == null) {
     if (DEFAULT_DESTINATION.equals(name)) {
       return DEFAULT_DESTINATION_INDEX;
     } else {
       return -1;
     }
   }
   return delegate.getDestinationIndex(name);
 }
 public void send(
     MonitorLevel level,
     int destinationIndex,
     long timestamp,
     String source,
     String message,
     boolean parse,
     Object... args) {
   if (delegate != null) {
     delegate.send(level, destinationIndex, timestamp, source, message, parse, args);
   } else {
     cache.add(new Entry(level, destinationIndex, timestamp, source, message, parse, args));
   }
 }
 @Reference(required = false)
 public void setDestination(DestinationRouter destination) {
   this.delegate = destination;
   for (Entry entry : cache) {
     delegate.send(
         entry.level,
         entry.destinationIndex,
         entry.timestamp,
         entry.source,
         entry.message,
         entry.parse,
         entry.values);
   }
   cache = null;
 }