| 限定符 | 构造器和说明 |
|---|---|
protected |
RpcInternalContext()
Instantiates a new Rpc context.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
Clear context for next user
|
RpcInternalContext |
clearAttachments()
Clear attachments.
|
RpcInternalContext |
clone() |
Object |
getAttachment(String key)
get attachment.
|
Map<String,Object> |
getAttachments()
get attachments.
|
static RpcInternalContext |
getContext()
得到上下文,为空则自动创建
|
<T> ResponseFuture<T> |
getFuture()
get future.
|
InetSocketAddress |
getLocalAddress()
本地地址InetSocketAddress
|
ProviderInfo |
getProviderInfo()
Gets provider info.
|
InetSocketAddress |
getRemoteAddress()
远程地址InetSocketAddress
|
String |
getRemoteHostName()
远程IP地址
|
StopWatch |
getStopWatch()
Gets stop watch.
|
static boolean |
isAttachmentEnable()
是否开启附件传递功能
|
boolean |
isConsumerSide()
Is consumer side.
|
boolean |
isProviderSide()
Is provider side.
|
static boolean |
isValidInternalParamKey(String key)
合法的内置key,以"_"或者"."
|
static RpcInternalContext |
peekContext()
查看上下文,为空不自动创建
|
static void |
popContext()
上下文往上取一层(例如服务端B接到A的请求后再作为C的客户端调用,调用完毕后这里就先把放A-B的上下文取起来)
|
static void |
pushContext()
上下文往下放一层(例如服务端B接到A的请求后再作为C的客户端调用,调用前这里就先把放A-B的上下文存起来)
|
static void |
removeAllContext()
清理全部上下文
|
Object |
removeAttachment(String key)
remove attachment.
|
static void |
removeContext()
清理上下文
|
RpcInternalContext |
setAttachment(String key,
Object value)
set attachment.
|
RpcInternalContext |
setAttachments(Map<String,Object> attachments)
key不能以点和下划线开头
|
static void |
setContext(RpcInternalContext context)
设置上下文
|
RpcInternalContext |
setFuture(ResponseFuture<?> future)
set future.
|
RpcInternalContext |
setLocalAddress(InetSocketAddress address)
set local address.
|
RpcInternalContext |
setLocalAddress(String host,
int port)
已过时。
|
RpcInternalContext |
setProviderInfo(ProviderInfo providerInfo)
Sets provider info.
|
RpcInternalContext |
setProviderSide(Boolean isProviderSide)
Sets provider side.
|
RpcInternalContext |
setRemoteAddress(InetSocketAddress address)
set remote address.
|
RpcInternalContext |
setRemoteAddress(String host,
int port)
set remote address.
|
String |
toString() |
public static void setContext(RpcInternalContext context)
context - RPC内置上下文public static RpcInternalContext getContext()
public static RpcInternalContext peekContext()
public static void removeContext()
public static void pushContext()
public static void popContext()
public static void removeAllContext()
public static boolean isAttachmentEnable()
public boolean isProviderSide()
public RpcInternalContext setProviderSide(Boolean isProviderSide)
isProviderSide - the is provider sidepublic boolean isConsumerSide()
public <T> ResponseFuture<T> getFuture()
T - the type parameterpublic RpcInternalContext setFuture(ResponseFuture<?> future)
future - the futurepublic RpcInternalContext setLocalAddress(InetSocketAddress address)
address - the address@Deprecated public RpcInternalContext setLocalAddress(String host, int port)
host - the hostport - the portpublic InetSocketAddress getLocalAddress()
public RpcInternalContext setRemoteAddress(InetSocketAddress address)
address - the addresspublic RpcInternalContext setRemoteAddress(String host, int port)
host - the hostport - the portpublic InetSocketAddress getRemoteAddress()
public String getRemoteHostName()
public Object getAttachment(String key)
key - the keypublic RpcInternalContext setAttachment(String key, Object value)
key - the keyvalue - the valuepublic Object removeAttachment(String key)
key - the keypublic Map<String,Object> getAttachments()
public RpcInternalContext setAttachments(Map<String,Object> attachments)
attachments - the attachmentspublic RpcInternalContext clearAttachments()
public StopWatch getStopWatch()
public void clear()
public RpcInternalContext setProviderInfo(ProviderInfo providerInfo)
providerInfo - the provider infopublic ProviderInfo getProviderInfo()
public RpcInternalContext clone()
public static boolean isValidInternalParamKey(String key)
key - 参数keyCopyright © 2008–2018 The Ant Financial. All rights reserved.