Package io.camunda.zeebe.util.health
Class CriticalComponentsHealthMonitor
java.lang.Object
io.camunda.zeebe.util.health.CriticalComponentsHealthMonitor
- All Implemented Interfaces:
HealthMonitor,HealthMonitorable
Healthy only if all components are healthy
-
Constructor Summary
ConstructorsConstructorDescriptionCriticalComponentsHealthMonitor(String name, ActorControl actor, org.slf4j.Logger log) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailureListener(FailureListener failureListener) Register a failure observer.Used by a HealthMonitor to get the health status of this component, typically invoked periodically.getName()Used by a HealthMonitor to get the name of this component.voidmonitorComponent(String componentName) Add a component name to be monitored.voidregisterComponent(String componentName, HealthMonitorable component) Register the component to be monitoredvoidremoveComponent(String componentName) Stop monitoring the component.voidremoveFailureListener(FailureListener failureListener) Removes a previously registered listener.voidStarts necessary services for monitoring.
-
Constructor Details
-
CriticalComponentsHealthMonitor
-
-
Method Details
-
startMonitoring
public void startMonitoring()Description copied from interface:HealthMonitorStarts necessary services for monitoring. Typically implemented by a monitor to start periodic monitoring.- Specified by:
startMonitoringin interfaceHealthMonitor
-
monitorComponent
Description copied from interface:HealthMonitorAdd a component name to be monitored. The component will be marked not healthy until the component is registered usingHealthMonitor.registerComponent(String, HealthMonitorable)- Specified by:
monitorComponentin interfaceHealthMonitor
-
removeComponent
Description copied from interface:HealthMonitorStop monitoring the component.- Specified by:
removeComponentin interfaceHealthMonitor
-
registerComponent
Description copied from interface:HealthMonitorRegister the component to be monitored- Specified by:
registerComponentin interfaceHealthMonitor
-
getName
Description copied from interface:HealthMonitorableUsed by a HealthMonitor to get the name of this component. Most `HealthMonitorable`s override this method to return their actor name. If they don't override the method, the name of the class is returned.- Specified by:
getNamein interfaceHealthMonitorable- Returns:
- the name of this component
-
getHealthReport
Description copied from interface:HealthMonitorableUsed by a HealthMonitor to get the health status of this component, typically invoked periodically.- Specified by:
getHealthReportin interfaceHealthMonitorable- Returns:
- health status
-
addFailureListener
Description copied from interface:HealthMonitorableRegister a failure observer.- Specified by:
addFailureListenerin interfaceHealthMonitorable- Parameters:
failureListener- failure observer to be invoked when a failure that affects the health status of this component occurs
-
removeFailureListener
Description copied from interface:HealthMonitorableRemoves a previously registered listener. Should do nothing if it was not previously registered.- Specified by:
removeFailureListenerin interfaceHealthMonitorable- Parameters:
failureListener- the failure listener to remove
-