public interface ConfigRetriever
ConfigStore
and tracks changes periodically.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the retriever.
|
ReadStream<JsonObject> |
configStream() |
static ConfigRetriever |
create(Vertx vertx)
Creates an instance of the default implementation of the
ConfigRetriever, using the default
settings (json file, system properties and environment variables). |
static ConfigRetriever |
create(Vertx vertx,
ConfigRetrieverOptions options)
Creates an instance of the default implementation of the
ConfigRetriever. |
JsonObject |
getCachedConfig()
Gets the last computed configuration.
|
void |
getConfig(Handler<AsyncResult<JsonObject>> completionHandler)
Reads the configuration from the different
ConfigStore
and computes the final configuration. |
static Future<JsonObject> |
getConfigAsFuture(ConfigRetriever retriever)
Same as
getConfig(Handler), but returning a Future object. |
void |
listen(Handler<ConfigChange> listener)
Registers a listener receiving configuration changes.
|
static ConfigRetriever create(Vertx vertx, ConfigRetrieverOptions options)
ConfigRetriever.vertx - the vert.x instanceoptions - the options, must not be null, must contain the list of configured store.static ConfigRetriever create(Vertx vertx)
ConfigRetriever, using the default
settings (json file, system properties and environment variables).vertx - the vert.x instancestatic Future<JsonObject> getConfigAsFuture(ConfigRetriever retriever)
retriever - the config retrievevoid getConfig(Handler<AsyncResult<JsonObject>> completionHandler)
ConfigStore
and computes the final configuration.completionHandler - handler receiving the computed configuration, or a failure if the
configuration cannot be retrievedvoid close()
JsonObject getCachedConfig()
void listen(Handler<ConfigChange> listener)
listener - the listenerReadStream<JsonObject> configStream()
Copyright © 2018 Eclipse. All rights reserved.