From d72b89db218d64e0115ab9491009f0d2dc7e7535 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 2 Aug 2011 08:47:56 +0900 Subject: [PATCH] NETTY-422 Add getPipeline() to CodecEmbedder so that a user can modify the pipeline dynamically. --- .../handler/codec/embedder/AbstractCodecEmbedder.java | 5 +++++ .../jboss/netty/handler/codec/embedder/CodecEmbedder.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/org/jboss/netty/handler/codec/embedder/AbstractCodecEmbedder.java b/src/main/java/org/jboss/netty/handler/codec/embedder/AbstractCodecEmbedder.java index cecea08d1e..b9e4d6c916 100644 --- a/src/main/java/org/jboss/netty/handler/codec/embedder/AbstractCodecEmbedder.java +++ b/src/main/java/org/jboss/netty/handler/codec/embedder/AbstractCodecEmbedder.java @@ -187,6 +187,11 @@ abstract class AbstractCodecEmbedder implements CodecEmbedder { return productQueue.size(); } + @Override + public ChannelPipeline getPipeline() { + return pipeline; + } + private final class EmbeddedChannelSink implements ChannelSink, ChannelUpstreamHandler { EmbeddedChannelSink() { super(); diff --git a/src/main/java/org/jboss/netty/handler/codec/embedder/CodecEmbedder.java b/src/main/java/org/jboss/netty/handler/codec/embedder/CodecEmbedder.java index d1a28a070e..40afab6c64 100644 --- a/src/main/java/org/jboss/netty/handler/codec/embedder/CodecEmbedder.java +++ b/src/main/java/org/jboss/netty/handler/codec/embedder/CodecEmbedder.java @@ -17,6 +17,8 @@ package org.jboss.netty.handler.codec.embedder; import java.util.Collection; +import org.jboss.netty.channel.ChannelPipeline; + /** * A helper that wraps an encoder or a decoder (codec) so that they can be used * without doing actual I/O in unit tests or higher level codecs. Please refer @@ -93,4 +95,9 @@ public interface CodecEmbedder { * Returns the number of encoded or decoded output in the product queue. */ int size(); + + /** + * Returns the {@link ChannelPipeline} that handles the input. + */ + ChannelPipeline getPipeline(); }