@Extensible(singleton=false) public abstract class ClientTransport extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected ClientTransportConfig |
transportConfig
客户端配置
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
ClientTransport(ClientTransportConfig transportConfig)
客户端配置
|
| 限定符和类型 | 方法和说明 |
|---|---|
abstract ResponseFuture |
asyncSend(SofaRequest message,
int timeout)
异步调用
|
abstract void |
connect()
建立长连接
|
abstract int |
currentRequests()
当前请求数
|
abstract void |
destroy()
销毁(最好是通过工厂模式销毁,这样可以清理缓存)
|
abstract void |
disconnect()
断开连接
|
abstract AbstractChannel |
getChannel()
得到长连接
|
ClientTransportConfig |
getConfig()
返回配置
|
abstract void |
handleRpcRequest(SofaRequest request)
客户端收到服务端的请求,可能是服务端Callback
|
abstract boolean |
isAvailable()
是否可用(有可用的长连接)
|
abstract InetSocketAddress |
localAddress()
本地地址
|
abstract void |
oneWaySend(SofaRequest message,
int timeout)
单向调用
|
abstract void |
receiveRpcResponse(SofaResponse response)
客户端收到异步响应
|
abstract InetSocketAddress |
remoteAddress()
远程地址
|
abstract void |
setChannel(AbstractChannel channel)
设置长连接
|
abstract SofaResponse |
syncSend(SofaRequest message,
int timeout)
同步调用
|
protected ClientTransportConfig transportConfig
protected ClientTransport(ClientTransportConfig transportConfig)
transportConfig - 客户端配置public ClientTransportConfig getConfig()
public abstract void connect()
public abstract void disconnect()
public abstract void destroy()
public abstract boolean isAvailable()
public abstract void setChannel(AbstractChannel channel)
channel - the channelpublic abstract AbstractChannel getChannel()
public abstract int currentRequests()
public abstract ResponseFuture asyncSend(SofaRequest message, int timeout) throws SofaRpcException
message - 消息timeout - 超时时间SofaRpcException - SofaRpcExceptionpublic abstract SofaResponse syncSend(SofaRequest message, int timeout) throws SofaRpcException
message - 消息timeout - 超时时间SofaRpcException - SofaRpcExceptionpublic abstract void oneWaySend(SofaRequest message, int timeout) throws SofaRpcException
message - 消息timeout - 超时时间SofaRpcException - SofaRpcExceptionpublic abstract void receiveRpcResponse(SofaResponse response)
response - the responsepublic abstract void handleRpcRequest(SofaRequest request)
request - the requestpublic abstract InetSocketAddress remoteAddress()
public abstract InetSocketAddress localAddress()
Copyright © 2008–2018 The Ant Financial. All rights reserved.