added Java API.