public abstract class DestinationConnectionStrategyWithTtl extends Object implements DestinationConnectionStrategy
DestinationConnectionStrategy that will force a connection to be reestablished after a length of time has elapsed.| Constructor and Description |
|---|
DestinationConnectionStrategyWithTtl() |
| Modifier and Type | Method and Description |
|---|---|
void |
connectFailed(long connectionStartTimeInMillis,
int failedDestinationIndex,
int numDestinations)
Called when a connection fails to the given failedDestinationIndex.
|
void |
connectSuccess(long connectionStartTimeInMillis,
int connectedDestinationIndex,
int numDestinations)
Called when a connection was successful to the given connectedDestinationIndex.
|
ch.qos.logback.core.util.Duration |
getConnectionTTL() |
void |
setConnectionTTL(ch.qos.logback.core.util.Duration connectionTTL) |
boolean |
shouldReconnect(long currentTimeInMillis,
int currentDestinationIndex,
int numDestinations)
Returns whether the connection should be reestablished.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitselectNextDestinationIndexpublic DestinationConnectionStrategyWithTtl()
public void connectSuccess(long connectionStartTimeInMillis,
int connectedDestinationIndex,
int numDestinations)
DestinationConnectionStrategyconnectSuccess in interface DestinationConnectionStrategyconnectionStartTimeInMillis - The time in millis at which the connection was initiated (not completed).connectedDestinationIndex - The index of the destination which was successfully connected.numDestinations - The total number of destinations available.public void connectFailed(long connectionStartTimeInMillis,
int failedDestinationIndex,
int numDestinations)
DestinationConnectionStrategyconnectFailed in interface DestinationConnectionStrategyconnectionStartTimeInMillis - The time in millis at which the connection was initiated (not completed).failedDestinationIndex - The index of the destination which failed to connect.numDestinations - The total number of destinations available.public boolean shouldReconnect(long currentTimeInMillis,
int currentDestinationIndex,
int numDestinations)
DestinationConnectionStrategyshouldReconnect in interface DestinationConnectionStrategycurrentTimeInMillis - The time in millis for which to reevaluate whether the connection should be reestablished.currentDestinationIndex - The index of the destination which is currently connectednumDestinations - The total number of destinations available.DestinationConnectionStrategy.selectNextDestinationIndex(int, int), false otherwise.public ch.qos.logback.core.util.Duration getConnectionTTL()
public void setConnectionTTL(ch.qos.logback.core.util.Duration connectionTTL)
Copyright © 2018. All rights reserved.