|
@Override
public ListenableFuture<?> offerNotification(final DOMNotification notification, final long timeout,
final TimeUnit unit) throws InterruptedException {
final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers = listeners.get(notification.getType());
if (subscribers.isEmpty())
{
return NO_LISTENERS;
}
// Attempt to perform a non-blocking publish first
final ListenableFuture<?> noBlock = tryPublish(notification, subscribers);
if (!DOMNotificationPublishService.REJECTED.equals(noBlock))
{
return noBlock;
}
/*
- FIXME: we need a background thread, which will watch out for blocking too long. Here
- we will arm a tasklet for it and synchronize delivery of interrupt properly.
*/
throw new UnsupportedOperationException("Not implemented yet");
|