add wait_time option to allow java client to exit