public final void onMessage(final Object message) {
if (message instanceof StopGently) {
stoppingGently = true;
return;
}
final SelectResult msg = (SelectResult) message;
final int index = msg.getIndex();
Object value = msg.getValue();
if (isControlMessage(value)) {
value = fireMessageArrived(value, index, true);
if (value instanceof PoisonPill) handlePoisonPillInSelector(index, value);
if (isControlMessage(value)) return;