switch (event.getType()) {
case SERVER_CONNECT:
if (!isConnectionAllowed()) {
so.returnError(SO_NO_READ_ACCESS);
} else if (msg.hasSource()) {
IEventListener source = msg.getSource();
if (source instanceof BaseConnection) {
((BaseConnection) source)
.registerBasicScope(this);
} else {
addEventListener(source);
}
}
break;
case SERVER_DISCONNECT:
if (msg.hasSource()) {
IEventListener source = msg.getSource();
if (source instanceof BaseConnection) {
((BaseConnection) source)
.unregisterBasicScope(this);
} else {
removeEventListener(source);