A convenient c++ wrapper around JNI.