messageHandler.handle(newInputMessage,
debugTarget);
if (messageHandler instanceof IDebugRequestHandler) {
// create response
IDebugResponseMessage response = ((IDebugRequestHandler) messageHandler)
.getResponseMessage();
// send response
byteArray.reset();
response.serialize(outArray);
synchronized (out) {
out.writeInt(byteArray.size());
byteArray.writeTo(out);
out.flush();
}
}
} else if (newInputMessage instanceof IDebugResponseMessage) {
IDebugResponseMessage r = (IDebugResponseMessage) newInputMessage;
int requestId = r.getID(); // take the
// request ID
// from the
// response.
IDebugRequestMessage req = (IDebugRequestMessage) requestsTable
.remove(requestId); // find the