public class RpcServiceContext extends RpcContext
RpcContext.RestoreContext| Modifier and Type | Method and Description |
|---|---|
<T> CompletableFuture<T> |
asyncCall(Callable<T> callable)
Async invocation.
|
void |
asyncCall(Runnable runnable)
one way async call, send request only, and result is not required
|
RpcServiceContext |
copyOf(boolean needCopy)
Only part of the properties are copied, the others are either not used currently or can be got from invocation.
|
Object[] |
getArguments()
get arguments.
|
<T> CompletableFuture<T> |
getCompletableFuture()
get CompletableFuture.
|
URL |
getConsumerUrl() |
<T> Future<T> |
getFuture()
get future.
|
String |
getGroup() |
String |
getInterfaceName() |
Invocation |
getInvocation()
Deprecated.
Replace to getMethodName(), getParameterTypes(), getArguments()
|
Invoker<?> |
getInvoker()
Deprecated.
Replace to getUrl()
|
List<Invoker<?>> |
getInvokers()
Deprecated.
Replace to getUrls()
|
InetSocketAddress |
getLocalAddress()
get local address.
|
String |
getLocalAddressString() |
String |
getLocalHost()
get local host.
|
String |
getLocalHostName()
get local host name.
|
int |
getLocalPort()
get local port.
|
String |
getMethodName()
get method name.
|
Class<?>[] |
getParameterTypes()
get parameter types.
|
String |
getProtocol() |
String |
getProtocolServiceKey() |
InetSocketAddress |
getRemoteAddress()
get remote address.
|
String |
getRemoteAddressString()
get remote address string.
|
String |
getRemoteApplicationName() |
String |
getRemoteHost()
get remote host.
|
String |
getRemoteHostName()
get remote host name.
|
int |
getRemotePort()
get remote port.
|
Object |
getRequest()
Get the request object of the underlying RPC protocol, e.g.
|
<T> T |
getRequest(Class<T> clazz)
Get the request object of the underlying RPC protocol, e.g.
|
Object |
getResponse()
Get the response object of the underlying RPC protocol, e.g.
|
<T> T |
getResponse(Class<T> clazz)
Get the response object of the underlying RPC protocol, e.g.
|
String |
getServiceKey() |
URL |
getUrl() |
List<URL> |
getUrls() |
String |
getVersion() |
boolean |
isClientSide()
Deprecated.
Replace to isConsumerSide()
|
boolean |
isConsumerSide()
is consumer side.
|
boolean |
isNeedPrintRouterSnapshot() |
boolean |
isProviderSide()
is provider side.
|
boolean |
isServerSide()
Deprecated.
Replace to isProviderSide()
|
void |
setArguments(Object[] arguments) |
void |
setConsumerUrl(URL consumerUrl) |
void |
setFuture(CompletableFuture<?> future)
set future.
|
RpcServiceContext |
setInvocation(Invocation invocation) |
RpcServiceContext |
setInvoker(Invoker<?> invoker) |
RpcServiceContext |
setInvokers(List<Invoker<?>> invokers) |
RpcServiceContext |
setLocalAddress(InetSocketAddress address)
set local address.
|
RpcServiceContext |
setLocalAddress(String host,
int port)
set local address.
|
void |
setMethodName(String methodName) |
void |
setNeedPrintRouterSnapshot(boolean needPrintRouterSnapshot) |
void |
setParameterTypes(Class<?>[] parameterTypes) |
RpcServiceContext |
setRemoteAddress(InetSocketAddress address)
set remote address.
|
RpcServiceContext |
setRemoteAddress(String host,
int port)
set remote address.
|
RpcServiceContext |
setRemoteApplicationName(String remoteApplicationName) |
void |
setRequest(Object request) |
void |
setResponse(Object response) |
void |
setUrl(URL url) |
void |
setUrls(List<URL> urls) |
canRemove, clearAfterEachInvoke, clearAttachments, get, get, getAsyncContext, getAttachment, getAttachments, getCancellationContext, getClientAttachment, getContext, getObjectAttachment, getObjectAttachments, getServerAttachment, getServerContext, getServiceContext, isAsyncStarted, remove, removeAttachment, removeCancellationContext, removeClientAttachment, removeContext, removeServerAttachment, removeServerContext, removeServiceContext, restoreCancellationContext, set, setAttachment, setAttachment, setAttachments, setObjectAttachment, setObjectAttachments, setRpcContext, startAsync, stopAsyncpublic Object getRequest()
getRequest in class RpcContextpublic void setRequest(Object request)
setRequest in class RpcContextpublic <T> T getRequest(Class<T> clazz)
getRequest in class RpcContextpublic Object getResponse()
getResponse in class RpcContextpublic void setResponse(Object response)
setResponse in class RpcContextpublic <T> T getResponse(Class<T> clazz)
getResponse in class RpcContextpublic boolean isProviderSide()
isProviderSide in class RpcContextpublic boolean isConsumerSide()
isConsumerSide in class RpcContextpublic <T> CompletableFuture<T> getCompletableFuture()
getCompletableFuture in class RpcContextT - public <T> Future<T> getFuture()
getFuture in class RpcContextT - public void setFuture(CompletableFuture<?> future)
setFuture in class RpcContextfuture - public List<URL> getUrls()
getUrls in class RpcContextpublic void setUrls(List<URL> urls)
setUrls in class RpcContextpublic URL getUrl()
getUrl in class RpcContextpublic void setUrl(URL url)
setUrl in class RpcContextpublic String getMethodName()
getMethodName in class RpcContextpublic void setMethodName(String methodName)
setMethodName in class RpcContextpublic Class<?>[] getParameterTypes()
getParameterTypes in class RpcContextpublic void setParameterTypes(Class<?>[] parameterTypes)
setParameterTypes in class RpcContextpublic Object[] getArguments()
getArguments in class RpcContextpublic void setArguments(Object[] arguments)
setArguments in class RpcContextpublic RpcServiceContext setLocalAddress(String host, int port)
setLocalAddress in class RpcContexthost - port - public InetSocketAddress getLocalAddress()
getLocalAddress in class RpcContextpublic RpcServiceContext setLocalAddress(InetSocketAddress address)
setLocalAddress in class RpcContextaddress - public String getLocalAddressString()
getLocalAddressString in class RpcContextpublic String getLocalHostName()
getLocalHostName in class RpcContextpublic RpcServiceContext setRemoteAddress(String host, int port)
setRemoteAddress in class RpcContexthost - port - public InetSocketAddress getRemoteAddress()
getRemoteAddress in class RpcContextpublic RpcServiceContext setRemoteAddress(InetSocketAddress address)
setRemoteAddress in class RpcContextaddress - public String getRemoteApplicationName()
getRemoteApplicationName in class RpcContextpublic RpcServiceContext setRemoteApplicationName(String remoteApplicationName)
setRemoteApplicationName in class RpcContextpublic String getRemoteAddressString()
getRemoteAddressString in class RpcContextpublic String getRemoteHostName()
getRemoteHostName in class RpcContextpublic String getLocalHost()
getLocalHost in class RpcContextpublic int getLocalPort()
getLocalPort in class RpcContextpublic String getRemoteHost()
getRemoteHost in class RpcContextpublic int getRemotePort()
getRemotePort in class RpcContext@Deprecated public boolean isServerSide()
isServerSide in class RpcContext@Deprecated public boolean isClientSide()
isClientSide in class RpcContext@Deprecated public List<Invoker<?>> getInvokers()
getInvokers in class RpcContextpublic RpcServiceContext setInvokers(List<Invoker<?>> invokers)
setInvokers in class RpcContext@Deprecated public Invoker<?> getInvoker()
getInvoker in class RpcContextpublic RpcServiceContext setInvoker(Invoker<?> invoker)
setInvoker in class RpcContext@Deprecated public Invocation getInvocation()
getInvocation in class RpcContextpublic RpcServiceContext setInvocation(Invocation invocation)
setInvocation in class RpcContextpublic <T> CompletableFuture<T> asyncCall(Callable<T> callable)
Future.get() is not called.asyncCall in class RpcContextcallable - future.get()public void asyncCall(Runnable runnable)
asyncCall in class RpcContextrunnable - public String getGroup()
getGroup in class RpcContextpublic String getVersion()
getVersion in class RpcContextpublic String getInterfaceName()
getInterfaceName in class RpcContextpublic String getProtocol()
getProtocol in class RpcContextpublic String getServiceKey()
getServiceKey in class RpcContextpublic String getProtocolServiceKey()
getProtocolServiceKey in class RpcContextpublic URL getConsumerUrl()
getConsumerUrl in class RpcContextpublic void setConsumerUrl(URL consumerUrl)
setConsumerUrl in class RpcContextpublic boolean isNeedPrintRouterSnapshot()
public void setNeedPrintRouterSnapshot(boolean needPrintRouterSnapshot)
public RpcServiceContext copyOf(boolean needCopy)
RpcContextAttachment.copyOf(boolean)needCopy - Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.