*/
final class DOMNotificationRouterEvent {
private static final Logger LOG = LoggerFactory.getLogger(DOMNotificationRouterEvent.class);
- public static final EventFactory<DOMNotificationRouterEvent> FACTORY = new EventFactory<DOMNotificationRouterEvent>() {
- @Override
- public DOMNotificationRouterEvent newInstance() {
- return new DOMNotificationRouterEvent();
- }
- };
+ public static final EventFactory<DOMNotificationRouterEvent> FACTORY = DOMNotificationRouterEvent::new;
private Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers;
private DOMNotification notification;
}
void deliverNotification() {
+ LOG.trace("Start delivery of notification {}", notification);
for (ListenerRegistration<? extends DOMNotificationListener> r : subscribers) {
final DOMNotificationListener listener = r.getInstance();
if (listener != null) {
try {
+ LOG.trace("Notifying listener {}", listener);
listener.onNotification(notification);
+ LOG.trace("Listener notification completed");
} catch (Exception e) {
LOG.error("Delivery of notification {} caused an error in listener {}", notification, listener, e);
}
}
}
+ LOG.trace("Delivery completed");
}
void setFuture() {
future.set(null);
+ notification = null;
+ subscribers = null;
+ future = null;
}
-
}
\ No newline at end of file