1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.netty.channel.socket.http;
17
18 import org.jboss.netty.channel.ChannelPipeline;
19 import org.jboss.netty.channel.ChannelSink;
20 import org.jboss.netty.channel.socket.ClientSocketChannelFactory;
21 import org.jboss.netty.channel.socket.SocketChannel;
22
23
24
25
26
27
28
29
30
31 public class HttpTunnelingClientSocketChannelFactory implements ClientSocketChannelFactory {
32
33 private final ChannelSink sink = new HttpTunnelingClientSocketPipelineSink();
34 private final ClientSocketChannelFactory clientSocketChannelFactory;
35
36
37
38
39 public HttpTunnelingClientSocketChannelFactory(ClientSocketChannelFactory clientSocketChannelFactory) {
40 this.clientSocketChannelFactory = clientSocketChannelFactory;
41 }
42
43 public SocketChannel newChannel(ChannelPipeline pipeline) {
44 return new HttpTunnelingClientSocketChannel(this, pipeline, sink, clientSocketChannelFactory);
45 }
46
47 public void releaseExternalResources() {
48 clientSocketChannelFactory.releaseExternalResources();
49 }
50
51 public void shutdown() {
52 clientSocketChannelFactory.shutdown();
53 }
54 }