Addd functionality to JNI.