@ConsumerType
public interface HealthCheck
Result
,
for most cases it is most convenient to use FormattingResultLog
that automatically derives the correct Result.Status
from
the log messages.
Clients should not look up health checks directly but rather use the HealthCheckExecutor
service and executed checks based on tags.
If the MBEAN_NAME
service registration property is set, the health check is registered as an mbean and can be invoked by getting
the MBean from the JMX registry.Modifier and Type | Field and Description |
---|---|
static String |
ASYNC_CRON_EXPRESSION
Optional service property: If this property is set the health check will be executed asynchronously using the cron expression
provided.
|
static String |
ASYNC_INTERVAL_IN_SEC
Optional service property: If this property is set the health check will be executed asynchronously every n seconds
|
static String |
KEEP_NON_OK_RESULTS_STICKY_FOR_SEC
Optional service property: If given, non-ok results from past executions will be taken into account as well for the given seconds
(use Long.MAX_VALUE for indefinitely).
|
static String |
MBEAN_NAME
Optional service property: the name of the MBean for registering the health check as an MBean.
|
static String |
NAME
Optional service property: the name of a health check.
|
static String |
RESULT_CACHE_TTL_IN_MS
Optional service property: TTL for health check
Result . |
static String |
TAGS
Optional service property: tags for categorizing the health check services.
|
Modifier and Type | Method and Description |
---|---|
Result |
execute()
Execute this health check and return a
Result . |
static final String NAME
static final String TAGS
static final String MBEAN_NAME
static final String ASYNC_CRON_EXPRESSION
static final String ASYNC_INTERVAL_IN_SEC
static final String RESULT_CACHE_TTL_IN_MS
Result
. The value of this property must be of type Long
and is
specified in ms.static final String KEEP_NON_OK_RESULTS_STICKY_FOR_SEC
Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.