Rename ChannelBuf to Buf and ChannelBufType to BufType

- Fixes #825
This commit is contained in:
Trustin Lee 2012-12-17 17:43:45 +09:00
parent 03e68482bb
commit def12a171c
44 changed files with 115 additions and 115 deletions

View File

@ -47,8 +47,8 @@ public abstract class AbstractByteBuf implements ByteBuf {
} }
@Override @Override
public ChannelBufType type() { public BufType type() {
return ChannelBufType.BYTE; return BufType.BYTE;
} }
@Override @Override

View File

@ -15,11 +15,11 @@
*/ */
package io.netty.buffer; package io.netty.buffer;
public interface ChannelBuf { public interface Buf {
/** /**
* The ChannelBufType which will be handled by the ChannelBuf implementation * The BufType which will be handled by the Buf implementation
*/ */
ChannelBufType type(); BufType type();
/** /**
* Returns {@code true} if and only if this buffer has been deallocated by {@link #free()}. * Returns {@code true} if and only if this buffer has been deallocated by {@link #free()}.

View File

@ -16,9 +16,9 @@
package io.netty.buffer; package io.netty.buffer;
/** /**
* The type of the ChannelBuf * The type of the Buf
*/ */
public enum ChannelBufType { public enum BufType {
/** /**
* Operates one bytes. * Operates one bytes.
*/ */

View File

@ -228,7 +228,7 @@ import java.nio.charset.UnsupportedCharsetException;
* {@link ByteBufOutputStream}. * {@link ByteBufOutputStream}.
* @apiviz.landmark * @apiviz.landmark
*/ */
public interface ByteBuf extends ChannelBuf, Comparable<ByteBuf> { public interface ByteBuf extends Buf, Comparable<ByteBuf> {
/** /**
* Returns the number of bytes (octets) this buffer can contain. * Returns the number of bytes (octets) this buffer can contain.

View File

@ -31,8 +31,8 @@ final class DefaultMessageBuf<T> extends ArrayDeque<T> implements MessageBuf<T>
} }
@Override @Override
public ChannelBufType type() { public BufType type() {
return ChannelBufType.MESSAGE; return BufType.MESSAGE;
} }
@Override @Override

View File

@ -19,11 +19,11 @@ import java.util.Collection;
import java.util.Queue; import java.util.Queue;
/** /**
* ChannelBuf which operates on messages * Buf which operates on messages
* *
* @param <T> * @param <T>
*/ */
public interface MessageBuf<T> extends ChannelBuf, Queue<T> { public interface MessageBuf<T> extends Buf, Queue<T> {
int drainTo(Collection<? super T> c); int drainTo(Collection<? super T> c);
int drainTo(Collection<? super T> c, int maxElements); int drainTo(Collection<? super T> c, int maxElements);
} }

View File

@ -32,8 +32,8 @@ final class QueueBackedMessageBuf<T> implements MessageBuf<T> {
} }
@Override @Override
public ChannelBufType type() { public BufType type() {
return ChannelBufType.MESSAGE; return BufType.MESSAGE;
} }
@Override @Override

View File

@ -68,8 +68,8 @@ public final class SwappedByteBuf implements ByteBuf {
} }
@Override @Override
public ChannelBufType type() { public BufType type() {
return ChannelBufType.MESSAGE; return BufType.MESSAGE;
} }
@Override @Override

View File

@ -73,7 +73,7 @@ import java.util.Queue;
* of a new buffer type, generation of hex dump and swapping an integer's * of a new buffer type, generation of hex dump and swapping an integer's
* byte order. * byte order.
* @apiviz.landmark * @apiviz.landmark
* @apiviz.has io.netty.buffer.ChannelBuf oneway - - creates * @apiviz.has io.netty.buffer.Buf oneway - - creates
*/ */
public final class Unpooled { public final class Unpooled {

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.handler.codec.spdy; package io.netty.handler.codec.spdy;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
@ -97,12 +97,12 @@ public class SpdySessionHandler
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.handler.codec; package io.netty.handler.codec;
import io.netty.buffer.Buf;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBuf;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
@ -67,12 +67,12 @@ public abstract class ByteToByteCodec
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
decoder.freeInboundBuffer(ctx, buf); decoder.freeInboundBuffer(ctx, buf);
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
encoder.freeOutboundBuffer(ctx, buf); encoder.freeOutboundBuffer(ctx, buf);
} }

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.handler.codec; package io.netty.handler.codec;
import io.netty.buffer.Buf;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBuf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerAdapter;
@ -71,12 +71,12 @@ public abstract class ByteToMessageCodec<INBOUND_OUT, OUTBOUND_IN>
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
decoder.freeInboundBuffer(ctx, buf); decoder.freeInboundBuffer(ctx, buf);
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
encoder.freeOutboundBuffer(ctx, buf); encoder.freeOutboundBuffer(ctx, buf);
} }

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.handler.codec; package io.netty.handler.codec;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerAdapter;
@ -74,7 +74,7 @@ public abstract class MessageToMessageCodec<INBOUND_IN, INBOUND_OUT, OUTBOUND_IN
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }
@ -90,7 +90,7 @@ public abstract class MessageToMessageCodec<INBOUND_IN, INBOUND_OUT, OUTBOUND_IN
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }

View File

@ -15,10 +15,10 @@
*/ */
package io.netty.handler.codec; package io.netty.handler.codec;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.ByteBufIndexFinder; import io.netty.buffer.ByteBufIndexFinder;
import io.netty.buffer.ChannelBufType;
import io.netty.buffer.SwappedByteBuf; import io.netty.buffer.SwappedByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.util.internal.Signal; import io.netty.util.internal.Signal;
@ -74,8 +74,8 @@ final class ReplayingDecoderBuffer implements ByteBuf {
} }
@Override @Override
public ChannelBufType type() { public BufType type() {
return ChannelBufType.BYTE; return BufType.BYTE;
} }
@Override @Override

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.handler.logging; package io.netty.handler.logging;
import io.netty.buffer.Buf;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBuf;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundByteHandler; import io.netty.channel.ChannelInboundByteHandler;
@ -117,12 +117,12 @@ public class ByteLoggingHandler
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.handler.logging; package io.netty.handler.logging;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
@ -59,12 +59,12 @@ public class MessageLoggingHandler
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }

View File

@ -15,9 +15,9 @@
*/ */
package io.netty.handler.ssl; package io.netty.handler.ssl;
import io.netty.buffer.Buf;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil; import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.ChannelBuf;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelFlushFutureNotifier; import io.netty.channel.ChannelFlushFutureNotifier;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
@ -383,12 +383,12 @@ public class SslHandler
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.handler.stream; package io.netty.handler.stream;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.Channel; import io.netty.channel.Channel;
@ -97,7 +97,7 @@ public class ChunkedWriteHandler
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import java.net.SocketAddress; import java.net.SocketAddress;
@ -33,7 +33,7 @@ import java.net.SocketAddress;
*/ */
public abstract class AbstractServerChannel extends AbstractChannel implements ServerChannel { public abstract class AbstractServerChannel extends AbstractChannel implements ServerChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
/** /**
* Creates a new instance. * Creates a new instance.

View File

@ -15,20 +15,20 @@
*/ */
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
/** /**
* {@link ChannelStateHandler} which handles inbound data. * {@link ChannelStateHandler} which handles inbound data.
*/ */
public interface ChannelInboundHandler extends ChannelStateHandler { public interface ChannelInboundHandler extends ChannelStateHandler {
/** /**
* Return the {@link ChannelBuf} which will be used for inbound data for the given {@link ChannelHandlerContext}. * Return the {@link io.netty.buffer.Buf} which will be used for inbound data for the given {@link ChannelHandlerContext}.
*/ */
ChannelBuf newInboundBuffer(ChannelHandlerContext ctx) throws Exception; Buf newInboundBuffer(ChannelHandlerContext ctx) throws Exception;
/** /**
* Invoked when this handler is not going to receive any inbound message anymore and thus it's safe to * Invoked when this handler is not going to receive any inbound message anymore and thus it's safe to
* deallocate its inbound buffer. * deallocate its inbound buffer.
*/ */
void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception; void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception;
} }

View File

@ -16,13 +16,13 @@
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
public abstract class ChannelInboundHandlerAdapter public abstract class ChannelInboundHandlerAdapter
extends ChannelStateHandlerAdapter implements ChannelInboundHandler { extends ChannelStateHandlerAdapter implements ChannelInboundHandler {
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.ChannelBufType; import io.netty.buffer.BufType;
import java.net.SocketAddress; import java.net.SocketAddress;
@ -24,10 +24,10 @@ import java.net.SocketAddress;
*/ */
public final class ChannelMetadata { public final class ChannelMetadata {
private final ChannelBufType bufferType; private final BufType bufferType;
private final boolean hasDisconnect; private final boolean hasDisconnect;
public ChannelMetadata(ChannelBufType bufferType, boolean hasDisconnect) { public ChannelMetadata(BufType bufferType, boolean hasDisconnect) {
if (bufferType == null) { if (bufferType == null) {
throw new NullPointerException("bufferType"); throw new NullPointerException("bufferType");
} }
@ -36,7 +36,7 @@ public final class ChannelMetadata {
this.hasDisconnect = hasDisconnect; this.hasDisconnect = hasDisconnect;
} }
public ChannelBufType bufferType() { public BufType bufferType() {
return bufferType; return bufferType;
} }

View File

@ -15,14 +15,14 @@
*/ */
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
public interface ChannelOutboundHandler extends ChannelOperationHandler { public interface ChannelOutboundHandler extends ChannelOperationHandler {
ChannelBuf newOutboundBuffer(ChannelHandlerContext ctx) throws Exception; Buf newOutboundBuffer(ChannelHandlerContext ctx) throws Exception;
/** /**
* Invoked when this handler is not allowed to send any outbound message anymore and thus it's safe to * Invoked when this handler is not allowed to send any outbound message anymore and thus it's safe to
* deallocate its outbound buffer. * deallocate its outbound buffer.
*/ */
void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception; void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception;
} }

View File

@ -15,12 +15,12 @@
*/ */
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
public abstract class ChannelOutboundHandlerAdapter public abstract class ChannelOutboundHandlerAdapter
extends ChannelOperationHandlerAdapter implements ChannelOutboundHandler { extends ChannelOperationHandlerAdapter implements ChannelOutboundHandler {
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.ChannelBuf; import io.netty.buffer.Buf;
import java.net.SocketAddress; import java.net.SocketAddress;
@ -62,24 +62,24 @@ public class CombinedChannelHandler
} }
@Override @Override
public ChannelBuf newInboundBuffer( public Buf newInboundBuffer(
ChannelHandlerContext ctx) throws Exception { ChannelHandlerContext ctx) throws Exception {
return in.newInboundBuffer(ctx); return in.newInboundBuffer(ctx);
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
in.freeInboundBuffer(ctx, buf); in.freeInboundBuffer(ctx, buf);
} }
@Override @Override
public ChannelBuf newOutboundBuffer( public Buf newOutboundBuffer(
ChannelHandlerContext ctx) throws Exception { ChannelHandlerContext ctx) throws Exception {
return out.newOutboundBuffer(ctx); return out.newOutboundBuffer(ctx);
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
out.freeOutboundBuffer(ctx, buf); out.freeOutboundBuffer(ctx, buf);
} }

View File

@ -15,9 +15,9 @@
*/ */
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.Buf;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.ChannelBuf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.util.DefaultAttributeMap; import io.netty.util.DefaultAttributeMap;
@ -268,7 +268,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
} }
if (type.contains(ChannelHandlerType.INBOUND)) { if (type.contains(ChannelHandlerType.INBOUND)) {
ChannelBuf buf; Buf buf;
try { try {
buf = ((ChannelInboundHandler) handler).newInboundBuffer(this); buf = ((ChannelInboundHandler) handler).newInboundBuffer(this);
} catch (Exception e) { } catch (Exception e) {
@ -343,7 +343,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
} }
private void initOutboundBuffer() { private void initOutboundBuffer() {
ChannelBuf buf; Buf buf;
try { try {
buf = ((ChannelOutboundHandler) handler).newOutboundBuffer(this); buf = ((ChannelOutboundHandler) handler).newOutboundBuffer(this);
} catch (Exception e) { } catch (Exception e) {

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.Buf;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBuf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.logging.InternalLogger; import io.netty.logging.InternalLogger;
@ -1459,7 +1459,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
private final class HeadHandler implements ChannelOutboundHandler { private final class HeadHandler implements ChannelOutboundHandler {
@Override @Override
public ChannelBuf newOutboundBuffer(ChannelHandlerContext ctx) throws Exception { public Buf newOutboundBuffer(ChannelHandlerContext ctx) throws Exception {
switch (channel.metadata().bufferType()) { switch (channel.metadata().bufferType()) {
case BYTE: case BYTE:
return ctx.alloc().ioBuffer(); return ctx.alloc().ioBuffer();
@ -1471,7 +1471,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) {
buf.free(); buf.free();
} }

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.channel.embedded; package io.netty.channel.embedded;
import io.netty.buffer.Buf;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBuf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.AbstractChannel; import io.netty.channel.AbstractChannel;
@ -207,7 +207,7 @@ public abstract class AbstractEmbeddedChannel extends AbstractChannel {
private final class LastInboundMessageHandler extends ChannelInboundHandlerAdapter { private final class LastInboundMessageHandler extends ChannelInboundHandlerAdapter {
@Override @Override
public ChannelBuf newInboundBuffer(ChannelHandlerContext ctx) throws Exception { public Buf newInboundBuffer(ChannelHandlerContext ctx) throws Exception {
return lastInboundMessageBuffer; return lastInboundMessageBuffer;
} }
@ -231,7 +231,7 @@ public abstract class AbstractEmbeddedChannel extends AbstractChannel {
private final class LastInboundByteHandler extends ChannelInboundHandlerAdapter { private final class LastInboundByteHandler extends ChannelInboundHandlerAdapter {
@Override @Override
public ChannelBuf newInboundBuffer(ChannelHandlerContext ctx) throws Exception { public Buf newInboundBuffer(ChannelHandlerContext ctx) throws Exception {
return lastInboundByteBuffer; return lastInboundByteBuffer;
} }

View File

@ -15,15 +15,15 @@
*/ */
package io.netty.channel.embedded; package io.netty.channel.embedded;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelMetadata; import io.netty.channel.ChannelMetadata;
public class EmbeddedByteChannel extends AbstractEmbeddedChannel { public class EmbeddedByteChannel extends AbstractEmbeddedChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.BYTE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.BYTE, false);
public EmbeddedByteChannel(ChannelHandler... handlers) { public EmbeddedByteChannel(ChannelHandler... handlers) {
super(Unpooled.buffer(), handlers); super(Unpooled.buffer(), handlers);

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.channel.embedded; package io.netty.channel.embedded;
import io.netty.buffer.ChannelBufType; import io.netty.buffer.BufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler;
@ -23,7 +23,7 @@ import io.netty.channel.ChannelMetadata;
public class EmbeddedMessageChannel extends AbstractEmbeddedChannel { public class EmbeddedMessageChannel extends AbstractEmbeddedChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
public EmbeddedMessageChannel(ChannelHandler... handlers) { public EmbeddedMessageChannel(ChannelHandler... handlers) {
super(Unpooled.messageBuffer(), handlers); super(Unpooled.messageBuffer(), handlers);

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.channel.local; package io.netty.channel.local;
import io.netty.buffer.ChannelBufType; import io.netty.buffer.BufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.channel.AbstractChannel; import io.netty.channel.AbstractChannel;
import io.netty.channel.Channel; import io.netty.channel.Channel;
@ -41,7 +41,7 @@ import java.util.Collections;
*/ */
public class LocalChannel extends AbstractChannel { public class LocalChannel extends AbstractChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
private final ChannelConfig config = new DefaultChannelConfig(); private final ChannelConfig config = new DefaultChannelConfig();
private final Runnable shutdownHook = new Runnable() { private final Runnable shutdownHook = new Runnable() {

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.channel.socket.aio; package io.netty.channel.socket.aio;
import io.netty.buffer.ChannelBufType; import io.netty.buffer.BufType;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelMetadata; import io.netty.channel.ChannelMetadata;
@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class AioServerSocketChannel extends AbstractAioChannel implements ServerSocketChannel { public class AioServerSocketChannel extends AbstractAioChannel implements ServerSocketChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
private static final AcceptHandler ACCEPT_HANDLER = new AcceptHandler(); private static final AcceptHandler ACCEPT_HANDLER = new AcceptHandler();
private static final InternalLogger logger = private static final InternalLogger logger =

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.channel.socket.aio; package io.netty.channel.socket.aio;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
import io.netty.channel.ChannelFlushFutureNotifier; import io.netty.channel.ChannelFlushFutureNotifier;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class AioSocketChannel extends AbstractAioChannel implements SocketChannel { public class AioSocketChannel extends AbstractAioChannel implements SocketChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.BYTE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.BYTE, false);
private static final CompletionHandler<Void, AioSocketChannel> CONNECT_HANDLER = new ConnectHandler(); private static final CompletionHandler<Void, AioSocketChannel> CONNECT_HANDLER = new ConnectHandler();
private static final CompletionHandler<Integer, AioSocketChannel> WRITE_HANDLER = new WriteHandler<Integer>(); private static final CompletionHandler<Integer, AioSocketChannel> WRITE_HANDLER = new WriteHandler<Integer>();

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.channel.socket.nio; package io.netty.channel.socket.nio;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
@ -49,7 +49,7 @@ import java.util.Map;
public final class NioDatagramChannel public final class NioDatagramChannel
extends AbstractNioMessageChannel implements io.netty.channel.socket.DatagramChannel { extends AbstractNioMessageChannel implements io.netty.channel.socket.DatagramChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, true); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, true);
private final DatagramChannelConfig config; private final DatagramChannelConfig config;
private final Map<InetAddress, List<MembershipKey>> memberships = private final Map<InetAddress, List<MembershipKey>> memberships =

View File

@ -19,8 +19,8 @@ import com.sun.nio.sctp.Association;
import com.sun.nio.sctp.MessageInfo; import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.NotificationHandler; import com.sun.nio.sctp.NotificationHandler;
import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpChannel;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.Channel; import io.netty.channel.Channel;
@ -45,7 +45,7 @@ import java.util.Iterator;
import java.util.Set; import java.util.Set;
public class NioSctpChannel extends AbstractNioMessageChannel implements io.netty.channel.socket.SctpChannel { public class NioSctpChannel extends AbstractNioMessageChannel implements io.netty.channel.socket.SctpChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioSctpChannel.class); private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioSctpChannel.class);

View File

@ -17,7 +17,7 @@ package io.netty.channel.socket.nio;
import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpServerChannel; import com.sun.nio.sctp.SctpServerChannel;
import io.netty.buffer.ChannelBufType; import io.netty.buffer.BufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
import io.netty.channel.ChannelMetadata; import io.netty.channel.ChannelMetadata;
@ -35,7 +35,7 @@ import java.util.Set;
public class NioSctpServerChannel extends AbstractNioMessageChannel public class NioSctpServerChannel extends AbstractNioMessageChannel
implements io.netty.channel.socket.SctpServerChannel { implements io.netty.channel.socket.SctpServerChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
private static SctpServerChannel newSocket() { private static SctpServerChannel newSocket() {
try { try {

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.channel.socket.nio; package io.netty.channel.socket.nio;
import io.netty.buffer.ChannelBufType; import io.netty.buffer.BufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
import io.netty.channel.ChannelMetadata; import io.netty.channel.ChannelMetadata;
@ -32,7 +32,7 @@ import java.nio.channels.SocketChannel;
public class NioServerSocketChannel extends AbstractNioMessageChannel public class NioServerSocketChannel extends AbstractNioMessageChannel
implements io.netty.channel.socket.ServerSocketChannel { implements io.netty.channel.socket.ServerSocketChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
private static ServerSocketChannel newSocket() { private static ServerSocketChannel newSocket() {
try { try {

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.channel.socket.nio; package io.netty.channel.socket.nio;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
@ -34,7 +34,7 @@ import java.nio.channels.SocketChannel;
public class NioSocketChannel extends AbstractNioByteChannel implements io.netty.channel.socket.SocketChannel { public class NioSocketChannel extends AbstractNioByteChannel implements io.netty.channel.socket.SocketChannel {
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.BYTE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.BYTE, false);
private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioSocketChannel.class); private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioSocketChannel.class);

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.channel.socket.oio; package io.netty.channel.socket.oio;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
@ -44,7 +44,7 @@ public class OioDatagramChannel extends AbstractOioMessageChannel
private static final InternalLogger logger = InternalLoggerFactory.getInstance(OioDatagramChannel.class); private static final InternalLogger logger = InternalLoggerFactory.getInstance(OioDatagramChannel.class);
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, true); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, true);
private static final byte[] EMPTY_DATA = new byte[0]; private static final byte[] EMPTY_DATA = new byte[0];

View File

@ -19,8 +19,8 @@ import com.sun.nio.sctp.Association;
import com.sun.nio.sctp.MessageInfo; import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.NotificationHandler; import com.sun.nio.sctp.NotificationHandler;
import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpChannel;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.Channel; import io.netty.channel.Channel;
@ -49,7 +49,7 @@ public class OioSctpChannel extends AbstractOioMessageChannel
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLoggerFactory.getInstance(OioSctpChannel.class); InternalLoggerFactory.getInstance(OioSctpChannel.class);
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
private final SctpChannel ch; private final SctpChannel ch;
private final SctpChannelConfig config; private final SctpChannelConfig config;

View File

@ -17,7 +17,7 @@ package io.netty.channel.socket.oio;
import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpServerChannel; import com.sun.nio.sctp.SctpServerChannel;
import io.netty.buffer.ChannelBufType; import io.netty.buffer.BufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
import io.netty.channel.ChannelMetadata; import io.netty.channel.ChannelMetadata;
@ -40,7 +40,7 @@ public class OioSctpServerChannel extends AbstractOioMessageChannel
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLoggerFactory.getInstance(OioSctpServerChannel.class); InternalLoggerFactory.getInstance(OioSctpServerChannel.class);
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
private static SctpServerChannel newServerSocket() { private static SctpServerChannel newServerSocket() {
try { try {

View File

@ -15,7 +15,7 @@
*/ */
package io.netty.channel.socket.oio; package io.netty.channel.socket.oio;
import io.netty.buffer.ChannelBufType; import io.netty.buffer.BufType;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
import io.netty.channel.ChannelMetadata; import io.netty.channel.ChannelMetadata;
@ -40,7 +40,7 @@ public class OioServerSocketChannel extends AbstractOioMessageChannel
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLoggerFactory.getInstance(OioServerSocketChannel.class); InternalLoggerFactory.getInstance(OioServerSocketChannel.class);
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.MESSAGE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
private static ServerSocket newServerSocket() { private static ServerSocket newServerSocket() {
try { try {

View File

@ -15,8 +15,8 @@
*/ */
package io.netty.channel.socket.oio; package io.netty.channel.socket.oio;
import io.netty.buffer.BufType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBufType;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
@ -45,7 +45,7 @@ public class OioSocketChannel extends AbstractOioByteChannel
private static final InternalLogger logger = private static final InternalLogger logger =
InternalLoggerFactory.getInstance(OioSocketChannel.class); InternalLoggerFactory.getInstance(OioSocketChannel.class);
private static final ChannelMetadata METADATA = new ChannelMetadata(ChannelBufType.BYTE, false); private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.BYTE, false);
private final Socket socket; private final Socket socket;
private final SocketChannelConfig config; private final SocketChannelConfig config;

View File

@ -16,8 +16,8 @@
package io.netty.channel.local; package io.netty.channel.local;
import io.netty.bootstrap.ServerBootstrap; import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.Buf;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ChannelBuf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.Channel; import io.netty.channel.Channel;
@ -349,12 +349,12 @@ public class LocalTransportThreadModelTest {
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) {
// Nothing to free // Nothing to free
} }
@ -406,12 +406,12 @@ public class LocalTransportThreadModelTest {
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) {
buf.free(); buf.free();
} }
@ -506,12 +506,12 @@ public class LocalTransportThreadModelTest {
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
buf.free(); buf.free();
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) {
// Nothing to free // Nothing to free
} }
@ -597,12 +597,12 @@ public class LocalTransportThreadModelTest {
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) {
// Nothing to free // Nothing to free
} }
@ -682,12 +682,12 @@ public class LocalTransportThreadModelTest {
} }
@Override @Override
public void freeInboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) throws Exception { public void freeInboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Exception {
// Nothing to free // Nothing to free
} }
@Override @Override
public void freeOutboundBuffer(ChannelHandlerContext ctx, ChannelBuf buf) { public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) {
// Nothing to free // Nothing to free
} }