ffi/java: use C callbacks instead of going straight to nitni (for global)