if (executor != null) {
// asynchronous event
executor.execute(new CloseEvent(this));
} else {
// synchronous call (in the I/O loop)
handler.sessionClosed(this);
}
}
} catch (RuntimeException e) {
LOG.error("Exception while closing the session : ", e);
}