示例#1
0
  @Override
  public Object call(final Exception e) throws Exception {
    final OtpErlangObject[] body =
        new OtpErlangObject[] {
          ERROR_ATOM,
          new OtpErlangString(e.getClass().getSimpleName()),
          new OtpErlangString(e.getLocalizedMessage())
        };

    final OtpErlangObject[] resp =
        new OtpErlangObject[] {
          from.elementAt(1), // Ref
          new OtpErlangTuple(body)
        };

    mbox.send((OtpErlangPid) from.elementAt(0), new OtpErlangTuple(resp));
    return null;
  }
 public SearchHistory toSearchHistory(OtpErlangTuple erlangTuple) throws Exception {
   OtpErlangObject[] erlangObjects = erlangTuple.elements();
   return new SearchHistory(
       stringify(erlangObjects[0]), stringify(erlangObjects[1]), queryTime(erlangObjects));
 }