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.ApplicationEventAn 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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description HeartbeatEvent(Object source, Object state)Creates a new event with a source (for example, a discovery client) and a value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetValue()A value representing the state of the service catalog.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
HeartbeatEvent
public HeartbeatEvent(Object source, Object state)
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 Detail
-
getValue
public Object 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.
-
-