1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.netty.example.proxy;
17
18 import org.jboss.netty.channel.ChannelPipeline;
19 import org.jboss.netty.channel.ChannelPipelineFactory;
20 import org.jboss.netty.channel.socket.ClientSocketChannelFactory;
21 import org.jboss.netty.handler.logging.LoggingHandler;
22 import org.jboss.netty.logging.InternalLogLevel;
23
24 import static org.jboss.netty.channel.Channels.*;
25
26 public class HexDumpProxyPipelineFactory implements ChannelPipelineFactory {
27
28 private final ClientSocketChannelFactory cf;
29
30 public HexDumpProxyPipelineFactory(ClientSocketChannelFactory cf) {
31 this.cf = cf;
32 }
33
34 public ChannelPipeline getPipeline() {
35 ChannelPipeline p = pipeline();
36 p.addLast("logger", new LoggingHandler(InternalLogLevel.INFO));
37 p.addLast("handler", new HexDumpProxyInboundHandler(cf));
38 return p;
39 }
40 }