protected void sleep ( long ms ) throws IOException { try { Thread . sleep ( ms ) ; } catch ( InterruptedException e ) { LOG . error ( "Interrupted when sleeping" , e ) ; Thread . currentThread ( ) . interrupt ( ) ; throw new IOException ( "Received interruption" ) ; } }
Sleep for n milliseconds . Throw IOException when interrupted .