added java callbacks to c