Class ReconnectRequest
java.lang.Object
net.rubyeye.xmemcached.impl.ReconnectRequest
- All Implemented Interfaces:
Comparable<Delayed>, Delayed
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate InetSocketAddressWrapperprivate static final longprivate static final longprivate longprivate int -
Constructor Summary
ConstructorsConstructorDescriptionReconnectRequest(InetSocketAddressWrapper inetSocketAddressWrapper, int tries, long reconnectInterval) -
Method Summary
Modifier and TypeMethodDescriptionintlongfinal InetSocketAddressWrapperReturns a reconnect socket address wrapperfinal intgetTries()Returns retry timesprivate longnormalInterval(long reconnectInterval) final voidsetInetSocketAddressWrapper(InetSocketAddressWrapper inetSocketAddressWrapper) final voidsetTries(int tries) voidupdateNextReconnectTimeStamp(long interval)
-
Field Details
-
inetSocketAddressWrapper
-
tries
private int tries -
MIN_RECONNECT_INTERVAL
private static final long MIN_RECONNECT_INTERVAL- See Also:
-
MAX_RECONNECT_INTERVAL
private static final long MAX_RECONNECT_INTERVAL- See Also:
-
nextReconnectTimestamp
private volatile long nextReconnectTimestamp
-
-
Constructor Details
-
ReconnectRequest
public ReconnectRequest(InetSocketAddressWrapper inetSocketAddressWrapper, int tries, long reconnectInterval)
-
-
Method Details
-
normalInterval
private long normalInterval(long reconnectInterval) -
getDelay
-
compareTo
- Specified by:
compareToin interfaceComparable<Delayed>
-
getInetSocketAddressWrapper
Returns a reconnect socket address wrapper- Returns:
- See Also:
-
updateNextReconnectTimeStamp
public void updateNextReconnectTimeStamp(long interval) -
setInetSocketAddressWrapper
-
setTries
public final void setTries(int tries) -
getTries
public final int getTries()Returns retry times- Returns:
- retry times,it is zero if it does not retry to connect
-