Package com.arpnetworking.configuration
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 TypeMethodDescriptionvoid
Invoked to apply the most recently offered configuration.void
offerConfiguration
(Configuration configuration) Invoked before new configuration is applied.
-
Method Details
-
offerConfiguration
Invoked before new configuration is applied. Any registered listener may reject the configuration by throwing anException
. Any listener rejecting the configuration rejects the entire configuration and the offering instance will log theException
with an error. Once any listener rejects theConfiguration
other listeners may not be offered that instance.- Parameters:
configuration
- The newConfiguration
to be validated.- Throws:
Exception
- Thrown if theConfiguration
should be rejected.
-
applyConfiguration
void applyConfiguration()Invoked to apply the most recently offered configuration. AnyRuntimeException
thrown is logged and ignored. All validation must be performed during offer.
-