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 theHeartbeatManager. 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidnotifyHeartbeatTimeout(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.OretrievePayload(ResourceID resourceID)Retrieves the payload value for the next heartbeat message.
-
-
-
Method Detail
-
notifyHeartbeatTimeout
void notifyHeartbeatTimeout(ResourceID resourceID)
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
void notifyTargetUnreachable(ResourceID resourceID)
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
void reportPayload(ResourceID resourceID, I payload)
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
O retrievePayload(ResourceID resourceID)
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
-
-