(TK-108) Add support for persistent Java clients

This PR adds support for both synchronous and asynchronous persistent Java clients.
Seems like it would be better for this to be "private" since it's just a helper for the other public methods.