@Deprecated public class HeartbeatMonitor extends Object implements Lifecycle
Lifecycle.LifecycleHandler, Lifecycle.LifecycleRegistry
Constructor and Description |
---|
HeartbeatMonitor(Runnable onInvalidConnection,
ConnectionSanityChecker connectionSanityCheck,
Scheduler scheduler,
long initialDelay,
long delay)
Deprecated.
Primary constructor of
HeartbeatMonitor . |
Modifier and Type | Method and Description |
---|---|
void |
registerLifecycleHandlers(Lifecycle.LifecycleRegistry lifecycle)
Deprecated.
Registers the activities to be executed in the various phases of an application's lifecycle.
|
void |
shutdown()
Deprecated.
Stops the scheduled task and shutdown the monitor, that cannot be restarted again.
|
void |
start()
Deprecated.
Schedule a task that verifies that the connection is still alive and, if it is not, invoke a callback in order to
react to the disconnection.
|
public HeartbeatMonitor(Runnable onInvalidConnection, ConnectionSanityChecker connectionSanityCheck, Scheduler scheduler, long initialDelay, long delay)
HeartbeatMonitor
.onInvalidConnection
- callback to be call when the connection is no longer aliveconnectionSanityCheck
- sanity check which allows to verify if the connection is alivescheduler
- the Scheduler
to use for scheduling the taskinitialDelay
- the initial delay, in millisecondsdelay
- the scheduling period, in millisecondspublic void registerLifecycleHandlers(@Nonnull Lifecycle.LifecycleRegistry lifecycle)
Lifecycle
registerLifecycleHandlers
in interface Lifecycle
lifecycle
- the lifecycle instance to register the handlers withLifecycle.LifecycleRegistry.onShutdown(int, Runnable)
,
LifecycleRegistry#onShutdown(int, LifecycleHandler)
,
Lifecycle.LifecycleRegistry.onStart(int, Runnable)
,
LifecycleRegistry#onStart(int, LifecycleHandler)
public void start()
Phase.INSTRUCTION_COMPONENTS
, as this means all inbound and
outbound connections have been started.public void shutdown()
Phase.INSTRUCTION_COMPONENTS
.Copyright © 2010–2023. All rights reserved.