Skip to content

Commit 56e2b1e

Browse files
committed
Update endpoint API with @VertxGen
1 parent e09909b commit 56e2b1e

File tree

8 files changed

+25
-11
lines changed

8 files changed

+25
-11
lines changed

src/main/java/io/vertx/core/http/impl/HttpClientBuilderInternal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public HttpClientAgent build() {
9595
CloseFuture cf = resolveCloseFuture();
9696
HttpClientAgent client;
9797
Closeable closeable;
98-
EndpointResolver<?> resolver = endpointResolver(co);
98+
EndpointResolver resolver = endpointResolver(co);
9999
if (co.isShared()) {
100100
CloseFuture closeFuture = new CloseFuture();
101101
client = vertx.createSharedResource("__vertx.shared.httpClients", co.getName(), closeFuture, cf_ -> {

src/main/java/io/vertx/core/http/impl/HttpClientImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ public class HttpClientImpl extends HttpClientBase implements HttpClientInternal
102102

103103
private final PoolOptions poolOptions;
104104
private final io.vertx.core.net.impl.endpoint.EndpointManager<EndpointKey, SharedClientHttpStreamEndpoint> httpCM;
105-
private final EndpointResolverInternal<Address> endpointResolver;
105+
private final EndpointResolverInternal endpointResolver;
106106
private volatile Function<HttpClientResponse, Future<RequestOptions>> redirectHandler = DEFAULT_HANDLER;
107107
private long timerID;
108108
private volatile Handler<HttpConnection> connectionHandler;
109109
private final Function<ContextInternal, ContextInternal> contextProvider;
110110

111111
public HttpClientImpl(VertxInternal vertx,
112-
EndpointResolver<?> endpointResolver,
112+
EndpointResolver endpointResolver,
113113
HttpClientOptions options,
114114
PoolOptions poolOptions) {
115115
super(vertx, options);

src/main/java/io/vertx/core/net/endpoint/Endpoint.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
*/
1111
package io.vertx.core.net.endpoint;
1212

13+
import io.vertx.codegen.annotations.VertxGen;
14+
1315
import java.util.List;
1416

17+
@VertxGen
1518
public interface Endpoint {
1619

1720
/**

src/main/java/io/vertx/core/net/endpoint/EndpointInteraction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
*/
1111
package io.vertx.core.net.endpoint;
1212

13+
import io.vertx.codegen.annotations.VertxGen;
14+
1315
/**
1416
* Request interaction with an endpoint, mostly callbacks to gather statistics.
1517
*
1618
* @author <a href="mailto:[email protected]">Julien Viet</a>
1719
*/
20+
@VertxGen
1821
public interface EndpointInteraction {
1922

2023
/**

src/main/java/io/vertx/core/net/endpoint/EndpointNode.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010
*/
1111
package io.vertx.core.net.endpoint;
1212

13+
import io.vertx.codegen.annotations.GenIgnore;
14+
import io.vertx.codegen.annotations.VertxGen;
1315
import io.vertx.core.net.SocketAddress;
1416

1517
/**
1618
* A physical node of an endpoint.
1719
*
1820
* @author <a href="mailto:[email protected]">Julien Viet</a>
1921
*/
22+
@VertxGen
2023
public interface EndpointNode {
2124

2225
/**
@@ -37,7 +40,10 @@ public interface EndpointNode {
3740
EndpointInteraction newInteraction();
3841

3942
// Should be private somehow
43+
@GenIgnore
4044
InteractionMetrics<?> metrics();
45+
46+
@GenIgnore
4147
Object unwrap();
4248

4349
}

src/main/java/io/vertx/core/net/endpoint/EndpointResolver.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111
package io.vertx.core.net.endpoint;
1212

13+
import io.vertx.codegen.annotations.VertxGen;
1314
import io.vertx.core.Future;
1415
import io.vertx.core.net.Address;
1516

@@ -18,13 +19,14 @@
1819
*
1920
* @author <a href="mailto:[email protected]">Julien Viet</a>
2021
*/
21-
public interface EndpointResolver<A extends Address> {
22+
@VertxGen
23+
public interface EndpointResolver {
2224

2325
/**
2426
* Resolver an endpoint for the specified {@code address}
2527
* @param address the address to lookup
2628
* @return the endpoint lookup result
2729
*/
28-
Future<Endpoint> resolveEndpoint(A address);
30+
Future<Endpoint> resolveEndpoint(Address address);
2931

3032
}

src/main/java/io/vertx/core/net/endpoint/impl/EndpointResolverImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* @author <a href="mailto:[email protected]">Julien Viet</a>
4040
*/
41-
public class EndpointResolverImpl<S, A extends Address, E> implements EndpointResolverInternal<A> {
41+
public class EndpointResolverImpl<S, A extends Address, E> implements EndpointResolverInternal {
4242

4343
private final VertxInternal vertx;
4444
private final LoadBalancer loadBalancer;
@@ -67,11 +67,11 @@ public void checkExpired() {
6767
}
6868

6969
@Override
70-
public Future<io.vertx.core.net.endpoint.Endpoint> resolveEndpoint(A address) {
70+
public Future<io.vertx.core.net.endpoint.Endpoint> resolveEndpoint(Address address) {
7171
return lookupEndpoint2(vertx.getOrCreateContext(), address);
7272
}
7373

74-
public Future<io.vertx.core.net.endpoint.Endpoint> lookupEndpoint(ContextInternal ctx, A address) {
74+
public Future<io.vertx.core.net.endpoint.Endpoint> lookupEndpoint(ContextInternal ctx, Address address) {
7575
return lookupEndpoint2(ctx, address);
7676
}
7777

@@ -116,7 +116,7 @@ public EndpointNode selectNode(String key) {
116116
}
117117
}
118118

119-
private Future<io.vertx.core.net.endpoint.Endpoint> lookupEndpoint2(ContextInternal ctx, A address) {
119+
private Future<io.vertx.core.net.endpoint.Endpoint> lookupEndpoint2(ContextInternal ctx, Address address) {
120120
A casted = endpointResolver.tryCast(address);
121121
if (casted == null) {
122122
return ctx.failedFuture("Cannot resolve address " + address);

src/main/java/io/vertx/core/net/endpoint/impl/EndpointResolverInternal.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import io.vertx.core.net.endpoint.Endpoint;
77
import io.vertx.core.net.endpoint.EndpointResolver;
88

9-
public interface EndpointResolverInternal<A extends Address> extends EndpointResolver<A> {
9+
public interface EndpointResolverInternal extends EndpointResolver {
1010

11-
Future<Endpoint> lookupEndpoint(ContextInternal ctx, A address);
11+
Future<Endpoint> lookupEndpoint(ContextInternal ctx, Address address);
1212

1313
/**
1414
* Check expired endpoints, this method is called by the client periodically to give the opportunity to trigger eviction

0 commit comments

Comments
 (0)