模块 org.redkale
类 ClientCodec<R extends ClientRequest,P extends ClientResult>
- java.lang.Object
-
- org.redkale.net.client.ClientCodec<R,P>
-
- 类型参数:
R
- ClientRequestP
- 响应对象
- 所有已实现的接口:
CompletionHandler<Integer,ByteBuffer>
- 直接已知子类:
SncpClientCodec
public abstract class ClientCodec<R extends ClientRequest,P extends ClientResult> extends Object implements CompletionHandler<Integer,ByteBuffer>
每个ClientConnection绑定一个独立的ClientCodec实例, 只会同一读线程ReadIOThread里运行详情见: https://redkale.org
- 从以下版本开始:
- 2.3.0
- 作者:
- zhangjx
-
-
字段概要
字段 修饰符和类型 字段 说明 protected ClientConnection<R,P>
connection
protected ClientMessageListener
messageListener
-
构造器概要
构造器 限定符 构造器 说明 protected
ClientCodec(ClientConnection<R,P> connection)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 void
addMessage(R request, Throwable exc)
void
addMessage(R request, P result)
void
completed(Integer count, ByteBuffer attachment)
abstract void
decodeMessages(ByteBuffer buffer, ByteArray array)
void
failed(Throwable t, ByteBuffer attachment)
protected R
findRequest(Serializable requestid)
protected ClientResponse<R,P>
getLastMessage()
ClientMessageListener
getMessageListener()
protected R
nextRequest()
void
occurError(R request, Throwable exc)
String
toString()
ClientCodec<R,P>
withMessageListener(ClientMessageListener listener)
-
-
-
字段详细资料
-
connection
protected final ClientConnection<R extends ClientRequest,P extends ClientResult> connection
-
messageListener
protected ClientMessageListener messageListener
-
-
构造器详细资料
-
ClientCodec
protected ClientCodec(ClientConnection<R,P> connection)
-
-
方法详细资料
-
decodeMessages
public abstract void decodeMessages(ByteBuffer buffer, ByteArray array)
-
withMessageListener
public ClientCodec<R,P> withMessageListener(ClientMessageListener listener)
-
completed
public final void completed(Integer count, ByteBuffer attachment)
- 指定者:
completed
在接口中CompletionHandler<R extends ClientRequest,P extends ClientResult>
-
failed
public final void failed(Throwable t, ByteBuffer attachment)
- 指定者:
failed
在接口中CompletionHandler<R extends ClientRequest,P extends ClientResult>
-
getMessageListener
public ClientMessageListener getMessageListener()
-
nextRequest
protected R nextRequest()
-
findRequest
protected R findRequest(Serializable requestid)
-
getLastMessage
protected ClientResponse<R,P> getLastMessage()
-
-