Some javadocs

This commit is contained in:
Norman Maurer 2013-07-12 15:43:50 +02:00
parent 85a3d320cb
commit a215ba6ef6
4 changed files with 18 additions and 2 deletions

View File

@ -324,6 +324,9 @@ public class LoggingHandler extends ChannelDuplexHandler {
}
}
/**
* Returns a String which contains all details to log the {@link ByteBuf}
*/
protected String formatByteBuf(String eventName, ByteBuf buf) {
int length = buf.readableBytes();
int rows = length / 16 + (length % 15 == 0? 0 : 1) + 4;
@ -375,6 +378,9 @@ public class LoggingHandler extends ChannelDuplexHandler {
return dump.toString();
}
/**
* Returns a String which contains all details to log the {@link Object}
*/
protected String formatNonByteBuf(String eventName, Object msg) {
return eventName + ": " + msg;
}

View File

@ -77,9 +77,9 @@ import java.util.concurrent.TimeUnit;
* if (evt instanceof {@link IdleState}} {
* {@link IdleState} e = ({@link IdleState}) evt;
* if (e.getState() == {@link IdleState}.READER_IDLE) {
* ctx.channel().close();
* ctx.close();
* } else if (e.getState() == {@link IdleState}.WRITER_IDLE) {
* ctx.channel().write(new PingMessage());
* ctx.writeAndFlush(new PingMessage());
* }
* }
* }
@ -313,6 +313,10 @@ public class IdleStateHandler extends ChannelDuplexHandler {
}
}
/**
* Is called when an {@link IdleStateEvent} should be fired. This implementation calls
* {@link ChannelHandlerContext#fireUserEventTriggered(Object)}.
*/
protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt) throws Exception {
ctx.fireUserEventTriggered(evt);
}

View File

@ -177,6 +177,9 @@ public class ReadTimeoutHandler extends ChannelInboundHandlerAdapter {
}
}
/**
* Is called when a read timeout was detected.
*/
protected void readTimedOut(ChannelHandlerContext ctx) throws Exception {
if (!closed) {
ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE);

View File

@ -133,6 +133,9 @@ public class WriteTimeoutHandler extends ChannelOutboundHandlerAdapter {
}
}
/**
* Is called when a write timeout was detected
*/
protected void writeTimedOut(ChannelHandlerContext ctx) throws Exception {
if (!closed) {
ctx.fireExceptionCaught(WriteTimeoutException.INSTANCE);