本文整理了Java中io.vertx.serviceproxy.ProxyHelper.createProxy()
方法的一些代码示例,展示了ProxyHelper.createProxy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProxyHelper.createProxy()
方法的具体详情如下:
包路径:io.vertx.serviceproxy.ProxyHelper
类名称:ProxyHelper
方法名:createProxy
暂无
代码示例来源:origin: io.vertx/vertx-consul-service
/**
* 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);
}
代码示例来源:origin: io.vertx/vertx-mongo-service
/**
* 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);
}
代码示例来源:origin: sczyh30/vertx-kue
/**
* 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);
}
代码示例来源:origin: io.vertx/vertx-mail-service
/**
* 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);
}
代码示例来源:origin: io.vertx/vertx-mysql-postgresql-service
/**
* 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);
}
代码示例来源:origin: advantageous/vertx-node-ec2-eventbus-example
static HelloWorldServiceInterface createProxy(final Vertx vertx,
final String address) {
return ProxyHelper.createProxy(HelloWorldServiceInterface.class, vertx, address);
}
代码示例来源:origin: cescoffier/vertx-workshop
/**
* 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);
}
代码示例来源:origin: cescoffier/vertx-workshop
/**
* Method called to create a proxy (to consume the service).
*
* @param vertx vert.x
* @param address the address on the vent bus where the service is served.
* @return the proxy on the {@link DataStorageService}
*/
static DataStorageService createProxy(Vertx vertx, String address) {
return ProxyHelper.createProxy(DataStorageService.class, vertx, address);
}
代码示例来源:origin: ef-labs/vertx-elasticsearch-service
static ElasticSearchService createEventBusProxy(Vertx vertx, String address) {
return ProxyHelper.createProxy(ElasticSearchService.class, vertx, address);
}
代码示例来源:origin: ef-labs/vertx-elasticsearch-service
static ElasticSearchAdminService createEventBusProxy(Vertx vertx, String address) {
return ProxyHelper.createProxy(ElasticSearchAdminService.class, vertx, address);
}
代码示例来源:origin: vert-x3/vertx-service-proxy
static Service createProxy(Vertx vertx, String address) {
return ProxyHelper.createProxy(Service.class, vertx, address);
}
代码示例来源:origin: engagingspaces/vertx-graphql-service-discovery
/**
* Creates a service proxy to the {@link Queryable} implementation
* at the specified address.
*
* The {@link DeliveryOptions} to use on the returned message consumer must be passed as
* plain json, because it does not provide a toJson() method (see:vhttps://github.com/eclipse/vert.x/issues/1502).
*
* @param vertx the vert.x instance
* @param address the address of the service proxy
* @param deliveryOptions the delivery options to use on the message consumer
* @return the graphql service proxy
*/
static Queryable createProxy(Vertx vertx, String address, JsonObject deliveryOptions) {
return ProxyHelper.createProxy(Queryable.class, vertx, address, new DeliveryOptions(deliveryOptions));
}
代码示例来源:origin: io.vertx/vertx-mysql-postgresql-service
public void getConnection(Handler
if (closed) {
handler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
DeliveryOptions _deliveryOptiOns= new DeliveryOptions();
_deliveryOptions.addHeader("action", "getConnection");
_vertx.eventBus().
if (res.failed()) {
handler.handle(Future.failedFuture(res.cause()));
} else {
String addr = res.result().headers().get("proxyaddr");
handler.handle(Future.succeededFuture(ProxyHelper.createProxy(SqlConnection.class, _vertx, addr)));
}
});
}
代码示例来源:origin: weld/weld-vertx
/**
*
* @param vertx
* @param executor
* @param serviceInterface
* @param address
*/
ServiceProxyInvocationHandler(ServiceProxySupport serviceProxySupport, Class> serviceInterface, String address) {
this.executor = serviceProxySupport.getExecutor();
DeliveryOptions deliveryOptiOns= serviceProxySupport.getDefaultDeliveryOptions(serviceInterface);
if (deliveryOptions != null) {
this.delegate = ProxyHelper.createProxy(serviceInterface, serviceProxySupport.getVertx(), address, deliveryOptions);
} else {
this.delegate = ProxyHelper.createProxy(serviceInterface, serviceProxySupport.getVertx(), address);
}
this.handlerParamPositiOnCache= new ConcurrentHashMap<>();
}
代码示例来源:origin: vert-x3/vertx-service-proxy
@Override
public void createConnectionWithCloseFuture(Handler
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
DeliveryOptions _deliveryOptiOns= (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "createConnectionWithCloseFuture");
_vertx.eventBus().
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
String addr = res.result().headers().get("proxyaddr");
resultHandler.handle(Future.succeededFuture(ProxyHelper.createProxy(TestConnectionWithCloseFuture.class, _vertx, addr)));
}
});
}
@Override
代码示例来源:origin: vert-x3/vertx-service-proxy
@Override
public void createConnection(String str, Handler
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
_json.put("str", str);
DeliveryOptions _deliveryOptiOns= (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "createConnection");
_vertx.eventBus().
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
String addr = res.result().headers().get("proxyaddr");
resultHandler.handle(Future.succeededFuture(ProxyHelper.createProxy(TestConnection.class, _vertx, addr)));
}
});
}
@Override
代码示例来源:origin: advantageous/vertx-node-ec2-eventbus-example
helloWorldServiceInterface = ProxyHelper.createProxy(HelloWorldServiceInterface.class, vertx,
HELLO_WORLD_SERVICE);