Package io.smallrye.health.api
Interface HealthRegistry
@Experimental("Programmatic Health API")
public interface HealthRegistry
Programmatic API for the dynamic registrations and removals of health check procedures.
The HealthRegistry can be injected as a CDI bean with two qualifiers:
- Liveness
@Inject @Liveness HealthRegistry livenessHealthRegistry;
- Readiness:
@Inject @Readiness HealthRegistry readinessHealthRegistry;
-
Method Summary
Modifier and TypeMethodDescriptiondefault HealthRegistryregister(AsyncHealthCheck asyncHealthCheck) Asynchronous variant ofregister(HealthCheck).register(String id, AsyncHealthCheck asyncHealthCheck) Asynchronous variant of theregister(String, 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).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 Details
-
register
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
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
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
Asynchronous variant ofregister(HealthCheck).- Parameters:
asyncHealthCheck- theAsyncHealthCheckinstance to be registered- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be registered
-
remove
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
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
Asynchronous variant ofremove(HealthCheck).- Parameters:
asyncHealthCheck- theAsyncHealthCheckinstance to be removed- Returns:
- this instance for fluent registration
- Throws:
IllegalStateException- if theHealthCheckinstance cannot be removed
-