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 import io.netty.util.internal.ObjectUtil;
23
24
25
26
27
28 abstract class CompleteChannelFuture extends CompleteFuture<Void> implements ChannelFuture {
29
30 private final Channel channel;
31
32
33
34
35
36
37 protected CompleteChannelFuture(Channel channel, EventExecutor executor) {
38 super(executor);
39 this.channel = ObjectUtil.checkNotNull(channel, "channel");
40 }
41
42 @Override
43 protected EventExecutor executor() {
44 EventExecutor e = super.executor();
45 if (e == null) {
46 return channel().eventLoop();
47 } else {
48 return e;
49 }
50 }
51
52 @Override
53 public ChannelFuture addListener(GenericFutureListener<? extends Future<? super Void>> listener) {
54 super.addListener(listener);
55 return this;
56 }
57
58 @Override
59 public ChannelFuture addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) {
60 super.addListeners(listeners);
61 return this;
62 }
63
64 @Override
65 public ChannelFuture removeListener(GenericFutureListener<? extends Future<? super Void>> listener) {
66 super.removeListener(listener);
67 return this;
68 }
69
70 @Override
71 public ChannelFuture removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) {
72 super.removeListeners(listeners);
73 return this;
74 }
75
76 @Override
77 public ChannelFuture syncUninterruptibly() {
78 return this;
79 }
80
81 @Override
82 public ChannelFuture sync() throws InterruptedException {
83 return this;
84 }
85
86 @Override
87 public ChannelFuture await() throws InterruptedException {
88 return this;
89 }
90
91 @Override
92 public ChannelFuture awaitUninterruptibly() {
93 return this;
94 }
95
96 @Override
97 public Channel channel() {
98 return channel;
99 }
100
101 @Override
102 public Void getNow() {
103 return null;
104 }
105
106 @Override
107 public boolean isVoid() {
108 return false;
109 }
110 }