Package io.smallrye.health.api
Interface HealthRegistry
-
@Experimental("Programmatic Health API") public interface HealthRegistryProgrammatic API for the dynamic registrations and removals of health check procedures.
The
HealthRegistrycan be injected as a CDI bean with two qualifiers:- Liveness
@Inject @Liveness HealthRegistry livenessHealthRegistry;
- Readiness:
@Inject @Readiness HealthRegistry readinessHealthRegistry;
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default HealthRegistryregister(AsyncHealthCheck asyncHealthCheck)Asynchronous variant ofregister(HealthCheck).HealthRegistryregister(String id, AsyncHealthCheck asyncHealthCheck)Asynchronous variant of theregister(String, HealthCheck).HealthRegistryregister(String id, org.eclipse.microprofile.health.HealthCheck healthCheck)Programmatic registration of aHealthCheckinstances.default HealthRegistryregister(org.eclipse.microprofile.health.HealthCheck healthCheck)Programmatic registration of aHealthCheckintances with the id set to to the health check class name.default HealthRegistryremove(AsyncHealthCheck asyncHealthCheck)Asynchronous variant ofremove(HealthCheck).HealthRegistryremove(String id)Programmatic removal of a programmatically registered check (HealthCheckorAsyncHealthCheck) instances.default HealthRegistryremove(org.eclipse.microprofile.health.HealthCheck healthCheck)Programmatic removal of a programmatically registeredHealthCheckinstances with the id set to the the health check class name.
-
-
-
Method Detail
-
register
HealthRegistry register(String id, org.eclipse.microprofile.health.HealthCheck healthCheck)
Programmatic registration of aHealthCheckinstances.- Parameters:
id- the id of the registered check which can be later used for its removalhealthCheck- theHealthCheckinstance to be registered- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be registered
-
register
HealthRegistry register(String id, AsyncHealthCheck asyncHealthCheck)
Asynchronous variant of theregister(String, HealthCheck).- Parameters:
id- the id of the registered asynchronous check which can be later used for its removalasyncHealthCheck- theAsyncHealthCheckinstance to be registered- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be registered
-
register
default HealthRegistry register(org.eclipse.microprofile.health.HealthCheck healthCheck)
Programmatic registration of aHealthCheckintances with the id set to to the health check class name.- Parameters:
healthCheck- theHealthCheckinstance to be registered- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be registered
-
register
default HealthRegistry register(AsyncHealthCheck asyncHealthCheck)
Asynchronous variant ofregister(HealthCheck).- Parameters:
asyncHealthCheck- theAsyncHealthCheckinstance to be registered- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be registered
-
remove
HealthRegistry remove(String id)
Programmatic removal of a programmatically registered check (HealthCheckorAsyncHealthCheck) instances.- Parameters:
id- the id of the registered check to be removed- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be removed
-
remove
default HealthRegistry remove(org.eclipse.microprofile.health.HealthCheck healthCheck)
Programmatic removal of a programmatically registeredHealthCheckinstances with the id set to the the health check class name.- Parameters:
healthCheck- theHealthCheckinstance to be removed- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be removed
-
remove
default HealthRegistry remove(AsyncHealthCheck asyncHealthCheck)
Asynchronous variant ofremove(HealthCheck).- Parameters:
asyncHealthCheck- theAsyncHealthCheckinstance to be removed- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be removed
-
-