public abstract class AbstractReconnectionListener extends java.lang.Object implements ReconnectionListener
ConnectionChangeListeners. For more information on
this, see ReconnectionListener.
This class acts as a stable interface for ReconnectionListener. While ReconnectionListener can have source-incompatible changes in minor versions, this cannot do
that.
ReconnectionListener| Constructor and Description |
|---|
AbstractReconnectionListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
connectionFailure(java.lang.Throwable cause)
A connection to Memcached was attempted, but ultimately failed.
|
void |
connectionLost(java.lang.Throwable cause,
HostAndPort address)
A connection to Memcached was lost after having been acquired.
|
void |
reconnectionCancelled()
The reconnection was cancelled.
|
void |
reconnectionQueuedFromError(java.lang.Throwable cause,
HostAndPort address,
long backOffMillis,
int attempt)
A new reconnection has been queued on the executor.
|
void |
reconnectionSuccessful(HostAndPort address,
int attempt,
boolean willStayConnected)
A reconnect was successful, and a new connection has been set up.
|
public void connectionFailure(java.lang.Throwable cause)
connectionFailure in interface ReconnectionListenercause - why the connection failed, never nullpublic void connectionLost(@Nullable
java.lang.Throwable cause,
HostAndPort address)
This will be called regardless of if it was shut down intentionally, or in error.
connectionLost in interface ReconnectionListenercause - the cause of losing the connection, can be nulladdress - the address to the Memcached node we were connected, never nullpublic void reconnectionSuccessful(HostAndPort address, int attempt, boolean willStayConnected)
reconnectionSuccessful in interface ReconnectionListeneraddress - the address to which the client connected, never nullattempt - which attempt it succeeded on; this is 1-indexed (i.e. 1st attempt is 1, 2nd is
2)willStayConnected - whether the connection will immediately close after this, often due to
race conditionspublic void reconnectionCancelled()
reconnectionCancelled in interface ReconnectionListenerpublic void reconnectionQueuedFromError(java.lang.Throwable cause,
HostAndPort address,
long backOffMillis,
int attempt)
If the client is shut down between this call and the actual connection, you will never see a follow-up to any success or failure method.
reconnectionQueuedFromError in interface ReconnectionListenercause - the cause of the reconnection, i.e. "what failed to cause this?", never nulladdress - the address to the Memcached node we will connect to, never nullbackOffMillis - how many milliseconds we will wait before we attempt again, never nullattempt - which attempt we are on; this is 1-indexed (i.e. 1st attempt is 1, 2nd is 2)Copyright © 2023 Spotify AB. All Rights Reserved.