Hi Marco,
On 06/15/2011 09:27 PM, marco.ocana_at_balboasystems.com wrote:
> Hi,
>
> How would I go about monitoring the progress of an asynchronous request
> using the Jersey client?
> I am aware of the ContainerListener mechanism using a
> ConnectionListenerFilter, but I could not find a straightforward way to
> associate a listener to a specific request.
The above listener should work the same way for async/non-async
requests. You are getting a concrete ClientRequest instance passed
to your OnStartConnectionListener.onStart method:
client.addFilter(new ConnectionListenerFilter(new
OnStartConnectionListener() {
public ContainerListener onStart(ClientRequest clientRequest) {
return createYourContainerListenerHereAwareOfThe(clientRequest);
}
});
~Jakub
> I also found the FutureListener with the onComplete callback, but it
> does not provide information on the bytes sent/received like the
> ContainerListener does.
>
> I am currently on Jersey Client 1.5.
>
> Thanks
>
> Marco
>