|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ReconnectStrategy
A reconnect strategy may allow or disallow an automatic reconnection attempt, if the Connection detects that
it has been disconnected due to some unforeseen event or error condition.
The method isReconnectAllowed() is called by a Connection just before an automatic reconnection
attempt is made. Depending on the return value, this method may thereby allow or disallow the forthcoming
reconnection attempt. If the attempt is allowed, then the strategy will be informed about the outcome of the
reconnection attempt by means of the onReconnectResult(boolean) method. Based on this information, different
strategies can be implemented.
If an automatic reconnection attempt is not allowed, then the connection will remain disconnected until the user
explicitly attempts a reconnection by calling Connection.connect().
The auto reconnection strategy does not affect disconnection attempts caused by the user. Thus, if the user will call
Connection.disconnect(), then the connection will be disconnected no matter what the auto reconnection
strategy might say.
| Method Summary | |
|---|---|
boolean |
isReconnectAllowed()
Returns true if a forthcoming auto reconnection attempt is allowed. |
void |
onReconnectResult(boolean reconnectSucceeded)
Informs the auto reconnection strategy about the success or failure of the most recent auto reconnection attempt. |
| Method Detail |
|---|
boolean isReconnectAllowed()
void onReconnectResult(boolean reconnectSucceeded)
reconnectSucceeded - true, if the last auto reconnect attempt has been successful, false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||