类 RpcServiceContext
- java.lang.Object
-
- org.apache.dubbo.rpc.RpcContext
-
- org.apache.dubbo.rpc.RpcServiceContext
-
public class RpcServiceContext extends RpcContext
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
asyncCall(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.AsyncContext
getAsyncContext()
<T> CompletableFuture<T>
getCompletableFuture()
get CompletableFuture.URL
getConsumerUrl()
<T> Future<T>
getFuture()
get future.String
getGroup()
String
getInterfaceName()
Invocation
getInvocation()
已过时。Replace to getMethodName(), getParameterTypes(), getArguments()Invoker<?>
getInvoker()
已过时。Replace to getUrl()List<Invoker<?>>
getInvokers()
已过时。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
isAsyncStarted()
boolean
isClientSide()
已过时。Replace to isConsumerSide()boolean
isConsumerSide()
is consumer side.boolean
isProviderSide()
is provider side.boolean
isServerSide()
已过时。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(String host, int port)
set local address.RpcServiceContext
setLocalAddress(InetSocketAddress address)
set local address.void
setMethodName(String methodName)
void
setParameterTypes(Class<?>[] parameterTypes)
RpcServiceContext
setRemoteAddress(String host, int port)
set remote address.RpcServiceContext
setRemoteAddress(InetSocketAddress address)
set remote address.RpcServiceContext
setRemoteApplicationName(String remoteApplicationName)
void
setRequest(Object request)
void
setResponse(Object response)
static void
setRpcContext(URL url)
void
setUrl(URL url)
void
setUrls(List<URL> urls)
static AsyncContext
startAsync()
boolean
stopAsync()
-
从类继承的方法 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)
-
-