public class HealthChecksImpl extends Object implements HealthChecks
| Constructor and Description |
|---|
HealthChecksImpl(Vertx vertx) |
| Modifier and Type | Method and Description |
|---|---|
HealthChecks |
invoke(Handler<JsonObject> resultHandler)
Invokes the registered procedures and computes the outcome.
|
HealthChecks |
invoke(String name,
Handler<AsyncResult<JsonObject>> resultHandler)
Invokes the registered procedure with the given name and sub-procedures.
|
HealthChecks |
register(String name,
Handler<Promise<Status>> procedure)
Registers a health check procedure.
|
HealthChecks |
register(String name,
long timeout,
Handler<Promise<Status>> procedure)
Registers a health check procedure.
|
HealthChecks |
unregister(String name)
Unregisters a procedure.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic HealthChecksImpl(Vertx vertx)
public HealthChecks register(String name, Handler<Promise<Status>> procedure)
HealthChecks
The procedure is a Handler taking a Promise of Status as parameter.
Procedures are asynchronous, and must complete or fail the given Promise.
If the future object is failed, the procedure outcome is considered as `DOWN`. If the future is
completed without any object, the procedure outcome is considered as `UP`. If the future is completed
with a (not-null) Status, the procedure outcome is the received status.
This method uses a 1s timeout. Use HealthChecks.register(String, long, Handler) to configure the timeout.
register in interface HealthChecksname - the name of the procedure, must not be null or emptyprocedure - the procedure, must not be nullHealthCheckspublic HealthChecks register(String name, long timeout, Handler<Promise<Status>> procedure)
HealthChecks
The procedure is a Handler taking a Promise of Status as parameter.
Procedures are asynchronous, and must complete or fail the given Promise.
If the future object is failed, the procedure outcome is considered as `DOWN`. If the future is
completed without any object, the procedure outcome is considered as `UP`. If the future is completed
with a (not-null) Status, the procedure outcome is the received status.
register in interface HealthChecksname - the name of the procedure, must not be null or emptytimeout - the procedure timeout in millisecondsprocedure - the procedure, must not be nullHealthCheckspublic HealthChecks unregister(String name)
HealthChecksunregister in interface HealthChecksname - the name of the procedureHealthCheckspublic HealthChecks invoke(Handler<JsonObject> resultHandler)
HealthChecksinvoke in interface HealthChecksresultHandler - the result handler, must not be null. The handler received the computed
JsonObject.HealthCheckspublic HealthChecks invoke(String name, Handler<AsyncResult<JsonObject>> resultHandler)
HealthChecksinvoke in interface HealthChecksresultHandler - the result handler, must not be null. The handler received an
AsyncResult marked as failed if the procedure with the given name cannot
be found or invoked.HealthChecksCopyright © 2020. All rights reserved.