Interface ConfigChangeListener

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ConfigChangeListener
Listener interface for configuration changes. Implementations can react to configuration reloads.

 @Service
 public class MyService {
     @Autowired
     private MyConfig config;
     
     @PostConstruct
     public void init() {
         config.addChangeListener(cfg -> {
             // Handle config reload
             refreshCache();
         });
     }
 }
 
Since:
6.2.0
Author:
wisdomme
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when the configuration is reloaded.
  • Method Details

    • onConfigReload

      void onConfigReload(AbstractConfigEntity config)
      Called when the configuration is reloaded.
      Parameters:
      config - the reloaded configuration object