View Javadoc
1   /*
2    * Copyright 2015 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License, version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License. You may obtain a
6    * copy of the License at:
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software distributed under the License
11   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing permissions and limitations under
13   * the License.
14   */
15  package io.netty.handler.codec.http2;
16  
17  import static io.netty.util.internal.ObjectUtil.checkNotNull;
18  
19  import io.netty.buffer.ByteBuf;
20  import io.netty.channel.ChannelHandlerContext;
21  import io.netty.util.internal.UnstableApi;
22  
23  import java.util.List;
24  
25  /**
26   * Decorator around another {@link Http2ConnectionDecoder} instance.
27   */
28  @UnstableApi
29  public class DecoratingHttp2ConnectionDecoder implements Http2ConnectionDecoder {
30      private final Http2ConnectionDecoder delegate;
31  
32      public DecoratingHttp2ConnectionDecoder(Http2ConnectionDecoder delegate) {
33          this.delegate = checkNotNull(delegate, "delegate");
34      }
35  
36      @Override
37      public void lifecycleManager(Http2LifecycleManager lifecycleManager) {
38          delegate.lifecycleManager(lifecycleManager);
39      }
40  
41      @Override
42      public Http2Connection connection() {
43          return delegate.connection();
44      }
45  
46      @Override
47      public Http2LocalFlowController flowController() {
48          return delegate.flowController();
49      }
50  
51      @Override
52      public void frameListener(Http2FrameListener listener) {
53          delegate.frameListener(listener);
54      }
55  
56      @Override
57      public Http2FrameListener frameListener() {
58          return delegate.frameListener();
59      }
60  
61      @Override
62      public void decodeFrame(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Http2Exception {
63          delegate.decodeFrame(ctx, in, out);
64      }
65  
66      @Override
67      public Http2Settings localSettings() {
68          return delegate.localSettings();
69      }
70  
71      @Override
72      public boolean prefaceReceived() {
73          return delegate.prefaceReceived();
74      }
75  
76      @Override
77      public void close() {
78          delegate.close();
79      }
80  }