if (!(message.elementAt(1) instanceof OtpErlangRef))
System.out.println("invalid request received, expected a ref, got "+message.elementAt(1));
OtpErlangRef ref = (OtpErlangRef) message.elementAt(1);
if (!(message.elementAt(0) instanceof OtpErlangPid))
System.out.println("invalid request received, expected a pid, got "+message.elementAt(0));
OtpErlangPid pid = (OtpErlangPid) message.elementAt(0);
if (command.equals(msgEcho))
{// used to establish a link between a supervisor on the Erlang side and that of the Java side
thisMbox.link(pid);
reply(pid,ref,msgOk,thisMbox.self());