1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.netty.resolver;
18
19 import io.netty.util.concurrent.EventExecutor;
20 import io.netty.util.concurrent.Promise;
21
22 import java.net.SocketAddress;
23 import java.util.Collections;
24 import java.util.List;
25
26
27
28
29
30 public class NoopAddressResolver extends AbstractAddressResolver<SocketAddress> {
31
32 public NoopAddressResolver(EventExecutor executor) {
33 super(executor);
34 }
35
36 @Override
37 protected boolean doIsResolved(SocketAddress address) {
38 return true;
39 }
40
41 @Override
42 protected void doResolve(SocketAddress unresolvedAddress, Promise<SocketAddress> promise) throws Exception {
43 promise.setSuccess(unresolvedAddress);
44 }
45
46 @Override
47 protected void doResolveAll(
48 SocketAddress unresolvedAddress, Promise<List<SocketAddress>> promise) throws Exception {
49 promise.setSuccess(Collections.singletonList(unresolvedAddress));
50 }
51 }