public class ReconnConf extends Object
Constructor and Description |
---|
ReconnConf() |
ReconnConf(long interval) |
ReconnConf(long interval,
int retryCount) |
Modifier and Type | Method and Description |
---|---|
long |
getInterval() |
LinkedBlockingQueue<ChannelContext> |
getQueue() |
static ReconnConf |
getReconnConf(ChannelContext channelContext) |
static ReconnConf |
getReconnConf(ClientChannelContext clientChannelContext) |
int |
getRetryCount()
连续重连次数,当连续重连这么多次都失败时,不再重连。0和负数则一直重连
|
SynThreadPoolExecutor |
getThreadPoolExecutor() |
static boolean |
isNeedReconn(ClientChannelContext clientChannelContext,
boolean putIfNeedConn) |
static boolean |
put(ClientChannelContext clientChannelContext) |
void |
setInterval(long interval) |
void |
setRetryCount(int retryCount)
连续重连次数,当连续重连这么多次都失败时,不再重连。0和负数则一直重连
|
public ReconnConf()
public ReconnConf(long interval)
interval
- public ReconnConf(long interval, int retryCount)
interval
- retryCount
- public static ReconnConf getReconnConf(ClientChannelContext clientChannelContext)
public static ReconnConf getReconnConf(ChannelContext channelContext)
public static boolean isNeedReconn(ClientChannelContext clientChannelContext, boolean putIfNeedConn)
clientChannelContext
- putIfNeedConn
- 如果需要重连,则把该ClientChannelContext放到重连队列中public static boolean put(ClientChannelContext clientChannelContext)
clientChannelContext
- public long getInterval()
public LinkedBlockingQueue<ChannelContext> getQueue()
public int getRetryCount()
public SynThreadPoolExecutor getThreadPoolExecutor()
public void setInterval(long interval)
interval
- the interval to setpublic void setRetryCount(int retryCount)
retryCount
- the retryCount to setCopyright © 2021. All rights reserved.