1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.spdy.client.http;
20
21 import org.eclipse.jetty.client.HttpChannel;
22 import org.eclipse.jetty.client.HttpDestination;
23 import org.eclipse.jetty.client.HttpExchange;
24 import org.eclipse.jetty.spdy.api.Session;
25
26 public class HttpChannelOverSPDY extends HttpChannel
27 {
28 private final Session session;
29 private final HttpSenderOverSPDY sender;
30 private final HttpReceiverOverSPDY receiver;
31
32 public HttpChannelOverSPDY(HttpDestination destination, Session session)
33 {
34 super(destination);
35 this.session = session;
36 this.sender = new HttpSenderOverSPDY(this);
37 this.receiver = new HttpReceiverOverSPDY(this);
38 }
39
40 public Session getSession()
41 {
42 return session;
43 }
44
45 public HttpSenderOverSPDY getHttpSender()
46 {
47 return sender;
48 }
49
50 public HttpReceiverOverSPDY getHttpReceiver()
51 {
52 return receiver;
53 }
54
55 @Override
56 public void send()
57 {
58 HttpExchange exchange = getHttpExchange();
59 if (exchange != null)
60 sender.send(exchange);
61 }
62
63 @Override
64 public void proceed(HttpExchange exchange, boolean proceed)
65 {
66 sender.proceed(exchange, proceed);
67 }
68
69 @Override
70 public boolean abort(Throwable cause)
71 {
72 sender.abort(cause);
73 return receiver.abort(cause);
74 }
75 }