-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,11 +10,14 @@ | |
*/ | ||
package io.vertx.core.net.endpoint; | ||
|
||
import io.vertx.codegen.annotations.VertxGen; | ||
|
||
/** | ||
* Request interaction with an endpoint, mostly callbacks to gather statistics. | ||
* | ||
* @author <a href="mailto:[email protected]">Julien Viet</a> | ||
*/ | ||
@VertxGen | ||
public interface EndpointInteraction { | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,16 @@ | |
*/ | ||
package io.vertx.core.net.endpoint; | ||
|
||
import io.vertx.codegen.annotations.GenIgnore; | ||
import io.vertx.codegen.annotations.VertxGen; | ||
import io.vertx.core.net.SocketAddress; | ||
|
||
/** | ||
* A physical node of an endpoint. | ||
* | ||
* @author <a href="mailto:[email protected]">Julien Viet</a> | ||
*/ | ||
@VertxGen | ||
public interface EndpointNode { | ||
|
||
/** | ||
|
@@ -37,7 +40,10 @@ public interface EndpointNode { | |
EndpointInteraction newInteraction(); | ||
|
||
// Should be private somehow | ||
@GenIgnore | ||
InteractionMetrics<?> metrics(); | ||
|
||
@GenIgnore | ||
Object unwrap(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
*/ | ||
package io.vertx.core.net.endpoint; | ||
|
||
import io.vertx.codegen.annotations.VertxGen; | ||
import io.vertx.core.Future; | ||
import io.vertx.core.net.Address; | ||
|
||
|
@@ -18,13 +19,14 @@ | |
* | ||
* @author <a href="mailto:[email protected]">Julien Viet</a> | ||
*/ | ||
public interface EndpointResolver<A extends Address> { | ||
@VertxGen | ||
public interface EndpointResolver { | ||
|
||
/** | ||
* Resolver an endpoint for the specified {@code address} | ||
* @param address the address to lookup | ||
* @return the endpoint lookup result | ||
*/ | ||
Future<Endpoint> resolveEndpoint(A address); | ||
Future<Endpoint> resolveEndpoint(Address address); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ | |
* | ||
* @author <a href="mailto:[email protected]">Julien Viet</a> | ||
*/ | ||
public class EndpointResolverImpl<S, A extends Address, E> implements EndpointResolverInternal<A> { | ||
public class EndpointResolverImpl<S, A extends Address, E> implements EndpointResolverInternal { | ||
|
||
private final VertxInternal vertx; | ||
private final LoadBalancer loadBalancer; | ||
|
@@ -67,11 +67,11 @@ public void checkExpired() { | |
} | ||
|
||
@Override | ||
public Future<io.vertx.core.net.endpoint.Endpoint> resolveEndpoint(A address) { | ||
public Future<io.vertx.core.net.endpoint.Endpoint> resolveEndpoint(Address address) { | ||
return lookupEndpoint2(vertx.getOrCreateContext(), address); | ||
} | ||
|
||
public Future<io.vertx.core.net.endpoint.Endpoint> lookupEndpoint(ContextInternal ctx, A address) { | ||
public Future<io.vertx.core.net.endpoint.Endpoint> lookupEndpoint(ContextInternal ctx, Address address) { | ||
return lookupEndpoint2(ctx, address); | ||
} | ||
|
||
|
@@ -116,7 +116,7 @@ public EndpointNode selectNode(String key) { | |
} | ||
} | ||
|
||
private Future<io.vertx.core.net.endpoint.Endpoint> lookupEndpoint2(ContextInternal ctx, A address) { | ||
private Future<io.vertx.core.net.endpoint.Endpoint> lookupEndpoint2(ContextInternal ctx, Address address) { | ||
A casted = endpointResolver.tryCast(address); | ||
if (casted == null) { | ||
return ctx.failedFuture("Cannot resolve address " + address); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters