Class ReconnectionManager


  • public final class ReconnectionManager
    extends java.lang.Object
    Handles the automatic reconnection process. Every time a connection is dropped without the application explicitly closing it, the manager automatically tries to reconnect to the server.

    There are two possible reconnection policies: ReconnectionManager.ReconnectionPolicy.RANDOM_INCREASING_DELAY - The reconnection mechanism will try to reconnect periodically:

    1. For the first minute it will attempt to connect once every ten seconds.
    2. For the next five minutes it will attempt to connect once a minute.
    3. If that fails it will indefinitely try to connect once every five minutes.
    ReconnectionManager.ReconnectionPolicy.FIXED_DELAY - The reconnection mechanism will try to reconnect after a fixed delay independently from the number of reconnection attempts already performed.

    Interrupting the reconnection thread will abort the reconnection mechanism.