The resuming functionality is completely transparent to the class using this enhanced stream. There will be no time-out's reported during the emulated resuming and so on.
This one is very simple, but can be used for making extremely user-friendly interfaces, which are showing where we are with loading data at any given moment. Currently, the following list of events is supported:
There's a method to attach only single listener. A tip: use Composite pattern to create a complex listener. Also, note that the listeners may throw any run-time exception and it will not affect the reading procedure in any way. The exceptions will be recorded in log with WARNING level.
This functionality is completely built on top of Retries Policy concept. You are free to define your own policy which will be analyzing the history of failed attempts to decide whether to make pause between the next attempt and what the length of the pause will be or simply order to terminate any further attempts and abord reading.
Standard HTTP(S) protocols implementations by SUN support seamless following redirections, but it's isn't possible to learn when we are permanently redirected somewhere. Current implementation addresses this issue by allowing client to register permanent redirection listener which will be notified once the connection to resource is established and it's detected that we were redirected somewhere during connection phase.
|
|
|
|
|
|