1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.mimo.netty.example.icap.simple;
15
16 import static org.jboss.netty.channel.Channels.pipeline;
17
18 import org.jboss.netty.channel.ChannelPipeline;
19 import org.jboss.netty.channel.ChannelPipelineFactory;
20
21 import ch.mimo.netty.handler.codec.icap.IcapChunkAggregator;
22 import ch.mimo.netty.handler.codec.icap.IcapChunkSeparator;
23 import ch.mimo.netty.handler.codec.icap.IcapRequestDecoder;
24 import ch.mimo.netty.handler.codec.icap.IcapResponseEncoder;
25
26 public class IcapServerChannelPipeline implements ChannelPipelineFactory {
27
28 @Override
29 public ChannelPipeline getPipeline() throws Exception {
30 ChannelPipeline pipeline = pipeline();
31 pipeline.addLast("decoder",new IcapRequestDecoder());
32 pipeline.addLast("chunkAggregator",new IcapChunkAggregator(4096));
33 pipeline.addLast("encoder",new IcapResponseEncoder());
34 pipeline.addLast("chunkSeparator",new IcapChunkSeparator(4096));
35 pipeline.addLast("handler",new IcapServerHandler());
36 return pipeline;
37 }
38
39 }