YourServiceis built from YAML formatted source. What is meant by 'built' is depends on the context and will be covered below. We define the desired source format:
JsonNodeinstance to the
YourServicewith all the data. By the way, you can always implement your own translator and provide it with such call:
YourServiceis actually is - interface or class.
YourServiceImplclass, which has a
YourServiceImpl(JsonNode)constructor. Then it's as easy as:
@ServiceFactoryannotation, which will tell Ressor to always use it.
build()call assembles the special proxy class, inherits it from
YourServiceand performs the initial load from the provided source. You are ready to use
yourServiceInstanceeverywhere you need.
https://api.example.com/prices.yamlare being updated quite regularly.
YourServiceinstance will be created. Under the hood, the
yourServiceInstancewill switch to use it, completely transparently for you. So, eventually, you will start using the new data with the same instance.