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 theHeartbeatListenerwhenever it has not seen a heartbeat signal in the specified heartbeat timeout interval. Each heartbeat signal resets this timer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceHeartbeatMonitor.Factory<O>This factory provides an indirection way to createHeartbeatMonitor.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel()Cancel this monitor.HeartbeatTarget<O>getHeartbeatTarget()Gets heartbeat target.ResourceIDgetHeartbeatTargetId()Gets heartbeat target id.longgetLastHeartbeat()Gets the last heartbeat.voidreportHeartbeat()Report heartbeat from the monitored target.voidreportHeartbeatRpcFailure()Reports that the heartbeat rpc could not be sent to the target.voidreportHeartbeatRpcSuccess()Reports that the heartbeat rpc could be sent to the target.
-
-
-
Method Detail
-
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.
-
-