com.kuka.comm
Interface ReconnectStrategy


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

isReconnectAllowed

boolean isReconnectAllowed()
Returns true if a forthcoming auto reconnection attempt is allowed.

Returns:
true, if the auto reconnection attempt is currently allowed, false, otherwise

onReconnectResult

void onReconnectResult(boolean reconnectSucceeded)
Informs the auto reconnection strategy about the success or failure of the most recent auto reconnection attempt.

Parameters:
reconnectSucceeded - true, if the last auto reconnect attempt has been successful, false otherwise


Copyright © 2019. All rights reserved.