public Notification getNotification ( ) { try { Notification notif = notifications . take ( ) ; log . debug ( "Dequeued notification {}" , notif ) ; return notif ; } catch ( InterruptedException e ) { log . info ( "Interrupted while polling notifications' queue" ) ; return null ; } }
Blocks until an element is available and then returns it by removing it from the queue .