Skip to content

Commit

Permalink
Remove all references to the deprecated types / Remove ChannelInbound…
Browse files Browse the repository at this point in the history
…/OutboundHandler / Update Javadoc accordingly
  • Loading branch information
trustin committed Nov 25, 2013
1 parent 4ff9413 commit 7a41206
Show file tree
Hide file tree
Showing 72 changed files with 251 additions and 331 deletions.
8 changes: 4 additions & 4 deletions buffer/src/main/java/io/netty/buffer/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@
* type.
* <pre>
* // The composite type is compatible with the component type.
* {@link ByteBuf} message = {@link Unpooled}.wrappedBuffer(header, body);
* {@link io.netty.buffer.ByteBuf} message = {@link io.netty.buffer.Unpooled}.wrappedBuffer(header, body);

This comment has been minimized.

Copy link
@normanmaurer

normanmaurer Nov 25, 2013

Member

Why full name and not import it ?

This comment has been minimized.

Copy link
@trustin

trustin via email Nov 25, 2013

Author Member
*
* // Therefore, you can even create a composite by mixing a composite and an
* // ordinary buffer.
* {@link ByteBuf} messageWithFooter = {@link Unpooled}.wrappedBuffer(message, footer);
* {@link io.netty.buffer.ByteBuf} messageWithFooter = {@link io.netty.buffer.Unpooled}.wrappedBuffer(message, footer);
*
* // Because the composite is still a {@link ByteBuf}, you can access its content
* // Because the composite is still a {@link io.netty.buffer.ByteBuf}, you can access its content
* // easily, and the accessor method will behave just like it's a single buffer
* // even if the region you want to access spans over multiple components. The
* // unsigned integer being read here is located across body and footer.
Expand All @@ -100,7 +100,7 @@
* <pre>
* // A new dynamic buffer is created. Internally, the actual buffer is created
* // lazily to avoid potentially wasted memory space.
* {@link ByteBuf} b = {@link Unpooled}.buffer(4);
* {@link io.netty.buffer.ByteBuf} b = {@link io.netty.buffer.Unpooled}.buffer(4);
*
* // When the first write attempt is made, the internal buffer is created with
* // the specified initial capacity (4).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package io.netty.handler.codec.http;

import io.netty.buffer.ByteBuf;
import io.netty.util.CharsetUtil;

import static io.netty.handler.codec.http.HttpConstants.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.http.FullHttpResponse;

class WebSocketClientProtocolHandshakeHandler extends ChannelInboundHandlerAdapter {
class WebSocketClientProtocolHandshakeHandler extends ChannelHandlerAdapter {
private final WebSocketClientHandshaker handshaker;

public WebSocketClientProtocolHandshakeHandler(WebSocketClientHandshaker handshaker) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelPipeline;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpRequest;
Expand All @@ -35,8 +35,7 @@
/**
* Handles the HTTP handshake (the HTTP Upgrade request) for {@link WebSocketServerProtocolHandler}.
*/
class WebSocketServerProtocolHandshakeHandler
extends ChannelInboundHandlerAdapter {
class WebSocketServerProtocolHandshakeHandler extends ChannelHandlerAdapter {

private final String websocketPath;
private final String subprotocols;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package io.netty.handler.codec.spdy;

import io.netty.buffer.ByteBuf;
import io.netty.util.CharsetUtil;

final class SpdyCodecUtil {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
*/
package io.netty.handler.codec.spdy;

import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.util.internal.EmptyArrays;

import java.util.concurrent.atomic.AtomicInteger;

import static io.netty.handler.codec.spdy.SpdyCodecUtil.SPDY_SESSION_STREAM_ID;
import static io.netty.handler.codec.spdy.SpdyCodecUtil.*;

/**
* Manages streams within a SPDY session.
*/
public class SpdySessionHandler
extends ChannelDuplexHandler {
public class SpdySessionHandler extends ChannelHandlerAdapter {

private static final SpdyProtocolException PROTOCOL_EXCEPTION = new SpdyProtocolException();
private static final SpdyProtocolException STREAM_CLOSED = new SpdyProtocolException("Stream closed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
package io.netty.handler.codec.http.websocketx;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
Expand Down Expand Up @@ -143,7 +142,7 @@ private static String getResponseMessage(FullHttpResponse response) {
return new String(response.content().array());
}

private class MockOutboundHandler extends ChannelOutboundHandlerAdapter {
private class MockOutboundHandler extends ChannelHandlerAdapter {

@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
Expand All @@ -156,7 +155,7 @@ public void flush(ChannelHandlerContext ctx) throws Exception {
}
}

private static class CustomTextFrameHandler extends ChannelInboundHandlerAdapter {
private static class CustomTextFrameHandler extends ChannelHandlerAdapter {
private String content;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
Expand Down Expand Up @@ -128,7 +128,7 @@ private static void addHeader(SpdyHeadersFrame frame, int headerNameSize, int he
frame.headers().add(headerName.toString(), headerValue.toString());
}

private static class CaptureHandler extends ChannelInboundHandlerAdapter {
private static class CaptureHandler extends ChannelHandlerAdapter {
public volatile Object message;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.netty.handler.codec.spdy;

import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
Expand Down Expand Up @@ -330,7 +330,7 @@ public void testSpdyServerSessionHandlerGoAway() {

// Echo Handler opens 4 half-closed streams on session connection
// and then sets the number of concurrent streams to 1
private static class EchoHandler extends ChannelInboundHandlerAdapter {
private static class EchoHandler extends ChannelHandlerAdapter {
private final int closeSignal;
private final boolean server;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package io.netty.handler.codec;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.util.internal.TypeParameterMatcher;
Expand All @@ -31,7 +31,7 @@
* Be aware that sub-classes of {@link ByteToMessageCodec} <strong>MUST NOT</strong>
* annotated with {@link @Sharable}.
*/
public abstract class ByteToMessageCodec<I> extends ChannelDuplexHandler {
public abstract class ByteToMessageCodec<I> extends ChannelHandlerAdapter {

private final TypeParameterMatcher outboundMsgMatcher;
private final MessageToByteEncoder<I> encoder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.internal.RecyclableArrayList;
import io.netty.util.internal.StringUtil;

import java.util.List;

/**
* {@link ChannelInboundHandlerAdapter} which decodes bytes in a stream-like fashion from one {@link ByteBuf} to an
* A {@link ChannelHandler} which decodes bytes in a stream-like fashion from one {@link ByteBuf} to an
* other Message type.
*
* For example here is an implementation which reads all readable bytes from
Expand All @@ -44,7 +45,7 @@
* Be aware that sub-classes of {@link ByteToMessageDecoder} <strong>MUST NOT</strong>
* annotated with {@link @Sharable}.
*/
public abstract class ByteToMessageDecoder extends ChannelInboundHandlerAdapter {
public abstract class ByteToMessageDecoder extends ChannelHandlerAdapter {

ByteBuf cumulation;
private boolean singleDecode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package io.netty.handler.codec;

import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.util.ReferenceCounted;
Expand Down Expand Up @@ -52,7 +52,7 @@
* are of type {@link ReferenceCounted}. This is needed as the {@link MessageToMessageCodec} will call
* {@link ReferenceCounted#release()} on encoded / decoded messages.
*/
public abstract class MessageToMessageCodec<INBOUND_IN, OUTBOUND_IN> extends ChannelDuplexHandler {
public abstract class MessageToMessageCodec<INBOUND_IN, OUTBOUND_IN> extends ChannelHandlerAdapter {

private final MessageToMessageEncoder<Object> encoder = new MessageToMessageEncoder<Object>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package io.netty.handler.codec;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelPipeline;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.ReferenceCounted;
Expand All @@ -27,7 +27,7 @@
import java.util.List;

/**
* {@link ChannelInboundHandlerAdapter} which decodes from one message to an other message.
* A {@link ChannelHandler} which decodes from one message to an other message.
*
*
* For example here is an implementation which decodes a {@link String} to an {@link Integer} which represent
Expand All @@ -50,7 +50,7 @@
* {@link ReferenceCounted#release()} on decoded messages.
*
*/
public abstract class MessageToMessageDecoder<I> extends ChannelInboundHandlerAdapter {
public abstract class MessageToMessageDecoder<I> extends ChannelHandlerAdapter {

private final TypeParameterMatcher matcher;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package io.netty.handler.codec;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelPromise;
import io.netty.util.ReferenceCountUtil;
Expand All @@ -29,7 +29,7 @@
import java.util.List;

/**
* {@link ChannelOutboundHandlerAdapter} which encodes from one message to an other message
* A {@link ChannelHandler} which encodes from one message to an other message
*
* For example here is an implementation which decodes an {@link Integer} to an {@link String}.
*
Expand All @@ -49,7 +49,7 @@
* are of type {@link ReferenceCounted}. This is needed as the {@link MessageToMessageEncoder} will call
* {@link ReferenceCounted#release()} on encoded messages.
*/
public abstract class MessageToMessageEncoder<I> extends ChannelOutboundHandlerAdapter {
public abstract class MessageToMessageEncoder<I> extends ChannelHandlerAdapter {

private final TypeParameterMatcher matcher;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;

import java.nio.ByteOrder;
import java.util.List;
import java.util.zip.CRC32;
import java.util.zip.DataFormatException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.embedded.EmbeddedChannel;
import org.junit.Test;

Expand Down Expand Up @@ -79,7 +79,7 @@ public void testReplacement() throws Exception {
assertNull(ch.readInbound());
}

private static final class BloatedLineDecoder extends ChannelInboundHandlerAdapter {
private static final class BloatedLineDecoder extends ChannelHandlerAdapter {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
ctx.pipeline().replace(this, "less-bloated", new LineDecoder());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import static io.netty.buffer.Unpooled.*;
import static org.hamcrest.core.Is.*;
import static org.hamcrest.core.IsNull.*;
import static org.junit.Assert.*;

@SuppressWarnings("ZeroLengthArrayAllocation")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

import java.util.logging.Level;
import java.util.logging.Logger;
Expand All @@ -28,7 +28,7 @@
* traffic between the echo client and server by sending the first message to
* the server.
*/
public class EchoClientHandler extends ChannelInboundHandlerAdapter {
public class EchoClientHandler extends ChannelHandlerAdapter {

private static final Logger logger = Logger.getLogger(
EchoClientHandler.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package io.netty.example.echo;

import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

import java.util.logging.Level;
import java.util.logging.Logger;
Expand All @@ -26,7 +26,7 @@
* Handler implementation for the echo server.
*/
@Sharable
public class EchoServerHandler extends ChannelInboundHandlerAdapter {
public class EchoServerHandler extends ChannelHandlerAdapter {

private static final Logger logger = Logger.getLogger(
EchoServerHandler.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpRequest;
Expand All @@ -28,7 +28,7 @@
import static io.netty.handler.codec.http.HttpResponseStatus.*;
import static io.netty.handler.codec.http.HttpVersion.*;

public class HttpHelloWorldServerHandler extends ChannelInboundHandlerAdapter {
public class HttpHelloWorldServerHandler extends ChannelHandlerAdapter {
private static final byte[] CONTENT = { 'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd' };

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package io.netty.example.localecho;

import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;


public class LocalEchoServerHandler extends ChannelInboundHandlerAdapter {
public class LocalEchoServerHandler extends ChannelHandlerAdapter {

@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
Expand Down

0 comments on commit 7a41206

Please sign in to comment.