Class SettableHealthChecker
java.lang.Object
com.linecorp.armeria.common.util.AbstractListenable<HealthChecker>
com.linecorp.armeria.server.healthcheck.SettableHealthChecker
- All Implemented Interfaces:
Listenable<HealthChecker>
,HealthChecker
,ListenableHealthChecker
public final class SettableHealthChecker extends AbstractListenable<HealthChecker> implements ListenableHealthChecker
A simple
ListenableHealthChecker
whose state can be set by a caller. This can be used in case server
health should have additional conditions besides the state of the Server
. e.g. it should depend on
the health of a backend.-
Constructor Summary
Constructors Constructor Description SettableHealthChecker()
Constructs a newSettableHealthChecker
which starts out in a healthy state and can be changed usingsetHealthy(boolean)
.SettableHealthChecker(boolean isHealthy)
Constructs a newSettableHealthChecker
which starts out in the specified health state and can be changed usingsetHealthy(boolean)
. -
Method Summary
Modifier and Type Method Description boolean
isHealthy()
Returnstrue
if and only if theServer
is healthy.SettableHealthChecker
setHealthy(boolean isHealthy)
Sets if theServer
is healthy or not.String
toString()
Methods inherited from class com.linecorp.armeria.common.util.AbstractListenable
addListener, notifyListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.common.util.Listenable
addListener, removeListener
-
Constructor Details
-
SettableHealthChecker
public SettableHealthChecker()Constructs a newSettableHealthChecker
which starts out in a healthy state and can be changed usingsetHealthy(boolean)
. -
SettableHealthChecker
public SettableHealthChecker(boolean isHealthy)Constructs a newSettableHealthChecker
which starts out in the specified health state and can be changed usingsetHealthy(boolean)
.
-
-
Method Details
-
isHealthy
public boolean isHealthy()Description copied from interface:HealthChecker
Returnstrue
if and only if theServer
is healthy.- Specified by:
isHealthy
in interfaceHealthChecker
-
setHealthy
Sets if theServer
is healthy or not. -
toString
-