Interface HeartbeatListener<I,O>
- Type Parameters:
I- Type of the incoming payloadO- Type of the outgoing payload
public interface HeartbeatListener<I,O>
Interface for the interaction with the
HeartbeatManager. The heartbeat listener is used
for the following things:
- Notifications about heartbeat timeouts
- Payload reports of incoming heartbeats
- Retrieval of payloads for outgoing heartbeats
-
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyHeartbeatTimeout(ResourceID resourceID) Callback which is called if a heartbeat for the machine identified by the given resource ID times out.voidnotifyTargetUnreachable(ResourceID resourceID) Callback which is called if a target specified by the given resource ID is no longer reachable.voidreportPayload(ResourceID resourceID, I payload) Callback which is called whenever a heartbeat with an associated payload is received.retrievePayload(ResourceID resourceID) Retrieves the payload value for the next heartbeat message.
-
Method Details
-
notifyHeartbeatTimeout
Callback which is called if a heartbeat for the machine identified by the given resource ID times out.- Parameters:
resourceID- Resource ID of the machine whose heartbeat has timed out
-
notifyTargetUnreachable
Callback which is called if a target specified by the given resource ID is no longer reachable.- Parameters:
resourceID- resourceID identifying the target that is no longer reachable
-
reportPayload
Callback which is called whenever a heartbeat with an associated payload is received. The carried payload is given to this method.- Parameters:
resourceID- Resource ID identifying the sender of the payloadpayload- Payload of the received heartbeat
-
retrievePayload
Retrieves the payload value for the next heartbeat message.- Parameters:
resourceID- Resource ID identifying the receiver of the payload- Returns:
- The payload for the next heartbeat
-