public class HeartbeatConnectionChecker extends Object implements ConnectionSanityChecker
ConnectionSanityChecker
which verifies that heartbeats are properly received.Constructor and Description |
---|
HeartbeatConnectionChecker(AxonServerConnectionManager connectionManager,
String context)
Constructs an instance of
HeartbeatConnectionChecker using the specified parameters. |
HeartbeatConnectionChecker(Consumer<Runnable> registration,
ConnectionSanityChecker delegate)
Constructs an instance of
HeartbeatConnectionChecker using a default timeout of 5 seconds and the system clock. |
HeartbeatConnectionChecker(long heartbeatTimeout,
Consumer<Runnable> registerOnHeartbeat,
ConnectionSanityChecker delegate,
Clock clock)
Primary constructor of
HeartbeatConnectionChecker . |
Modifier and Type | Method and Description |
---|---|
boolean |
isValid()
Returns true if the connection is still alive, false otherwise.
|
public HeartbeatConnectionChecker(AxonServerConnectionManager connectionManager, String context)
HeartbeatConnectionChecker
using the specified parameters.connectionManager
- the connectionManager to AxonServer instancecontext
- the (Bounded) Context for which is verified the AxonServer connectionpublic HeartbeatConnectionChecker(Consumer<Runnable> registration, ConnectionSanityChecker delegate)
HeartbeatConnectionChecker
using a default timeout of 5 seconds and the system clock.registration
- function which allows to register a callback for the reception of an heartbeatdelegate
- another implementation of ConnectionSanityChecker
that performs others kind of verificationspublic HeartbeatConnectionChecker(long heartbeatTimeout, Consumer<Runnable> registerOnHeartbeat, ConnectionSanityChecker delegate, Clock clock)
HeartbeatConnectionChecker
.heartbeatTimeout
- the time without any heartbeat after which the connection is considered no more valid;
it is expressed in millisecondsregisterOnHeartbeat
- function which allows to register a callback for the reception of an heartbeatdelegate
- another implementation of ConnectionSanityChecker
that performs others kind of verificationsclock
- clock used to verify the timeoutpublic boolean isValid()
true
as we suppose that Axon Server version doesn't support the heartbeat feature.isValid
in interface ConnectionSanityChecker
true
if the connection is valid, false
otherwiseCopyright © 2010–2020. All rights reserved.