类 RpcServiceContext
- java.lang.Object
-
- org.apache.dubbo.rpc.RpcContext
-
- org.apache.dubbo.rpc.RpcServiceContext
-
public class RpcServiceContext extends RpcContext
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 voidasyncCall(Runnable runnable)one way async call, send request only, and result is not required<T> CompletableFuture<T>asyncCall(Callable<T> callable)Async invocation.Object[]getArguments()get arguments.AsyncContextgetAsyncContext()<T> CompletableFuture<T>getCompletableFuture()get CompletableFuture.URLgetConsumerUrl()<T> Future<T>getFuture()get future.StringgetGroup()StringgetInterfaceName()InvocationgetInvocation()已过时。Replace to getMethodName(), getParameterTypes(), getArguments()Invoker<?>getInvoker()已过时。Replace to getUrl()List<Invoker<?>>getInvokers()已过时。Replace to getUrls()InetSocketAddressgetLocalAddress()get local address.StringgetLocalAddressString()StringgetLocalHost()get local host.StringgetLocalHostName()get local host name.intgetLocalPort()get local port.StringgetMethodName()get method name.Class<?>[]getParameterTypes()get parameter types.StringgetProtocol()StringgetProtocolServiceKey()InetSocketAddressgetRemoteAddress()get remote address.StringgetRemoteAddressString()get remote address string.StringgetRemoteApplicationName()StringgetRemoteHost()get remote host.StringgetRemoteHostName()get remote host name.intgetRemotePort()get remote port.ObjectgetRequest()Get the request object of the underlying RPC protocol, e.g.<T> TgetRequest(Class<T> clazz)Get the request object of the underlying RPC protocol, e.g.ObjectgetResponse()Get the response object of the underlying RPC protocol, e.g.<T> TgetResponse(Class<T> clazz)Get the response object of the underlying RPC protocol, e.g.StringgetServiceKey()URLgetUrl()List<URL>getUrls()StringgetVersion()booleanisAsyncStarted()booleanisClientSide()已过时。Replace to isConsumerSide()booleanisConsumerSide()is consumer side.booleanisProviderSide()is provider side.booleanisServerSide()已过时。Replace to isProviderSide()voidsetArguments(Object[] arguments)voidsetConsumerUrl(URL consumerUrl)voidsetFuture(CompletableFuture<?> future)set future.RpcServiceContextsetInvocation(Invocation invocation)RpcServiceContextsetInvoker(Invoker<?> invoker)RpcServiceContextsetInvokers(List<Invoker<?>> invokers)RpcServiceContextsetLocalAddress(String host, int port)set local address.RpcServiceContextsetLocalAddress(InetSocketAddress address)set local address.voidsetMethodName(String methodName)voidsetParameterTypes(Class<?>[] parameterTypes)RpcServiceContextsetRemoteAddress(String host, int port)set remote address.RpcServiceContextsetRemoteAddress(InetSocketAddress address)set remote address.RpcServiceContextsetRemoteApplicationName(String remoteApplicationName)voidsetRequest(Object request)voidsetResponse(Object response)static voidsetRpcContext(URL url)voidsetUrl(URL url)voidsetUrls(List<URL> urls)static AsyncContextstartAsync()booleanstopAsync()-
从类继承的方法 org.apache.dubbo.rpc.RpcContext
canRemove, clearAfterEachInvoke, clearAttachments, get, get, getAttachment, getAttachments, getClientAttachment, getContext, getObjectAttachment, getObjectAttachments, getServerAttachment, getServerContext, getServiceContext, remove, removeAttachment, removeClientAttachment, removeContext, removeContext, removeServerAttachment, removeServerContext, removeServiceContext, restoreContext, restoreServerContext, set, setAttachment, setAttachment, setAttachments, setObjectAttachment, setObjectAttachments
-
-
-
-
方法详细资料
-
getRequest
public Object getRequest()
Get the request object of the underlying RPC protocol, e.g. HttpServletRequest- 覆盖:
getRequest在类中RpcContext- 返回:
- null if the underlying protocol doesn't provide support for getting request
-
setRequest
public void setRequest(Object request)
- 覆盖:
setRequest在类中RpcContext
-
getRequest
public <T> T getRequest(Class<T> clazz)
Get the request object of the underlying RPC protocol, e.g. HttpServletRequest- 覆盖:
getRequest在类中RpcContext- 返回:
- null if the underlying protocol doesn't provide support for getting request or the request is not of the specified type
-
getResponse
public Object getResponse()
Get the response object of the underlying RPC protocol, e.g. HttpServletResponse- 覆盖:
getResponse在类中RpcContext- 返回:
- null if the underlying protocol doesn't provide support for getting response
-
setResponse
public void setResponse(Object response)
- 覆盖:
setResponse在类中RpcContext
-
getResponse
public <T> T getResponse(Class<T> clazz)
Get the response object of the underlying RPC protocol, e.g. HttpServletResponse- 覆盖:
getResponse在类中RpcContext- 返回:
- null if the underlying protocol doesn't provide support for getting response or the response is not of the specified type
-
isProviderSide
public boolean isProviderSide()
is provider side.- 覆盖:
isProviderSide在类中RpcContext- 返回:
- provider side.
-
isConsumerSide
public boolean isConsumerSide()
is consumer side.- 覆盖:
isConsumerSide在类中RpcContext- 返回:
- consumer side.
-
getCompletableFuture
public <T> CompletableFuture<T> getCompletableFuture()
get CompletableFuture.- 覆盖:
getCompletableFuture在类中RpcContext- 类型参数:
T-- 返回:
- future
-
getFuture
public <T> Future<T> getFuture()
get future.- 覆盖:
getFuture在类中RpcContext- 类型参数:
T-- 返回:
- future
-
setFuture
public void setFuture(CompletableFuture<?> future)
set future.- 覆盖:
setFuture在类中RpcContext- 参数:
future-
-
getUrls
public List<URL> getUrls()
- 覆盖:
getUrls在类中RpcContext
-
setUrls
public void setUrls(List<URL> urls)
- 覆盖:
setUrls在类中RpcContext
-
getUrl
public URL getUrl()
- 覆盖:
getUrl在类中RpcContext
-
setUrl
public void setUrl(URL url)
- 覆盖:
setUrl在类中RpcContext
-
getMethodName
public String getMethodName()
get method name.- 覆盖:
getMethodName在类中RpcContext- 返回:
- method name.
-
setMethodName
public void setMethodName(String methodName)
- 覆盖:
setMethodName在类中RpcContext
-
getParameterTypes
public Class<?>[] getParameterTypes()
get parameter types.- 覆盖:
getParameterTypes在类中RpcContext
-
setParameterTypes
public void setParameterTypes(Class<?>[] parameterTypes)
- 覆盖:
setParameterTypes在类中RpcContext
-
getArguments
public Object[] getArguments()
get arguments.- 覆盖:
getArguments在类中RpcContext- 返回:
- arguments.
-
setArguments
public void setArguments(Object[] arguments)
- 覆盖:
setArguments在类中RpcContext
-
setLocalAddress
public RpcServiceContext setLocalAddress(String host, int port)
set local address.- 覆盖:
setLocalAddress在类中RpcContext- 参数:
host-port-- 返回:
- context
-
getLocalAddress
public InetSocketAddress getLocalAddress()
get local address.- 覆盖:
getLocalAddress在类中RpcContext- 返回:
- local address
-
setLocalAddress
public RpcServiceContext setLocalAddress(InetSocketAddress address)
set local address.- 覆盖:
setLocalAddress在类中RpcContext- 参数:
address-- 返回:
- context
-
getLocalAddressString
public String getLocalAddressString()
- 覆盖:
getLocalAddressString在类中RpcContext
-
getLocalHostName
public String getLocalHostName()
get local host name.- 覆盖:
getLocalHostName在类中RpcContext- 返回:
- local host name
-
setRemoteAddress
public RpcServiceContext setRemoteAddress(String host, int port)
set remote address.- 覆盖:
setRemoteAddress在类中RpcContext- 参数:
host-port-- 返回:
- context
-
getRemoteAddress
public InetSocketAddress getRemoteAddress()
get remote address.- 覆盖:
getRemoteAddress在类中RpcContext- 返回:
- remote address
-
setRemoteAddress
public RpcServiceContext setRemoteAddress(InetSocketAddress address)
set remote address.- 覆盖:
setRemoteAddress在类中RpcContext- 参数:
address-- 返回:
- context
-
getRemoteApplicationName
public String getRemoteApplicationName()
- 覆盖:
getRemoteApplicationName在类中RpcContext
-
setRemoteApplicationName
public RpcServiceContext setRemoteApplicationName(String remoteApplicationName)
- 覆盖:
setRemoteApplicationName在类中RpcContext
-
getRemoteAddressString
public String getRemoteAddressString()
get remote address string.- 覆盖:
getRemoteAddressString在类中RpcContext- 返回:
- remote address string.
-
getRemoteHostName
public String getRemoteHostName()
get remote host name.- 覆盖:
getRemoteHostName在类中RpcContext- 返回:
- remote host name
-
getLocalHost
public String getLocalHost()
get local host.- 覆盖:
getLocalHost在类中RpcContext- 返回:
- local host
-
getLocalPort
public int getLocalPort()
get local port.- 覆盖:
getLocalPort在类中RpcContext- 返回:
- port
-
getRemoteHost
public String getRemoteHost()
get remote host.- 覆盖:
getRemoteHost在类中RpcContext- 返回:
- remote host
-
getRemotePort
public int getRemotePort()
get remote port.- 覆盖:
getRemotePort在类中RpcContext- 返回:
- remote port
-
isServerSide
@Deprecated public boolean isServerSide()
已过时。Replace to isProviderSide()- 覆盖:
isServerSide在类中RpcContext
-
isClientSide
@Deprecated public boolean isClientSide()
已过时。Replace to isConsumerSide()- 覆盖:
isClientSide在类中RpcContext
-
getInvokers
@Deprecated public List<Invoker<?>> getInvokers()
已过时。Replace to getUrls()- 覆盖:
getInvokers在类中RpcContext
-
setInvokers
public RpcServiceContext setInvokers(List<Invoker<?>> invokers)
- 覆盖:
setInvokers在类中RpcContext
-
getInvoker
@Deprecated public Invoker<?> getInvoker()
已过时。Replace to getUrl()- 覆盖:
getInvoker在类中RpcContext
-
setInvoker
public RpcServiceContext setInvoker(Invoker<?> invoker)
- 覆盖:
setInvoker在类中RpcContext
-
getInvocation
@Deprecated public Invocation getInvocation()
已过时。Replace to getMethodName(), getParameterTypes(), getArguments()- 覆盖:
getInvocation在类中RpcContext
-
setInvocation
public RpcServiceContext setInvocation(Invocation invocation)
- 覆盖:
setInvocation在类中RpcContext
-
asyncCall
public <T> CompletableFuture<T> asyncCall(Callable<T> callable)
Async invocation. Timeout will be handled even ifFuture.get()is not called.- 覆盖:
asyncCall在类中RpcContext- 参数:
callable-- 返回:
- get the return result from
future.get()
-
asyncCall
public void asyncCall(Runnable runnable)
one way async call, send request only, and result is not required- 覆盖:
asyncCall在类中RpcContext- 参数:
runnable-
-
startAsync
public static AsyncContext startAsync() throws IllegalStateException
- 返回:
- 抛出:
IllegalStateException
-
isAsyncStarted
public boolean isAsyncStarted()
- 覆盖:
isAsyncStarted在类中RpcContext
-
stopAsync
public boolean stopAsync()
- 覆盖:
stopAsync在类中RpcContext
-
getAsyncContext
public AsyncContext getAsyncContext()
- 覆盖:
getAsyncContext在类中RpcContext
-
getGroup
public String getGroup()
- 覆盖:
getGroup在类中RpcContext
-
getVersion
public String getVersion()
- 覆盖:
getVersion在类中RpcContext
-
getInterfaceName
public String getInterfaceName()
- 覆盖:
getInterfaceName在类中RpcContext
-
getProtocol
public String getProtocol()
- 覆盖:
getProtocol在类中RpcContext
-
getServiceKey
public String getServiceKey()
- 覆盖:
getServiceKey在类中RpcContext
-
getProtocolServiceKey
public String getProtocolServiceKey()
- 覆盖:
getProtocolServiceKey在类中RpcContext
-
getConsumerUrl
public URL getConsumerUrl()
- 覆盖:
getConsumerUrl在类中RpcContext
-
setConsumerUrl
public void setConsumerUrl(URL consumerUrl)
- 覆盖:
setConsumerUrl在类中RpcContext
-
setRpcContext
public static void setRpcContext(URL url)
-
-