I
- ignoredO
- ignoredpublic class NoOpHeartbeatManager<I,O> extends Object implements HeartbeatManager<I,O>
HeartbeatManager
implementation which does nothing.Modifier and Type | Method and Description |
---|---|
static <A,B> NoOpHeartbeatManager<A,B> |
getInstance() |
long |
getLastHeartbeatFrom(ResourceID resourceId)
Returns the last received heartbeat from the given target.
|
void |
monitorTarget(ResourceID resourceID,
HeartbeatTarget<O> heartbeatTarget)
Start monitoring a
HeartbeatTarget . |
void |
receiveHeartbeat(ResourceID heartbeatOrigin,
I heartbeatPayload)
Sends a heartbeat response to the target.
|
void |
requestHeartbeat(ResourceID requestOrigin,
I heartbeatPayload)
Requests a heartbeat from the target.
|
void |
stop()
Stops the heartbeat manager.
|
void |
unmonitorTarget(ResourceID resourceID)
Stops monitoring the heartbeat target with the associated resource ID.
|
public void monitorTarget(ResourceID resourceID, HeartbeatTarget<O> heartbeatTarget)
HeartbeatManager
HeartbeatTarget
. Heartbeat timeouts for this target are reported
to the HeartbeatListener
associated with this heartbeat manager.monitorTarget
in interface HeartbeatManager<I,O>
resourceID
- Resource ID identifying the heartbeat targetheartbeatTarget
- Interface to send heartbeat requests and responses to the heartbeat
targetpublic void unmonitorTarget(ResourceID resourceID)
HeartbeatManager
unmonitorTarget
in interface HeartbeatManager<I,O>
resourceID
- Resource ID of the heartbeat target which shall no longer be monitoredpublic void stop()
HeartbeatManager
stop
in interface HeartbeatManager<I,O>
public long getLastHeartbeatFrom(ResourceID resourceId)
HeartbeatManager
getLastHeartbeatFrom
in interface HeartbeatManager<I,O>
resourceId
- for which to return the last heartbeatpublic void receiveHeartbeat(ResourceID heartbeatOrigin, I heartbeatPayload)
HeartbeatTarget
receiveHeartbeat
in interface HeartbeatTarget<I>
heartbeatOrigin
- Resource ID identifying the machine for which a heartbeat shall be reported.heartbeatPayload
- Payload of the heartbeat. Null indicates an empty payload.public void requestHeartbeat(ResourceID requestOrigin, I heartbeatPayload)
HeartbeatTarget
requestHeartbeat
in interface HeartbeatTarget<I>
requestOrigin
- Resource ID identifying the machine issuing the heartbeat request.heartbeatPayload
- Payload of the heartbeat request. Null indicates an empty payload.public static <A,B> NoOpHeartbeatManager<A,B> getInstance()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.