YourService
class:YourService
is 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:JsonNode
instance to the YourService
with all the data. By the way, you can always implement your own translator and provide it with such call:YourService
is actually is - interface or class.YourServiceImpl
class, which has a YourServiceImpl(JsonNode)
constructor. Then it's as easy as:@ServiceFactory
annotation, which will tell Ressor to always use it.build()
call assembles the special proxy class, inherits it from YourService
and performs the initial load from the provided source. You are ready to use yourServiceInstance
everywhere you need.https://api.example.com/prices.yaml
are being updated quite regularly. YourService
instance will be created. Under the hood, the yourServiceInstance
will switch to use it, completely transparently for you. So, eventually, you will start using the new data with the same instance.