java.lang.Object
org.axonframework.axonserver.connector.heartbeat.connection.checker.HeartbeatConnectionChecker
All Implemented Interfaces:
ConnectionSanityChecker

@Deprecated public class HeartbeatConnectionChecker extends Object implements ConnectionSanityChecker
Deprecated.
in through use of the AxonServer java connector
Implementation of ConnectionSanityChecker which verifies that heartbeats are properly received.
Since:
4.2.1
Author:
Sara Pellegrini
  • Constructor Details

    • HeartbeatConnectionChecker

      public HeartbeatConnectionChecker(AxonServerConnectionManager connectionManager, String context)
      Deprecated.
      Constructs an instance of HeartbeatConnectionChecker using the specified parameters.
      Parameters:
      connectionManager - the connectionManager to AxonServer instance
      context - the (Bounded) Context for which is verified the AxonServer connection
    • HeartbeatConnectionChecker

      public HeartbeatConnectionChecker(Consumer<Runnable> registration, ConnectionSanityChecker delegate)
      Deprecated.
      Constructs an instance of HeartbeatConnectionChecker using a default timeout of 5 seconds and the system clock.
      Parameters:
      registration - function which allows to register a callback for the reception of an heartbeat
      delegate - another implementation of ConnectionSanityChecker that performs others kind of verifications
    • HeartbeatConnectionChecker

      public HeartbeatConnectionChecker(long heartbeatTimeout, Consumer<Runnable> registerOnHeartbeat, ConnectionSanityChecker delegate, Clock clock)
      Deprecated.
      Primary constructor of HeartbeatConnectionChecker.
      Parameters:
      heartbeatTimeout - the time without any heartbeat after which the connection is considered no more valid; it is expressed in milliseconds
      registerOnHeartbeat - function which allows to register a callback for the reception of an heartbeat
      delegate - another implementation of ConnectionSanityChecker that performs others kind of verifications
      clock - clock used to verify the timeout
  • Method Details

    • isValid

      public boolean isValid()
      Deprecated.
      Returns true if the connection is still alive, false otherwise.

      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.

      Specified by:
      isValid in interface ConnectionSanityChecker
      Returns:
      true if the connection is valid, false otherwise