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