Make all encoder/decoder methods overridable in MessageToMessageCodec
This commit is contained in:
parent
8d0785da36
commit
4a3d73724f
@ -64,6 +64,11 @@ public abstract class MessageToMessageCodec<INBOUND_IN, INBOUND_OUT, OUTBOUND_IN
|
||||
public OUTBOUND_OUT encode(ChannelHandlerContext ctx, OUTBOUND_IN msg) throws Exception {
|
||||
return MessageToMessageCodec.this.encode(ctx, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void freeOutboundMessage(OUTBOUND_IN msg) throws Exception {
|
||||
MessageToMessageCodec.this.freeOutboundMessage(msg);
|
||||
}
|
||||
};
|
||||
|
||||
private final MessageToMessageDecoder<INBOUND_IN, INBOUND_OUT> decoder =
|
||||
@ -77,6 +82,11 @@ public abstract class MessageToMessageCodec<INBOUND_IN, INBOUND_OUT, OUTBOUND_IN
|
||||
public INBOUND_OUT decode(ChannelHandlerContext ctx, INBOUND_IN msg) throws Exception {
|
||||
return MessageToMessageCodec.this.decode(ctx, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void freeInboundMessage(INBOUND_IN msg) throws Exception {
|
||||
MessageToMessageCodec.this.freeInboundMessage(msg);
|
||||
}
|
||||
};
|
||||
|
||||
private final Class<?>[] acceptedInboundMsgTypes;
|
||||
@ -143,4 +153,12 @@ public abstract class MessageToMessageCodec<INBOUND_IN, INBOUND_OUT, OUTBOUND_IN
|
||||
|
||||
protected abstract OUTBOUND_OUT encode(ChannelHandlerContext ctx, OUTBOUND_IN msg) throws Exception;
|
||||
protected abstract INBOUND_OUT decode(ChannelHandlerContext ctx, INBOUND_IN msg) throws Exception;
|
||||
|
||||
protected void freeInboundMessage(INBOUND_IN msg) throws Exception {
|
||||
ChannelHandlerUtil.freeMessage(msg);
|
||||
}
|
||||
|
||||
protected void freeOutboundMessage(OUTBOUND_IN msg) throws Exception {
|
||||
ChannelHandlerUtil.freeMessage(msg);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user