public Object getVal ( long waitTime , TimeUnit timeUnit ) throws InterruptedException { if ( latch . await ( waitTime , timeUnit ) ) { return val ; } else { return null ; } }
This method blocks for a specified amount of time to retrieve the value bound in bind method .