Javadocs update
This commit is contained in:
parent
fc4b205bc4
commit
e05b071b41
@ -18,6 +18,12 @@ package io.netty.channel;
|
||||
|
||||
import io.netty.buffer.Buf;
|
||||
|
||||
/**
|
||||
* Abstract base class for a {@link ChannelHandler} that handles inbound data.
|
||||
*
|
||||
* Most of the times you either want to extend {@link ChannelInboundByteHandlerAdapter} or
|
||||
* {@link ChannelInboundMessageHandlerAdapter}.
|
||||
*/
|
||||
public abstract class ChannelInboundHandlerAdapter
|
||||
extends ChannelStateHandlerAdapter implements ChannelInboundHandler {
|
||||
|
||||
@ -25,10 +31,4 @@ public abstract class ChannelInboundHandlerAdapter
|
||||
public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
|
||||
buf.free();
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing by default. Sub-classes may override this if needed.
|
||||
*/
|
||||
@Override
|
||||
public abstract void inboundBufferUpdated(ChannelHandlerContext ctx) throws Exception;
|
||||
}
|
||||
|
@ -17,6 +17,9 @@ package io.netty.channel;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
/**
|
||||
* {@link ChannelOutboundHandler} which operates on bytes which are hold in a {@link ByteBuf}.
|
||||
*/
|
||||
public interface ChannelOutboundByteHandler extends ChannelOutboundHandler {
|
||||
@Override
|
||||
ByteBuf newOutboundBuffer(ChannelHandlerContext ctx) throws Exception;
|
||||
|
@ -17,6 +17,10 @@ package io.netty.channel;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
/**
|
||||
* Abstract base class which handles outgoing bytes
|
||||
*
|
||||
*/
|
||||
public abstract class ChannelOutboundByteHandlerAdapter
|
||||
extends ChannelOutboundHandlerAdapter implements ChannelOutboundByteHandler {
|
||||
@Override
|
||||
|
@ -17,13 +17,17 @@ package io.netty.channel;
|
||||
|
||||
import io.netty.buffer.Buf;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract base class for a {@link ChannelHandler} that handles outbound data.
|
||||
*
|
||||
* Most of the times you either want to extend {@link ChannelOutboundByteHandlerAdapter} or
|
||||
* {@link ChannelOutboundMessageHandlerAdapter}.
|
||||
*/
|
||||
public abstract class ChannelOutboundHandlerAdapter
|
||||
extends ChannelOperationHandlerAdapter implements ChannelOutboundHandler {
|
||||
@Override
|
||||
public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
|
||||
buf.free();
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void flush(ChannelHandlerContext ctx, ChannelFuture future) throws Exception;
|
||||
}
|
||||
|
@ -17,6 +17,12 @@ package io.netty.channel;
|
||||
|
||||
import io.netty.buffer.MessageBuf;
|
||||
|
||||
/**
|
||||
* ChannelOutboundHandler implementation which operates on messages of a specific type
|
||||
* by pass them in a {@link MessageBuf} and consume then from there.
|
||||
*
|
||||
* @param <I> the message type
|
||||
*/
|
||||
public interface ChannelOutboundMessageHandler<I> extends ChannelOutboundHandler {
|
||||
@Override
|
||||
MessageBuf<I> newOutboundBuffer(ChannelHandlerContext ctx) throws Exception;
|
||||
|
@ -18,8 +18,14 @@ package io.netty.channel;
|
||||
import io.netty.buffer.MessageBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
/**
|
||||
* Abstract base class which handles messages of a specific type.
|
||||
*
|
||||
* @param <I> The type of the messages to handle
|
||||
*/
|
||||
public abstract class ChannelOutboundMessageHandlerAdapter<I>
|
||||
extends ChannelOutboundHandlerAdapter implements ChannelOutboundMessageHandler<I> {
|
||||
|
||||
@Override
|
||||
public MessageBuf<I> newOutboundBuffer(ChannelHandlerContext ctx) throws Exception {
|
||||
return Unpooled.messageBuffer();
|
||||
|
@ -16,11 +16,22 @@
|
||||
package io.netty.channel;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract base class for {@link ChannelStateHandler} implementations which provide
|
||||
* implementations of all of their methods.
|
||||
*
|
||||
* This implementation just forward the operation to the next {@link ChannelHandler} in the
|
||||
* {@link ChannelPipeline}. Sub-classes may override a method implementation to change this.
|
||||
*/
|
||||
public class ChannelStateHandlerAdapter implements ChannelStateHandler {
|
||||
|
||||
// Not using volatile because it's used only for a sanity check.
|
||||
boolean added;
|
||||
|
||||
/**
|
||||
* Return {@code true} if the implementation is {@link Sharable} and so can be added
|
||||
* to different {@link ChannelPipeline}s.
|
||||
*/
|
||||
final boolean isSharable() {
|
||||
return getClass().isAnnotationPresent(Sharable.class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user