public <T> void getServiceProxy(Function<Record, Boolean> filter, Class<T> serviceClass, Handler<AsyncResult<T>> handler) { EventBusService.getServiceProxy(serviceDiscovery, filter, serviceClass, handler); }
public static <T>java.lang.Object getServiceProxy(io.vertx.servicediscovery.types.EventBusService j_receiver, io.vertx.servicediscovery.ServiceDiscovery discovery, java.util.function.Function<java.util.Map<String, Object>, java.lang.Boolean> filter, java.lang.Class<java.lang.Object> clientClass, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Object>> resultHandler) { return io.vertx.core.impl.ConversionHelper.fromObject(io.vertx.servicediscovery.types.EventBusService.getServiceProxy(discovery, filter != null ? new java.util.function.Function<io.vertx.servicediscovery.Record, java.lang.Boolean>() { public java.lang.Boolean apply(io.vertx.servicediscovery.Record t) { java.util.Map<String, Object> o = t != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(t.toJson()) : null; java.lang.Boolean p = filter.apply(o); return p; } } : null, clientClass, resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Object>>() { public void handle(io.vertx.core.AsyncResult<java.lang.Object> ar) { resultHandler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromObject(event))); } } : null)); } public static <T>java.lang.Object getServiceProxyWithJsonFilter(io.vertx.servicediscovery.types.EventBusService j_receiver, io.vertx.servicediscovery.ServiceDiscovery discovery, java.util.Map<String, Object> filter, java.lang.Class<java.lang.Object> clientClass, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Object>> resultHandler) {
private Future<PortfolioService> getPortfolioService(ServiceDiscovery discovery) { Future<PortfolioService> future = Future.future(); EventBusService.getServiceProxy(discovery, rec -> rec.getName().equalsIgnoreCase("portfolio"), PortfolioService.class, future); return future; }
/** * Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). * This is a convenient method to avoid explicit lookup and then retrieval of the service. This method requires to * have the <code>clientClass</code> set with the expected set of client. This is important for usages not using Java so * you can pass the expected type. * @param discovery the service discovery * @param filter the filter * @param clientClass the client class * @param resultHandler the result handler * @return <code>null</code> - do not use */ public static <T> T getServiceProxy(io.vertx.rxjava.servicediscovery.ServiceDiscovery discovery, Function<Record, Boolean> filter, Class<T> clientClass, Handler<AsyncResult<T>> resultHandler) { T ret = (T)io.vertx.lang.rx.TypeArg.of(clientClass).wrap(io.vertx.servicediscovery.types.EventBusService.getServiceProxy(discovery.getDelegate(), filter, io.vertx.lang.rxjava.Helper.unwrap(clientClass), new Handler<AsyncResult<T>>() { public void handle(AsyncResult<T> ar) { if (ar.succeeded()) { resultHandler.handle(io.vertx.core.Future.succeededFuture((T)io.vertx.lang.rx.TypeArg.of(clientClass).wrap(ar.result()))); } else { resultHandler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } })); return ret; }
/** * Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). * This is a convenient method to avoid explicit lookup and then retrieval of the service. This method requires to * have the <code>clientClass</code> set with the expected set of client. This is important for usages not using Java so * you can pass the expected type. * @param discovery the service discovery * @param filter the filter * @param clientClass the client class * @param resultHandler the result handler * @return <code>null</code> - do not use */ public static <T> T getServiceProxy(io.vertx.rxjava.servicediscovery.ServiceDiscovery discovery, Function<Record, Boolean> filter, Class<T> clientClass, Handler<AsyncResult<T>> resultHandler) { T ret = (T)io.vertx.lang.rx.TypeArg.of(clientClass).wrap(io.vertx.servicediscovery.types.EventBusService.getServiceProxy(discovery.getDelegate(), filter, io.vertx.lang.rxjava.Helper.unwrap(clientClass), new Handler<AsyncResult<T>>() { public void handle(AsyncResult<T> ar) { if (ar.succeeded()) { resultHandler.handle(io.vertx.core.Future.succeededFuture((T)io.vertx.lang.rx.TypeArg.of(clientClass).wrap(ar.result()))); } else { resultHandler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } })); return ret; }
EventBusService.getServiceProxy(discovery, record -> record.getName().equalsIgnoreCase("my-service"), HelloService.class,
EventBusService.getServiceProxy(discovery, record -> record.getName().equalsIgnoreCase("my-service"), HelloService.class,