Add Java support for async ops.
Add asyncop->get_type API and change example to use it.