public void done ( T response ) throws IllegalArgumentException { lock . lock ( ) ; try { if ( response != null ) { this . response = response ; condition . signal ( ) ; } else { throw new IllegalArgumentException ( "response cannot be null" ) ; } } finally { lock . unlock ( ) ; } }
Done with valid response and notify that response already received .