Interface HealthCheckerContext
public interface HealthCheckerContext
Provides the properties and operations required for sending health check requests.
-
Method Summary
Modifier and TypeMethodDescriptionReturns theClientOptionsof theClientthat sends health check requests.endpoint()Returns theEndpointto send health check requests to.executor()Returns theScheduledExecutorServicewhich is used for scheduling the tasks related with sending health check requests.longReturns the delay for the next health check request in milliseconds.protocol()Returns theSessionProtocolto be used when sending health check requests.voidupdateHealth(double health) Deprecated.default voidupdateHealth(double health, ClientRequestContext ctx, @Nullable ResponseHeaders headers, @Nullable Throwable cause) Updates the health of theEndpointbeing checked.
-
Method Details
-
endpoint
Endpoint endpoint()Returns theEndpointto send health check requests to. -
protocol
SessionProtocol protocol()Returns theSessionProtocolto be used when sending health check requests. -
clientOptions
ClientOptions clientOptions()Returns theClientOptionsof theClientthat sends health check requests. -
executor
ScheduledExecutorService executor()Returns theScheduledExecutorServicewhich is used for scheduling the tasks related with sending health check requests. Note that theScheduledExecutorServicereturned by this method cannot be shut down; callingExecutorService.shutdown()orExecutorService.shutdownNow()will trigger anUnsupportedOperationException. -
nextDelayMillis
long nextDelayMillis()Returns the delay for the next health check request in milliseconds. -
updateHealth
Updates the health of theEndpointbeing checked. -
updateHealth
default void updateHealth(double health, ClientRequestContext ctx, @Nullable @Nullable ResponseHeaders headers, @Nullable @Nullable Throwable cause) Updates the health of theEndpointbeing checked.- Parameters:
health-0.0indicates theEndpointis not able to handle any requests. A positive value indicates theEndpointis able to handle requests. A value greater than1.0will be set equal to1.0.ctx- theClientRequestContextof the health check request.headers- theResponseHeadersof the health check request.nullif the request is failed with thecause.cause- the cause of the failed health check request.nullif the health checked request received theheaders.
-
updateHealth(double, ClientRequestContext, ResponseHeaders, Throwable).