Class HeartbeatEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.cloud.client.discovery.event.HeartbeatEvent
- All Implemented Interfaces:
Serializable
public class HeartbeatEvent
extends org.springframework.context.ApplicationEvent
An event that a DiscoveryClient implementation can broadcast if it supports heartbeats
from the discovery server. Provides listeners with a basic indication of a state change
in the service catalog.
- Author:
- Spencer Gibb, Dave Syer
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionHeartbeatEvent
(Object source, Object state) Creates a new event with a source (for example, a discovery client) and a value. -
Method Summary
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
HeartbeatEvent
Creates a new event with a source (for example, a discovery client) and a value. Neither parameter should be relied on to have specific content or format.- Parameters:
source
- The source of the event.state
- The value indicating state of the catalog.
-
-
Method Details
-
getValue
A value representing the state of the service catalog. The only requirement is that it changes when the catalog is updated; it can be as simple as a version counter or a hash. Implementations can provide information to help users visualize what is going on in the catalog, but users should not rely on the content (since the implementation of the underlying discovery might change).- Returns:
- A value representing state of the service catalog.
-