private void handleMessage(final OtpErlangObject msg) {
final OtpErlangTuple tuple = (OtpErlangTuple) msg;
final String tag = ((OtpErlangAtom) tuple.elementAt(0)).atomValue();
if ("io_request".equals(tag)) {
final OtpErlangPid from = (OtpErlangPid) tuple.elementAt(1);
final OtpErlangObject replyAs = tuple.elementAt(2);
final OtpErlangTuple request = (OtpErlangTuple) tuple.elementAt(3);
final OtpErlangObject reply = processRequest(from, request);
final OtpErlangTuple replyMsg = OtpErlang.mkTuple(new OtpErlangAtom(
"io_reply"), replyAs, reply);
mbox.send(from, replyMsg);