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);
  }
}

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 ) ; } }
close selector if needed .
