Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Hot Reloading

Mahmoud Ben Hassine edited this page Jun 8, 2017 · 2 revisions

It is possible to reload configuration at runtime by adding the HotReload annotation on your object:

@HotReload(period = 1, unit = SECONDS)
public class HotReloadableConfig {

    @SystemProperty("size")
    private int size;

    @DBProperty(configuration = "database.properties", key = "name")
    private String name;

    // getters and setters
}

Easy Props will register a background (daemon) thread that will reload the configuration periodically. You can specify the period and the time unit in the attributes of @HotReload annotation.

Note: Hot reloading works for every type of injected properties, not only files.