Interface Listener

All Known Implementing Classes:
Configurator, Reconfigurator

public interface Listener
Interface for consumers registered for configuration events.
Author:
Ville Koskela (ville dot koskela at inscopemetrics dot io)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoked to apply the most recently offered configuration.
    void
    Invoked before new configuration is applied.
  • Method Details

    • offerConfiguration

      void offerConfiguration(Configuration configuration) throws Exception
      Invoked before new configuration is applied. Any registered listener may reject the configuration by throwing an Exception. Any listener rejecting the configuration rejects the entire configuration and the offering instance will log the Exception with an error. Once any listener rejects the Configuration other listeners may not be offered that instance.
      Parameters:
      configuration - The new Configuration to be validated.
      Throws:
      Exception - Thrown if the Configuration should be rejected.
    • applyConfiguration

      void applyConfiguration()
      Invoked to apply the most recently offered configuration. Any RuntimeException thrown is logged and ignored. All validation must be performed during offer.