Registering callbacks for the Java VM hooks