Interface HeartbeatMonitor<O>
- Type Parameters:
O- Type of the payload being sent to the associated heartbeat target
- All Known Implementing Classes:
DefaultHeartbeatMonitor
public interface HeartbeatMonitor<O>
Heartbeat monitor which manages the heartbeat state of the associated heartbeat target. The
monitor notifies the
HeartbeatListener whenever it has not seen a heartbeat signal in the
specified heartbeat timeout interval. Each heartbeat signal resets this timer.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThis factory provides an indirection way to createHeartbeatMonitor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancel this monitor.Gets heartbeat target.Gets heartbeat target id.longGets the last heartbeat.voidReport heartbeat from the monitored target.voidReports that the heartbeat rpc could not be sent to the target.voidReports that the heartbeat rpc could be sent to the target.
-
Method Details
-
getHeartbeatTarget
HeartbeatTarget<O> getHeartbeatTarget()Gets heartbeat target.- Returns:
- the heartbeat target
-
getHeartbeatTargetId
ResourceID getHeartbeatTargetId()Gets heartbeat target id.- Returns:
- the heartbeat target id
-
reportHeartbeat
void reportHeartbeat()Report heartbeat from the monitored target. -
cancel
void cancel()Cancel this monitor. -
getLastHeartbeat
long getLastHeartbeat()Gets the last heartbeat.- Returns:
- the last heartbeat
-
reportHeartbeatRpcFailure
void reportHeartbeatRpcFailure()Reports that the heartbeat rpc could not be sent to the target. -
reportHeartbeatRpcSuccess
void reportHeartbeatRpcSuccess()Reports that the heartbeat rpc could be sent to the target.
-