TLS for the Java env, since we can't be sure what thread will invoke the callback.