Interface HeartbeatListener<I,​O>

  • Type Parameters:
    I - Type of the incoming payload
    O - 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 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 payload
        payload - 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