public void interestOps(SelectableChannel channel,int interestOps) throws CancelledKeyException {
  if (channel != null) {
    SelectionKey key=channel.keyFor(sel);
    if (key == null)     throw new IllegalArgumentException("Key is not registered to channel");
    if (!key.isValid())     return;
    if (ObjectUtils.objectEquals(supposedIOP.put(key,interestOps),interestOps))     return;
    try {
      disable();
      key.interestOps(interestOps);
    }
  finally {
      enable();
    }
  }
}

public void interestOps ( SelectableChannel channel , int interestOps ) throws CancelledKeyException { if ( channel != null ) { SelectionKey key = channel . keyFor ( sel ) ; if ( key == null ) throw new IllegalArgumentException ( "Key is not registered to channel" ) ; if ( ! key . isValid ( ) ) return ; if ( ObjectUtils . objectEquals ( supposedIOP . put ( key , interestOps ) , interestOps ) ) return ; try { disable ( ) ; key . interestOps ( interestOps ) ; } finally { enable ( ) ; } } }
modify interest ops of a key .
