Permalink
Browse files

[#846] Tighten up visibility

  • Loading branch information...
1 parent 5bd3648 commit 852f546b5b4b844e6191f3bf2f3716085f5f2cda @normanmaurer normanmaurer committed Dec 25, 2012
Showing with 62 additions and 61 deletions.
  1. +1 −1 codec-http/src/main/java/io/netty/handler/codec/http/HttpChunkAggregator.java
  2. +2 −2 codec-http/src/main/java/io/netty/handler/codec/http/HttpClientCodec.java
  3. +1 −1 codec-http/src/main/java/io/netty/handler/codec/http/HttpContentDecoder.java
  4. +1 −1 codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java
  5. +1 −1 codec-http/src/main/java/io/netty/handler/codec/http/HttpMessageDecoder.java
  6. +1 −1 codec-http/src/main/java/io/netty/handler/codec/http/HttpMessageEncoder.java
  7. +1 −1 codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspMessageDecoder.java
  8. +1 −1 codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspMessageEncoder.java
  9. +1 −1 codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyFrameDecoder.java
  10. +1 −1 codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyFrameEncoder.java
  11. +2 −2 codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpResponseStreamIdHandler.java
  12. +2 −2 codec/src/main/java/io/netty/handler/codec/ByteToByteCodec.java
  13. +2 −2 codec/src/main/java/io/netty/handler/codec/ByteToByteDecoder.java
  14. +1 −1 codec/src/main/java/io/netty/handler/codec/ByteToByteEncoder.java
  15. +2 −2 codec/src/main/java/io/netty/handler/codec/ByteToMessageCodec.java
  16. +2 −2 codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java
  17. +2 −1 codec/src/main/java/io/netty/handler/codec/DelimiterBasedFrameDecoder.java
  18. +1 −1 codec/src/main/java/io/netty/handler/codec/FixedLengthFrameDecoder.java
  19. +1 −1 codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java
  20. +1 −1 codec/src/main/java/io/netty/handler/codec/LengthFieldPrepender.java
  21. +1 −1 codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java
  22. +1 −1 codec/src/main/java/io/netty/handler/codec/MessageToByteEncoder.java
  23. +2 −2 codec/src/main/java/io/netty/handler/codec/MessageToMessageCodec.java
  24. +1 −1 codec/src/main/java/io/netty/handler/codec/MessageToMessageDecoder.java
  25. +1 −1 codec/src/main/java/io/netty/handler/codec/MessageToMessageEncoder.java
  26. +1 −1 codec/src/main/java/io/netty/handler/codec/base64/Base64Decoder.java
  27. +1 −1 codec/src/main/java/io/netty/handler/codec/base64/Base64Encoder.java
  28. +1 −1 codec/src/main/java/io/netty/handler/codec/bytes/ByteArrayDecoder.java
  29. +1 −1 codec/src/main/java/io/netty/handler/codec/bytes/ByteArrayEncoder.java
  30. +1 −1 codec/src/main/java/io/netty/handler/codec/compression/JZlibDecoder.java
  31. +1 −1 codec/src/main/java/io/netty/handler/codec/compression/JZlibEncoder.java
  32. +1 −1 codec/src/main/java/io/netty/handler/codec/compression/JdkZlibEncoder.java
  33. +1 −1 codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedDecoder.java
  34. +1 −1 codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedEncoder.java
  35. +2 −2 codec/src/main/java/io/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java
  36. +1 −1 codec/src/main/java/io/netty/handler/codec/marshalling/CompatibleMarshallingEncoder.java
  37. +1 −1 codec/src/main/java/io/netty/handler/codec/marshalling/MarshallingDecoder.java
  38. +1 −1 codec/src/main/java/io/netty/handler/codec/marshalling/MarshallingEncoder.java
  39. +1 −1 codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoder.java
  40. +1 −1 codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufEncoder.java
  41. +1 −1 codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32FrameDecoder.java
  42. +1 −1 codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrepender.java
  43. +1 −1 codec/src/main/java/io/netty/handler/codec/sctp/SctpInboundByteStreamHandler.java
  44. +1 −1 codec/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java
  45. +1 −1 codec/src/main/java/io/netty/handler/codec/serialization/CompatibleObjectEncoder.java
  46. +1 −1 codec/src/main/java/io/netty/handler/codec/serialization/ObjectDecoder.java
  47. +1 −1 codec/src/main/java/io/netty/handler/codec/serialization/ObjectEncoder.java
  48. +1 −1 codec/src/main/java/io/netty/handler/codec/string/StringDecoder.java
  49. +1 −1 codec/src/main/java/io/netty/handler/codec/string/StringEncoder.java
  50. +1 −1 transport/src/main/java/io/netty/channel/ChannelInboundByteHandlerAdapter.java
  51. +3 −3 transport/src/main/java/io/netty/channel/ChannelInboundMessageHandlerAdapter.java
@@ -110,7 +110,7 @@ public final void setMaxCumulationBufferComponents(int maxCumulationBufferCompon
}
@Override
- public HttpMessage decode(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
+ protected HttpMessage decode(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
HttpMessage currentMessage = this.currentMessage;
if (msg instanceof HttpMessage) {
@@ -82,7 +82,7 @@ public HttpClientCodec(
private final class Encoder extends HttpRequestEncoder {
@Override
- public void encode(
+ protected void encode(
ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
if (msg instanceof HttpRequest && !done) {
queue.offer(((HttpRequest) msg).getMethod());
@@ -109,7 +109,7 @@ public void encode(
}
@Override
- public Object decode(
+ protected Object decode(
ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
if (done) {
return buffer.readBytes(actualReadableBytes());
@@ -52,7 +52,7 @@ protected HttpContentDecoder() {
}
@Override
- public Object decode(ChannelHandlerContext ctx, Object msg) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof HttpResponse && ((HttpResponse) msg).getStatus().getCode() == 100) {
// 100-continue response must be passed through.
return msg;
@@ -61,7 +61,7 @@ protected HttpContentEncoder() {
}
@Override
- public HttpMessage decode(ChannelHandlerContext ctx, HttpMessage msg)
+ protected HttpMessage decode(ChannelHandlerContext ctx, HttpMessage msg)
throws Exception {
String acceptedEncoding = msg.getHeader(HttpHeaders.Names.ACCEPT_ENCODING);
if (acceptedEncoding == null) {
@@ -168,7 +168,7 @@ protected HttpMessageDecoder(
}
@Override
- public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
switch (state()) {
case SKIP_CONTROL_CHARS: {
try {
@@ -54,7 +54,7 @@ protected HttpMessageEncoder() {
}
@Override
- public void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
+ protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
if (msg instanceof HttpMessage) {
HttpMessage m = (HttpMessage) msg;
HttpTransferEncoding te = m.getTransferEncoding();
@@ -74,7 +74,7 @@ protected RtspMessageDecoder(int maxInitialLineLength, int maxHeaderSize, int ma
}
@Override
- public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
Object o = super.decode(ctx, buffer);
if (o != null && aggregator.writeInbound(o)) {
return aggregator.readInbound();
@@ -39,7 +39,7 @@ protected RtspMessageEncoder() {
}
@Override
- public void encode(ChannelHandlerContext ctx, Object msg,
+ protected void encode(ChannelHandlerContext ctx, Object msg,
ByteBuf out) throws Exception {
// Ignore unrelated message types such as HttpChunk.
if (!(msg instanceof HttpMessage)) {
@@ -101,7 +101,7 @@ public Object decodeLast(ChannelHandlerContext ctx, ByteBuf in) throws Exception
}
@Override
- public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
switch(state) {
case READ_COMMON_HEADER:
state = readCommonHeader(buffer);
@@ -78,7 +78,7 @@ public void operationComplete(ChannelFuture future) throws Exception {
}
@Override
- public void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
+ protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
if (msg instanceof SpdyDataFrame) {
SpdyDataFrame spdyDataFrame = (SpdyDataFrame) msg;
@@ -38,7 +38,7 @@ public SpdyHttpResponseStreamIdHandler() {
}
@Override
- public HttpMessage encode(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
+ protected HttpMessage encode(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
Integer id = ids.poll();
if (id != null && id.intValue() != NO_ID && !msg.containsHeader(SpdyHttpHeaders.Names.STREAM_ID)) {
SpdyHttpHeaders.setStreamId(msg, id);
@@ -47,7 +47,7 @@ public HttpMessage encode(ChannelHandlerContext ctx, HttpMessage msg) throws Exc
}
@Override
- public Object decode(ChannelHandlerContext ctx, Object msg) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof HttpMessage) {
boolean contains = ((HttpMessage) msg).containsHeader(SpdyHttpHeaders.Names.STREAM_ID);
if (!contains) {
@@ -109,14 +109,14 @@ public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Except
/**
* @see {@link ByteToByteEncoder#encode(ChannelHandlerContext, ByteBuf, ByteBuf)}
*/
- public abstract void encode(
+ protected abstract void encode(
ChannelHandlerContext ctx,
ByteBuf in, ByteBuf out) throws Exception;
/**
* @see {@link ByteToByteDecoder#decode(ChannelHandlerContext, ByteBuf, ByteBuf)}
*/
- public abstract void decode(
+ protected abstract void decode(
ChannelHandlerContext ctx,
ByteBuf in, ByteBuf out) throws Exception;
}
@@ -111,7 +111,7 @@ private void callDecode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) {
* @param out the {@link ByteBuf} to which the decoded data will be written
* @throws Exception is thrown if an error accour
*/
- public abstract void decode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception;
+ protected abstract void decode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception;
/**
* Is called one last time when the {@link ChannelHandlerContext} goes in-active. Which means the
@@ -120,7 +120,7 @@ private void callDecode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) {
* By default this will just call {@link #decode(ChannelHandlerContext, ByteBuf, ByteBuf)} but sub-classes may
* override this for some special cleanup operation.
*/
- public void decodeLast(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
+ protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
decode(ctx, in, out);
}
}
@@ -79,5 +79,5 @@ public void flush(ChannelHandlerContext ctx, ChannelFuture future) throws Except
* @param out the {@link ByteBuf} to which the decoded data will be written
* @throws Exception is thrown if an error accour
*/
- public abstract void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception;
+ protected abstract void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception;
}
@@ -80,10 +80,10 @@ public void freeOutboundBuffer(ChannelHandlerContext ctx, Buf buf) throws Except
encoder.freeOutboundBuffer(ctx, buf);
}
- public abstract void encode(
+ protected abstract void encode(
ChannelHandlerContext ctx,
OUTBOUND_IN msg, ByteBuf out) throws Exception;
- public abstract INBOUND_OUT decode(
+ protected abstract INBOUND_OUT decode(
ChannelHandlerContext ctx, ByteBuf in) throws Exception;
}
@@ -166,7 +166,7 @@ public void replace(String newHandlerName, ChannelInboundByteHandler newHandler)
* there was not enough data left in the {@link ByteBuf} to decode.
* @throws Exception is thrown if an error accour
*/
- public abstract O decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception;
+ protected abstract O decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception;
/**
* Is called one last time when the {@link ChannelHandlerContext} goes in-active. Which means the
@@ -175,7 +175,7 @@ public void replace(String newHandlerName, ChannelInboundByteHandler newHandler)
* By default this will just call {@link #decode(ChannelHandlerContext, ByteBuf)} but sub-classes may
* override this for some special cleanup operation.
*/
- public O decodeLast(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
+ protected O decodeLast(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
return decode(ctx, in);
}
}
@@ -209,8 +209,9 @@ private static boolean isLineBased(final ByteBuf[] delimiters) {
private boolean isSubclass() {
return getClass() != DelimiterBasedFrameDecoder.class;
}
+
@Override
- public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
if (lineBasedDecoder != null) {
return lineBasedDecoder.decode(ctx, buffer);
}
@@ -74,7 +74,7 @@ public ByteBuf newInboundBuffer(ChannelHandlerContext ctx) throws Exception {
}
@Override
- public Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
if (in.readableBytes() < frameLength) {
return null;
} else {
@@ -307,7 +307,7 @@ public LengthFieldBasedFrameDecoder(
}
@Override
- public Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
if (discardingTooLongFrame) {
long bytesToDiscard = this.bytesToDiscard;
int localBytesToDiscard = (int) Math.min(bytesToDiscard, in.readableBytes());
@@ -95,7 +95,7 @@ public LengthFieldPrepender(
}
@Override
- public void encode(
+ protected void encode(
ChannelHandlerContext ctx,
ByteBuf msg, ByteBuf out) throws Exception {
@@ -67,7 +67,7 @@ public LineBasedFrameDecoder(final int maxLength, final boolean stripDelimiter,
}
@Override
- public ByteBuf decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
+ protected ByteBuf decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
final int eol = findEndOfLine(buffer);
if (eol != -1) {
@@ -104,5 +104,5 @@ public boolean isEncodable(Object msg) throws Exception {
* @param out the {@link ByteBuf} into which the encoded message will be written
* @throws Exception is thrown if an error accour
*/
- public abstract void encode(ChannelHandlerContext ctx, I msg, ByteBuf out) throws Exception;
+ protected abstract void encode(ChannelHandlerContext ctx, I msg, ByteBuf out) throws Exception;
}
@@ -142,6 +142,6 @@ public boolean isEncodable(Object msg) throws Exception {
return ChannelHandlerUtil.acceptMessage(acceptedOutboundMsgTypes, msg);
}
- public abstract OUTBOUND_OUT encode(ChannelHandlerContext ctx, OUTBOUND_IN msg) throws Exception;
- public abstract INBOUND_OUT decode(ChannelHandlerContext ctx, INBOUND_IN msg) throws Exception;
+ protected abstract OUTBOUND_OUT encode(ChannelHandlerContext ctx, OUTBOUND_IN msg) throws Exception;
+ protected abstract INBOUND_OUT decode(ChannelHandlerContext ctx, INBOUND_IN msg) throws Exception;
}
@@ -121,5 +121,5 @@ public boolean isDecodable(Object msg) throws Exception {
* needs to do some kind of aggragation
* @throws Exception is thrown if an error accour
*/
- public abstract O decode(ChannelHandlerContext ctx, I msg) throws Exception;
+ protected abstract O decode(ChannelHandlerContext ctx, I msg) throws Exception;
}
@@ -111,5 +111,5 @@ public boolean isEncodable(Object msg) throws Exception {
* needs to do some kind of aggragation
* @throws Exception is thrown if an error accour
*/
- public abstract O encode(ChannelHandlerContext ctx, I msg) throws Exception;
+ protected abstract O encode(ChannelHandlerContext ctx, I msg) throws Exception;
}
@@ -62,7 +62,7 @@ public Base64Decoder(Base64Dialect dialect) {
}
@Override
- public ByteBuf decode(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
+ protected ByteBuf decode(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
return Base64.decode(msg, msg.readerIndex(), msg.readableBytes(), dialect);
}
}
@@ -65,7 +65,7 @@ public Base64Encoder(boolean breakLines, Base64Dialect dialect) {
}
@Override
- public ByteBuf encode(ChannelHandlerContext ctx,
+ protected ByteBuf encode(ChannelHandlerContext ctx,
ByteBuf msg) throws Exception {
return Base64.encode(msg, msg.readerIndex(), msg.readableBytes(), breakLines, dialect);
}
@@ -53,7 +53,7 @@ public ByteArrayDecoder() {
}
@Override
- public byte[] decode(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
+ protected byte[] decode(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
byte[] array;
if (msg.hasArray()) {
if (msg.arrayOffset() == 0 && msg.readableBytes() == msg.capacity()) {
@@ -60,7 +60,7 @@ public ByteArrayEncoder() {
}
@Override
- public ByteBuf encode(ChannelHandlerContext ctx, byte[] msg) throws Exception {
+ protected ByteBuf encode(ChannelHandlerContext ctx, byte[] msg) throws Exception {
if (msg.length == 0) {
return null;
}
@@ -81,7 +81,7 @@ public boolean isClosed() {
}
@Override
- public void decode(
+ protected void decode(
ChannelHandlerContext ctx,
ByteBuf in, ByteBuf out) throws Exception {
@@ -265,7 +265,7 @@ public boolean isClosed() {
}
@Override
- public void encode(ChannelHandlerContext ctx,
+ protected void encode(ChannelHandlerContext ctx,
ByteBuf in, ByteBuf out) throws Exception {
if (finished.get()) {
return;
@@ -177,7 +177,7 @@ public boolean isClosed() {
}
@Override
- public void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
+ protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
if (finished.get()) {
out.writeBytes(in);
in.discardReadBytes();
@@ -69,7 +69,7 @@ public SnappyFramedDecoder(boolean validateChecksums) {
}
@Override
- public void decode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
+ protected void decode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
if (!in.readable()) {
return;
}
@@ -46,7 +46,7 @@
private boolean started;
@Override
- public void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
+ protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
if (!in.readable()) {
return;
}
@@ -54,7 +54,7 @@ public CompatibleMarshallingDecoder(UnmarshallerProvider provider, int maxObject
}
@Override
- public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
if (discardingTooLongFrame) {
buffer.skipBytes(actualReadableBytes());
checkpoint();
@@ -82,7 +82,7 @@ public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception
}
@Override
- public Object decodeLast(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
+ protected Object decodeLast(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
switch (buffer.readableBytes()) {
case 0:
return null;
@@ -48,7 +48,7 @@ public CompatibleMarshallingEncoder(MarshallerProvider provider) {
}
@Override
- public void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
+ protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
Marshaller marshaller = provider.getMarshaller(ctx);
marshaller.start(new ChannelBufferByteOutput(out));
marshaller.writeObject(msg);
@@ -59,7 +59,7 @@ public MarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize) {
}
@Override
- public Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
ByteBuf frame = (ByteBuf) super.decode(ctx, in);
if (frame == null) {
return null;
@@ -50,7 +50,7 @@ public MarshallingEncoder(MarshallerProvider provider) {
}
@Override
- public void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
+ protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception {
Marshaller marshaller = provider.getMarshaller(ctx);
int lengthPos = out.writerIndex();
out.writeBytes(LENGTH_PLACEHOLDER);
Oops, something went wrong.

0 comments on commit 852f546

Please sign in to comment.