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 59a349031a
commit d72b89db21
2 changed files with 12 additions and 0 deletions

View File

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

View File

@ -17,6 +17,8 @@ package org.jboss.netty.handler.codec.embedder;
import java.util.Collection; 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 * 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 * 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. * Returns the number of encoded or decoded output in the product queue.
*/ */
int size(); int size();
/**
* Returns the {@link ChannelPipeline} that handles the input.
*/
ChannelPipeline getPipeline();
} }