當前位置: 首頁>>代碼示例>>Java>>正文


Java DeliveryOptions.addHeader方法代碼示例

本文整理匯總了Java中io.vertx.core.eventbus.DeliveryOptions.addHeader方法的典型用法代碼示例。如果您正苦於以下問題:Java DeliveryOptions.addHeader方法的具體用法?Java DeliveryOptions.addHeader怎麽用?Java DeliveryOptions.addHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.vertx.core.eventbus.DeliveryOptions的用法示例。


在下文中一共展示了DeliveryOptions.addHeader方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPortfolio

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void getPortfolio(Handler<AsyncResult<Portfolio>> resultHandler) {
  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", "getPortfolio");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Portfolio(res.result().body())));
                    }
  });
}
 
開發者ID:cescoffier,項目名稱:vertx-kubernetes-workshop,代碼行數:17,代碼來源:PortfolioServiceVertxEBProxy.java

示例2: buy

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) {
  if (closed) {
  resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return;
  }
  JsonObject _json = new JsonObject();
  _json.put("amount", amount);
  _json.put("quote", quote);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "buy");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Portfolio(res.result().body())));
                    }
  });
}
 
開發者ID:cescoffier,項目名稱:vertx-kubernetes-workshop,代碼行數:19,代碼來源:PortfolioServiceVertxEBProxy.java

示例3: sell

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void sell(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) {
  if (closed) {
  resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return;
  }
  JsonObject _json = new JsonObject();
  _json.put("amount", amount);
  _json.put("quote", quote);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "sell");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Portfolio(res.result().body())));
                    }
  });
}
 
開發者ID:cescoffier,項目名稱:vertx-kubernetes-workshop,代碼行數:19,代碼來源:PortfolioServiceVertxEBProxy.java

示例4: evaluate

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void evaluate(Handler<AsyncResult<Double>> resultHandler) {
  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", "evaluate");
  _vertx.eventBus().<Double>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body()));
    }
  });
}
 
開發者ID:cescoffier,項目名稱:vertx-kubernetes-workshop,代碼行數:17,代碼來源:PortfolioServiceVertxEBProxy.java

示例5: createNotification

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public NotificationService createNotification(Handler<AsyncResult<JsonObject>> resultHandler) {
  if (closed) {
    resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return this;
  }
  JsonObject _json = new JsonObject();
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "createNotification");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body()));
    }
  });
  return this;
}
 
開發者ID:pflima92,項目名稱:jspare-vertx-ms-blueprint,代碼行數:18,代碼來源:NotificationServiceVertxEBProxy.java

示例6: send

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public MailService send(MailMessage message, Handler<AsyncResult<MailResult>> resultHandler) {
  if (closed) {
    resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return this;
  }
  JsonObject _json = new JsonObject();
  _json.put("message", message == null ? null : message.toJson());
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "send");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new MailResult(res.result().body())));
                    }
  });
  return this;
}
 
開發者ID:pflima92,項目名稱:jspare-vertx-ms-blueprint,代碼行數:19,代碼來源:MailServiceVertxEBProxy.java

示例7: getConfiguration

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public ConfigurationProvider getConfiguration(String name, Handler<AsyncResult<JsonObject>> resultHandler) {
  if (closed) {
    resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return this;
  }
  JsonObject _json = new JsonObject();
  _json.put("name", name);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "getConfiguration");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body()));
    }
  });
  return this;
}
 
開發者ID:pflima92,項目名稱:jspare-vertx-ms-blueprint,代碼行數:19,代碼來源:ConfigurationProviderVertxEBProxy.java

示例8: retrieveStore

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void retrieveStore(String sellerId, Handler<AsyncResult<Store>> resultHandler) {
  if (closed) {
    resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return;
  }
  JsonObject _json = new JsonObject();
  _json.put("sellerId", sellerId);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "retrieveStore");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Store(res.result().body())));
                    }
  });
}
 
開發者ID:sczyh30,項目名稱:vertx-blueprint-microservice,代碼行數:18,代碼來源:StoreCRUDServiceVertxEBProxy.java

示例9: stop

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public TaskService stop(Long taskId, String userId, Handler<AsyncResult<Void>> handler) {
  if (closed) {
    handler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return this;
  }
  JsonObject _json = new JsonObject();
  _json.put("taskId", taskId);
  _json.put("userId", userId);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "stop");
  _vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      handler.handle(Future.failedFuture(res.cause()));
    } else {
      handler.handle(Future.succeededFuture(res.result().body()));
    }
  });
  return this;
}
 
開發者ID:diabolicallabs,項目名稱:vertx-process-manager,代碼行數:20,代碼來源:TaskServiceVertxEBProxy.java

示例10: delete

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public RuleService delete(String factHandle, Handler<AsyncResult<Void>> handler) {
  if (closed) {
    handler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return this;
  }
  JsonObject _json = new JsonObject();
  _json.put("factHandle", factHandle);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "delete");
  _vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      handler.handle(Future.failedFuture(res.cause()));
    } else {
      handler.handle(Future.succeededFuture(res.result().body()));
    }
  });
  return this;
}
 
開發者ID:diabolicallabs,項目名稱:vertx-process-manager,代碼行數:19,代碼來源:RuleServiceVertxEBProxy.java

示例11: query

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void query(String graphqlQuery, Handler<AsyncResult<QueryResult>> resultHandler) {
  if (closed) {
    resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return;
  }
  JsonObject _json = new JsonObject();
  _json.put("graphqlQuery", graphqlQuery);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "query");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new QueryResult(res.result().body())));
                    }
  });
}
 
開發者ID:engagingspaces,項目名稱:vertx-graphql-service-discovery,代碼行數:18,代碼來源:QueryableVertxEBProxy.java

示例12: deleteAllAccounts

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public AccountService deleteAllAccounts(Handler<AsyncResult<Void>> resultHandler) {
  if (closed) {
    resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return this;
  }
  JsonObject _json = new JsonObject();
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "deleteAllAccounts");
  _vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body()));
    }
  });
  return this;
}
 
開發者ID:sczyh30,項目名稱:vertx-blueprint-microservice,代碼行數:18,代碼來源:AccountServiceVertxEBProxy.java

示例13: buy

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) {
  if (closed) {
    resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return;
  }
  JsonObject _json = new JsonObject();
  _json.put("amount", amount);
  _json.put("quote", quote);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "buy");
  _vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Portfolio(res.result().body())));
                    }
  });
}
 
開發者ID:cescoffier,項目名稱:vertx-microservices-workshop,代碼行數:19,代碼來源:PortfolioServiceVertxEBProxy.java

示例14: initializePersistence

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public ProductService initializePersistence(Handler<AsyncResult<Void>> resultHandler) {
  if (closed) {
    resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return this;
  }
  JsonObject _json = new JsonObject();
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "initializePersistence");
  _vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      resultHandler.handle(Future.failedFuture(res.cause()));
    } else {
      resultHandler.handle(Future.succeededFuture(res.result().body()));
    }
  });
  return this;
}
 
開發者ID:sczyh30,項目名稱:vertx-blueprint-microservice,代碼行數:18,代碼來源:ProductServiceVertxEBProxy.java

示例15: resume

import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public TaskService resume(Long taskId, String userId, Handler<AsyncResult<Void>> handler) {
  if (closed) {
    handler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
    return this;
  }
  JsonObject _json = new JsonObject();
  _json.put("taskId", taskId);
  _json.put("userId", userId);
  DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
  _deliveryOptions.addHeader("action", "resume");
  _vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
    if (res.failed()) {
      handler.handle(Future.failedFuture(res.cause()));
    } else {
      handler.handle(Future.succeededFuture(res.result().body()));
    }
  });
  return this;
}
 
開發者ID:diabolicallabs,項目名稱:vertx-process-manager,代碼行數:20,代碼來源:TaskServiceVertxEBProxy.java


注:本文中的io.vertx.core.eventbus.DeliveryOptions.addHeader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。