- public boolean offerNotification(final Notification notification, final int timeout, final TimeUnit unit) throws InterruptedException {
- final ListenableFuture<?> listenableFuture =
- domPublishService.offerNotification(toDomNotification(notification), timeout, unit);
- return !DOMNotificationPublishService.REJECTED.equals(listenableFuture);
+ public ListenableFuture<?> offerNotification(final Notification notification, final int timeout,
+ final TimeUnit unit) throws InterruptedException {
+ ListenableFuture<?> offerResult = domPublishService.offerNotification(toDomNotification(notification),
+ timeout, unit);
+ return DOMNotificationPublishService.REJECTED.equals(offerResult)
+ ? NotificationPublishService.REJECTED
+ : offerResult;