Class EurekaAutoRegistration
java.lang.Object
io.micronaut.discovery.registration.AutoRegistration
io.micronaut.discovery.client.registration.DiscoveryServiceAutoRegistration
io.micronaut.discovery.eureka.registration.EurekaAutoRegistration
- All Implemented Interfaces:
io.micronaut.context.event.ApplicationEventListener<io.micronaut.discovery.event.AbstractServiceInstanceEvent>
,EventListener
@Singleton
@Requires(beans={EurekaClient.class,io.micronaut.runtime.server.EmbeddedServer.class}) @Requires(property="micronaut.application.name")
public class EurekaAutoRegistration
extends DiscoveryServiceAutoRegistration
A
AutoRegistration
that registers with Eureka.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from class io.micronaut.discovery.registration.AutoRegistration
LOG, registered
-
Constructor Summary
ModifierConstructorDescriptionprotected
EurekaAutoRegistration
(io.micronaut.context.env.Environment environment, EurekaClient eurekaClient, EurekaConfiguration eurekaConfiguration, io.micronaut.health.HeartbeatConfiguration heartbeatConfiguration, io.micronaut.discovery.ServiceInstanceIdGenerator idGenerator) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
customizeInstanceInfo
(InstanceInfo instanceInfo) Subclasses can override to customize the instance info.protected void
deregister
(io.micronaut.discovery.ServiceInstance instance) protected void
pulsate
(io.micronaut.discovery.ServiceInstance instance, io.micronaut.health.HealthStatus status) protected void
register
(io.micronaut.discovery.ServiceInstance instance) protected InstanceInfo.Status
translateState
(io.micronaut.health.HealthStatus status) Translate aHealthStatus
to a EurekaInstanceInfo.Status
.Methods inherited from class io.micronaut.discovery.client.registration.DiscoveryServiceAutoRegistration
getErrorMessage, performDeregistration, performRegistration
Methods inherited from class io.micronaut.discovery.registration.AutoRegistration
onApplicationEvent, validateApplicationName, validateName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.context.event.ApplicationEventListener
supports
-
Constructor Details
-
EurekaAutoRegistration
protected EurekaAutoRegistration(io.micronaut.context.env.Environment environment, EurekaClient eurekaClient, EurekaConfiguration eurekaConfiguration, io.micronaut.health.HeartbeatConfiguration heartbeatConfiguration, io.micronaut.discovery.ServiceInstanceIdGenerator idGenerator) - Parameters:
environment
- The environmenteurekaClient
- The Eureka clienteurekaConfiguration
- The Eureka configurationheartbeatConfiguration
- The Heartbeat configurationidGenerator
- The id generator
-
-
Method Details
-
pulsate
protected void pulsate(io.micronaut.discovery.ServiceInstance instance, io.micronaut.health.HealthStatus status) - Specified by:
pulsate
in classio.micronaut.discovery.registration.AutoRegistration
-
translateState
Translate aHealthStatus
to a EurekaInstanceInfo.Status
.- Parameters:
status
- The status- Returns:
- The
InstanceInfo.Status
instance
-
deregister
protected void deregister(io.micronaut.discovery.ServiceInstance instance) - Specified by:
deregister
in classio.micronaut.discovery.registration.AutoRegistration
-
register
protected void register(io.micronaut.discovery.ServiceInstance instance) - Specified by:
register
in classio.micronaut.discovery.registration.AutoRegistration
-
customizeInstanceInfo
Subclasses can override to customize the instance info.- Parameters:
instanceInfo
- The instance info
-