+ protected String logContext() {
+ return logContext;
+ }
+
+ @Override
+ protected void handleReceive(final Object message) {
+ if (message instanceof PublishNotifications) {
+ PublishNotifications toPublish = (PublishNotifications)message;
+ timer.start();
+
+ try {
+ publisher.publishChanges(toPublish.candidate);
+ } finally {
+ long elapsedTime = timer.elapsed(TimeUnit.MILLISECONDS);
+
+ if (elapsedTime >= ShardDataTreeNotificationPublisher.PUBLISH_DELAY_THRESHOLD_IN_MS) {
+ LOG.warn("{}: Generation of change events for {} took longer than expected. Elapsed time: {}",
+ logContext, name, timer);
+ } else {
+ LOG.debug("{}: Elapsed time for generation of change events for {}: {}", logContext, name, timer);
+ }
+
+ timer.reset();
+ }
+ }