question: private void closeSelector ( ) { if ( selector . isOpen ( ) ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Closing all listening sockets." ) ; for ( SelectionKey key : selector . keys ( ) ) U . close ( key . channel ( ) , log ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "Closing NIO selector." ) ; U . close ( selector , log ) ; } }
target:  Close selector if needed.