public ResponseMessage getNextMessage ( long time , TimeUnit timeunit ) { try { Object m = rqueue . poll ( time , timeunit ) ; if ( m == null ) { return null ; } else if ( m instanceof ResponseMessage ) { return ( ResponseMessage ) m ; } else if ( m instanceof TapAck ) { TapAck ack = ( TapAck ) m ; tapAck ( ack . getConn ( ) , ack . getNode ( ) , ack . getOpcode ( ) , ack . getOpaque ( ) , ack . getCallback ( ) ) ; return null ; } else { throw new RuntimeException ( "Unexpected tap message type" ) ; } } catch ( InterruptedException e ) { shutdown ( ) ; return null ; } }
Gets the next tap message from the queue of received tap messages .