Class ActorConfigurator<T>

java.lang.Object
com.arpnetworking.utility.ActorConfigurator<T>
Type Parameters:
T - The type representing the validated configuration.
All Implemented Interfaces:
Listener

public class ActorConfigurator<T> extends Object implements Listener
A launchable intended to be used from a Configurator to notify an actor about new configuration.
Author:
Brandon Arp (brandon dot arp at inscopemetrics dot com)
  • Constructor Details

    • ActorConfigurator

      public ActorConfigurator(org.apache.pekko.actor.ActorRef notifyTarget, Class<? extends T> configurationClass)
      Public constructor.
      Parameters:
      notifyTarget - actor to notify of configuration update
      configurationClass - the class of the configuration
  • Method Details

    • offerConfiguration

      public void offerConfiguration(Configuration configuration) throws Exception
      Description copied from interface: Listener
      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.
      Specified by:
      offerConfiguration in interface Listener
      Parameters:
      configuration - The new Configuration to be validated.
      Throws:
      Exception - Thrown if the Configuration should be rejected.
    • applyConfiguration

      public void applyConfiguration()
      Description copied from interface: Listener
      Invoked to apply the most recently offered configuration. Any RuntimeException thrown is logged and ignored. All validation must be performed during offer.
      Specified by:
      applyConfiguration in interface Listener