Class AutoRegistration
java.lang.Object
io.micronaut.discovery.registration.AutoRegistration
- All Implemented Interfaces:
ApplicationEventListener<AbstractServiceInstanceEvent>,EventListener
public abstract class AutoRegistration
extends Object
implements ApplicationEventListener<AbstractServiceInstanceEvent>
A base class for classes that automatically register the server with discovery services.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected final AtomicBoolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAutoRegistration(RegistrationConfiguration registrationConfiguration) Initialize given configurations. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidderegister(ServiceInstance instance) Deregister theServiceInstancefrom service discovery services.voidHandle an application event.protected abstract voidpulsate(ServiceInstance instance, HealthStatus status) This method will be invoked each time aHeartbeatEventoccurs allowing the implementation to perform any necessary callbacks to the service discovery server.protected abstract voidregister(ServiceInstance instance) Register theServiceInstancewith discovery services.protected voidValidate the given application name.protected voidvalidateName(String name, String typeDescription) Validate the given application name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.context.event.ApplicationEventListener
supports
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
registered
-
-
Constructor Details
-
AutoRegistration
Initialize given configurations.- Parameters:
registrationConfiguration- Common configurations for registration
-
-
Method Details
-
onApplicationEvent
Description copied from interface:ApplicationEventListenerHandle an application event.- Specified by:
onApplicationEventin interfaceApplicationEventListener<AbstractServiceInstanceEvent>- Parameters:
event- the event to respond to
-
pulsate
This method will be invoked each time aHeartbeatEventoccurs allowing the implementation to perform any necessary callbacks to the service discovery server.- Parameters:
instance- The instancestatus- TheHealthStatus
-
deregister
Deregister theServiceInstancefrom service discovery services.- Parameters:
instance- TheServiceInstance
-
register
Register theServiceInstancewith discovery services.- Parameters:
instance- TheServiceInstance
-
validateApplicationName
Validate the given application name.- Parameters:
name- The application name
-
validateName
Validate the given application name.- Parameters:
name- The application nametypeDescription- The detailed information about name
-