[#557] Provide pre/post handler methods to ChannelInboundMessageHandler.inboundBufferUpdated()
- Add pre- and post- handler methods
This commit is contained in:
parent
c9174e0733
commit
ba6c032180
@ -28,6 +28,8 @@ public abstract class ChannelInboundMessageHandlerAdapter<I>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void inboundBufferUpdated(ChannelHandlerContext ctx) throws Exception {
|
public final void inboundBufferUpdated(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
firstMessageReceived(ctx);
|
||||||
|
|
||||||
MessageBuf<I> in = ctx.inboundMessageBuffer();
|
MessageBuf<I> in = ctx.inboundMessageBuffer();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
I msg = in.poll();
|
I msg = in.poll();
|
||||||
@ -40,7 +42,11 @@ public abstract class ChannelInboundMessageHandlerAdapter<I>
|
|||||||
ctx.fireExceptionCaught(t);
|
ctx.fireExceptionCaught(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastMessageReceived(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void firstMessageReceived(ChannelHandlerContext ctx) throws Exception { }
|
||||||
public abstract void messageReceived(ChannelHandlerContext ctx, I msg) throws Exception;
|
public abstract void messageReceived(ChannelHandlerContext ctx, I msg) throws Exception;
|
||||||
|
public void lastMessageReceived(ChannelHandlerContext ctx) throws Exception { }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user