if (handler != null) {
IoHandlerExecutor executor = getService().getIoHandlerExecutor();
if (executor != null) {
// asynchronous event
executor.execute(new OpenEvent(this));
} else {
// synchronous call (in the I/O loop)
handler.sessionOpened(this);
}
}