Class AutoRegistration

  • All Implemented Interfaces:
    io.micronaut.context.event.ApplicationEventListener<AbstractServiceInstanceEvent>, java.util.EventListener

    public abstract class AutoRegistration
    extends java.lang.Object
    implements io.micronaut.context.event.ApplicationEventListener<AbstractServiceInstanceEvent>
    A base class for classes that automatically register the server with discovery services.
    Since:
    1.0
    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • registered

        protected final java.util.concurrent.atomic.AtomicBoolean registered
    • Constructor Detail

      • AutoRegistration

        protected AutoRegistration​(RegistrationConfiguration registrationConfiguration)
        Initialize given configurations.
        Parameters:
        registrationConfiguration - Common configurations for registration
    • Method Detail

      • pulsate

        protected abstract void pulsate​(ServiceInstance instance,
                                        HealthStatus status)
        This method will be invoked each time a HeartbeatEvent occurs allowing the implementation to perform any necessary callbacks to the service discovery server.
        Parameters:
        instance - The instance
        status - The HealthStatus
      • validateApplicationName

        protected void validateApplicationName​(java.lang.String name)
        Validate the given application name.
        Parameters:
        name - The application name
      • validateName

        protected void validateName​(java.lang.String name,
                                    java.lang.String typeDescription)
        Validate the given application name.
        Parameters:
        name - The application name
        typeDescription - The detailed information about name