NETTY-422 Add getPipeline() to CodecEmbedder so that a user can modify the pipeline dynamically.

This commit is contained in:
Trustin Lee 2011-08-02 08:47:56 +09:00
parent 8f30a11c67
commit 654da6d02a
2 changed files with 11 additions and 0 deletions

View File

@ -181,6 +181,10 @@ abstract class AbstractCodecEmbedder<E> implements CodecEmbedder<E> {
return productQueue.size();
}
public ChannelPipeline getPipeline() {
return pipeline;
}
private final class EmbeddedChannelSink implements ChannelSink, ChannelUpstreamHandler {
EmbeddedChannelSink() {
super();

View File

@ -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<E> {
* Returns the number of encoded or decoded output in the product queue.
*/
int size();
/**
* Returns the {@link ChannelPipeline} that handles the input.
*/
ChannelPipeline getPipeline();
}