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; }