public void changeSelectInterests ( ) { switch ( state ) { case READY_TO_WRITE : // set the OP_WRITE interest state = State . WRITING ; break ; case READY_TO_READ_FRAME_SIZE : state = State . READING_FRAME_SIZE ; break ; case READY_TO_READ_FRAME : state = State . READING_FRAME ; break ; case AWAITING_CLOSE : close ( ) ; selectionKey . cancel ( ) ; break ; default : logger . error ( "changeSelectInterest was called, but state is invalid (" + state + ")" ) ; } }
Give this Message a chance to change its interests .