1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package io.netty.handler.codec.http2;
16
17 import static io.netty.util.internal.ObjectUtil.checkNotNull;
18
19
20
21
22 public class DecoratingHttp2ConnectionEncoder extends DecoratingHttp2FrameWriter implements Http2ConnectionEncoder,
23 Http2SettingsReceivedConsumer {
24 private final Http2ConnectionEncoder delegate;
25
26 public DecoratingHttp2ConnectionEncoder(Http2ConnectionEncoder delegate) {
27 super(delegate);
28 this.delegate = checkNotNull(delegate, "delegate");
29 }
30
31 @Override
32 public void lifecycleManager(Http2LifecycleManager lifecycleManager) {
33 delegate.lifecycleManager(lifecycleManager);
34 }
35
36 @Override
37 public Http2Connection connection() {
38 return delegate.connection();
39 }
40
41 @Override
42 public Http2RemoteFlowController flowController() {
43 return delegate.flowController();
44 }
45
46 @Override
47 public Http2FrameWriter frameWriter() {
48 return delegate.frameWriter();
49 }
50
51 @Override
52 public Http2Settings pollSentSettings() {
53 return delegate.pollSentSettings();
54 }
55
56 @Override
57 public void remoteSettings(Http2Settings settings) throws Http2Exception {
58 delegate.remoteSettings(settings);
59 }
60
61 @Override
62 public void consumeReceivedSettings(Http2Settings settings) {
63 if (delegate instanceof Http2SettingsReceivedConsumer) {
64 ((Http2SettingsReceivedConsumer) delegate).consumeReceivedSettings(settings);
65 } else {
66 throw new IllegalStateException("delegate " + delegate + " is not an instance of " +
67 Http2SettingsReceivedConsumer.class);
68 }
69 }
70 }