@Deprecated public class HeartbeatConnectionChecker extends Object implements ConnectionSanityChecker
ConnectionSanityChecker
which verifies that heartbeats are properly received.Constructor and Description |
---|
HeartbeatConnectionChecker(AxonServerConnectionManager connectionManager,
String context)
Deprecated.
Constructs an instance of
HeartbeatConnectionChecker using the specified parameters. |
HeartbeatConnectionChecker(Consumer<Runnable> registration,
ConnectionSanityChecker delegate)
Deprecated.
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)
Deprecated.
Primary constructor of
HeartbeatConnectionChecker . |
Modifier and Type | Method and Description |
---|---|
boolean |
isValid()
Deprecated.
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()
Detects if the connection is still available according with the heartbeat timeout. If no heartbeat at all is
received since the startup of the connection, this implementation returns 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–2024. All rights reserved.