}
@Override
protected void handleMessage(Object m1) throws InterruptedException, SuspendExecution {
if (m1 instanceof GenServerRequest) {
GenServerRequest m = (GenServerRequest) m1;
switch (m.getType()) {
case CALL:
try {
final V res = handleCall((ActorRef<V>) m.getFrom(), m.getId(), (CallMessage) m.getMessage());
if (res != null)
reply((ActorRef<V>) m.getFrom(), m.getId(), res);
} catch (Exception e) {
replyError((ActorRef<V>) m.getFrom(), m.getId(), e);
}
break;
case CAST:
handleCast((ActorRef<V>) m.getFrom(), m.getId(), (CastMessage) m.getMessage());
break;
}
} else
handleInfo(m1);
}