| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
clientAppId
客户端应用Id
|
protected String |
clientAppName
客户端应用名称
|
protected String |
clientInstanceId
客户端应用实例id
|
protected Integer |
dstVersion
对方版本
|
protected TwoWayMap<Short,String> |
headerCache
每个长连接独立的一个缓存,最多256条
TODO 是否分将缓存 全局静态区和动态区
|
| 构造器和说明 |
|---|
ChannelContext() |
| 限定符和类型 | 方法和说明 |
|---|---|
Short |
getAvailableRefIndex(boolean consumerToProvider)
得到可用的引用索引
|
String |
getClientAppId()
Gets client app id.
|
String |
getClientAppName()
Gets client app name.
|
String |
getClientInstanceId()
Gets client instance id.
|
Integer |
getDstVersion()
Gets dst version.
|
String |
getHeader(Short key)
Gets header.
|
Short |
getHeaderKey(String value)
Gets header.
|
String |
getProtocol()
Gets protocol.
|
void |
invalidateHeadCache(Byte key,
String value)
Invalidate head cache.
|
void |
putHeadCache(Short key,
String value)
Put header cache
|
ChannelContext |
setClientAppId(String clientAppId)
Sets client app id.
|
ChannelContext |
setClientAppName(String clientAppName)
Sets client app name.
|
ChannelContext |
setClientInstanceId(String clientInstanceId)
Sets client instance id.
|
ChannelContext |
setDstVersion(Integer dstVersion)
Sets dst version.
|
void |
setProtocol(String protocol)
Sets protocol.
|
protected volatile TwoWayMap<Short,String> headerCache
protected Integer dstVersion
protected String clientAppId
protected String clientAppName
protected String clientInstanceId
public void putHeadCache(Short key, String value)
key - the keyvalue - the valuepublic void invalidateHeadCache(Byte key, String value)
key - the keyvalue - the valuepublic Short getHeaderKey(String value)
value - the valuepublic Integer getDstVersion()
public ChannelContext setDstVersion(Integer dstVersion)
dstVersion - the dst versionpublic String getClientAppId()
public ChannelContext setClientAppId(String clientAppId)
clientAppId - the client app idpublic String getClientAppName()
public ChannelContext setClientAppName(String clientAppName)
clientAppName - the client app namepublic String getClientInstanceId()
public ChannelContext setClientInstanceId(String clientInstanceId)
clientInstanceId - the client instance idpublic void setProtocol(String protocol)
protocol - the protocolpublic String getProtocol()
public Short getAvailableRefIndex(boolean consumerToProvider)
consumerToProvider - 客户端发起true、还是服务端发起falseCopyright © 2008–2018 The Ant Financial. All rights reserved.