Class ConfigRetriever
java.lang.Object
io.vertx.reactivex.config.ConfigRetriever
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclose()Closes the retriever.static ConfigRetrieverCreates an instance of the default implementation of theConfigRetriever, using the default settings (json file, system properties and environment variables).static ConfigRetrievercreate(Vertx vertx, ConfigRetrieverOptions options) Creates an instance of the default implementation of theConfigRetriever.booleanGets the last computed configuration.Reads the configuration from the different and computes the final configuration.inthashCode()voidlisten(Handler<ConfigChange> listener) Registers a listener receiving configuration changes.static ConfigRetrieverrxClose()Closes the retriever.Reads the configuration from the different and computes the final configuration.setBeforeScanHandler(Handler<Void> handler) Registers a handler called before every scan.setConfigurationProcessor(Function<JsonObject, JsonObject> processor) Registers a handler that process the configuration before being injected into orlisten(Handler).toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
ConfigRetriever
-
ConfigRetriever
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
create
Creates an instance of the default implementation of theConfigRetriever.- Parameters:
vertx- the vert.x instanceoptions- the options, must not benull, must contain the list of configured store.- Returns:
- the created instance.
-
create
Creates an instance of the default implementation of theConfigRetriever, using the default settings (json file, system properties and environment variables).- Parameters:
vertx- the vert.x instance- Returns:
- the created instance.
-
getConfig
Reads the configuration from the different and computes the final configuration.- Returns:
- a future notified the computed configuration, or a failure if the configuration cannot be retrieved
-
rxGetConfig
Reads the configuration from the different and computes the final configuration.- Returns:
- a future notified the computed configuration, or a failure if the configuration cannot be retrieved
-
close
-
rxClose
-
getCachedConfig
Gets the last computed configuration.- Returns:
- the last configuration
-
listen
Registers a listener receiving configuration changes. This method cannot only be called if the configuration is broadcasted.- Parameters:
listener- the listener
-
setBeforeScanHandler
Registers a handler called before every scan. This method is mostly used for logging purpose.- Parameters:
handler- the handler, must not benull- Returns:
- the current config retriever
-
setConfigurationProcessor
Registers a handler that process the configuration before being injected into orlisten(Handler). This allows the code to customize the configuration.- Parameters:
processor- the processor, must not benull. The method must not returnnull. The returned configuration is used. If the processor does not update the configuration, it must return the input configuration. If the processor throws an exception, the failure is passed to the handler.- Returns:
- the current config retriever
-
configStream
- Returns:
- the stream of configurations. It's single stream (unicast) and that delivers the last known config and the successors periodically.
-
newInstance
-