1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.channel;
17
18 import io.netty.util.concurrent.CompleteFuture;
19 import io.netty.util.concurrent.EventExecutor;
20 import io.netty.util.concurrent.Future;
21 import io.netty.util.concurrent.GenericFutureListener;
22
23
24
25
26
27 abstract class CompleteChannelFuture extends CompleteFuture<Void> implements ChannelFuture {
28
29 private final Channel channel;
30
31
32
33
34
35
36 protected CompleteChannelFuture(Channel channel, EventExecutor executor) {
37 super(executor);
38 if (channel == null) {
39 throw new NullPointerException("channel");
40 }
41 this.channel = channel;
42 }
43
44 @Override
45 protected EventExecutor executor() {
46 EventExecutor e = super.executor();
47 if (e == null) {
48 return channel().eventLoop();
49 } else {
50 return e;
51 }
52 }
53
54 @Override
55 public ChannelFuture addListener(GenericFutureListener<? extends Future<? super Void>> listener) {
56 super.addListener(listener);
57 return this;
58 }
59
60 @Override
61 public ChannelFuture addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) {
62 super.addListeners(listeners);
63 return this;
64 }
65
66 @Override
67 public ChannelFuture removeListener(GenericFutureListener<? extends Future<? super Void>> listener) {
68 super.removeListener(listener);
69 return this;
70 }
71
72 @Override
73 public ChannelFuture removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) {
74 super.removeListeners(listeners);
75 return this;
76 }
77
78 @Override
79 public ChannelFuture syncUninterruptibly() {
80 return this;
81 }
82
83 @Override
84 public ChannelFuture sync() throws InterruptedException {
85 return this;
86 }
87
88 @Override
89 public ChannelFuture await() throws InterruptedException {
90 return this;
91 }
92
93 @Override
94 public ChannelFuture awaitUninterruptibly() {
95 return this;
96 }
97
98 @Override
99 public Channel channel() {
100 return channel;
101 }
102
103 @Override
104 public Void getNow() {
105 return null;
106 }
107 }