public <T extends Queryable> MessageConsumer<JsonObject> registerServiceConsumer(String address, T implementation) { MessageConsumer<JsonObject> serviceConsumer; if (!messageConsumers.containsKey(address)) { serviceConsumer = ProxyHelper.registerService(Queryable.class, vertx, implementation, address); messageConsumers.put(address, serviceConsumer); } else { serviceConsumer = messageConsumers.get(address); } consumerRegistrations.add(address); return serviceConsumer; }
/** * Create a proxy to a service that is deployed somewhere on the event bus * * @param vertx the Vert.x instance * @param address the address the service is listening on on the event bus * @return the service */ static MongoService createEventBusProxy(Vertx vertx, String address) { return ProxyHelper.createProxy(MongoService.class, vertx, address); }
/** * Unregisters the message consumer of the {@link Queryable} * service proxy implementation. * <p> * You do not have to invoke it yourself, if you are using the * {@link GraphQLService}, or the schema publisher * and consumer interfaces. */ public void unregisterServiceProxy() { if (serviceConsumer != null) { ProxyHelper.unregisterService(serviceConsumer); } }
ProxyHelper.registerService(HelloWorldServiceInterface.class, vertx, helloWorldService, HELLO_WORLD_SERVICE); helloWorldServiceInterface = ProxyHelper.createProxy(HelloWorldServiceInterface.class, vertx, HELLO_WORLD_SERVICE);
public void start(Vertx vertx, String address) { service = ProxyHelper.registerService(HelloService.class, vertx, this, address); }
/** * create a proxy of MailService that delegates to the mail service running somewhere else via the event bus * * @param vertx the Vertx instance the proxy will be run in * @param address the eb address of the mail service running somewhere, default is "vertx.mail" * @return MailService instance that can then be used to send multiple mails */ static MailService createEventBusProxy(Vertx vertx, String address) { return ProxyHelper.createProxy(MailService.class, vertx, address); }
@Override public void stop() throws Exception { if (messageConsumer != null) { ProxyHelper.unregisterService(messageConsumer); } service.close(); } }
public void start(Vertx vertx, String address) { service = ProxyHelper.registerService(HelloService.class, vertx, this, address); }
/** * Create an event bus proxy to a service which lives somewhere on the network and is listening on the specified * event bus address * * @param vertx the Vert.x instance * @param address the address on the event bus where the service is listening * @return */ static AsyncSqlService createEventBusProxy(Vertx vertx, String address) { return ProxyHelper.createProxy(AsyncSqlService.class, vertx, address); }
public void stop() { ProxyHelper.unregisterService(service); }
public void start(Vertx vertx, String address) { service = ProxyHelper.registerService(HelloService.class, vertx, this, address); }
/** * Factory method for creating a {@link JobService} service proxy. * This is useful for doing RPCs. * * @param vertx Vertx instance * @param address event bus address of RPC * @return the new {@link JobService} service proxy */ static JobService createProxy(Vertx vertx, String address) { return ProxyHelper.createProxy(JobService.class, vertx, address); }
public void stop() { ProxyHelper.unregisterService(service); }
public void start(Vertx vertx, String address) { service = ProxyHelper.registerService(HelloService.class, vertx, this, address); }
/** * Create a proxy to a service that is deployed somewhere on the event bus * * @param vertx the Vert.x instance * @param address the address the service is listening on on the event bus * @return the service */ static ConsulService createEventBusProxy(Vertx vertx, String address) { return ProxyHelper.createProxy(ConsulService.class, vertx, address); }
public void stop() { ProxyHelper.unregisterService(service); }
public void start(Vertx vertx, String address) { service = ProxyHelper.registerService(HelloService.class, vertx, this, address); }
/** * The method used to create proxy to consume the service. * * @param vertx vert.x * @param address the address where the service is served * @return the proxy */ static RecommendationService createProxy(Vertx vertx, String address) { return ProxyHelper.createProxy(RecommendationService.class, vertx, address); }
public void stop() { ProxyHelper.unregisterService(service); }
public void start(Vertx vertx, String address) { service = ProxyHelper.registerService(HelloService.class, vertx, this, address); }