public final class SettableHealthChecker extends AbstractListenable<HealthChecker> implements ListenableHealthChecker
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 and Description |
|---|
SettableHealthChecker()
Constructs a new
SettableHealthChecker which starts out in a healthy state and can be changed
using setHealthy(boolean). |
SettableHealthChecker(boolean isHealthy)
Constructs a new
SettableHealthChecker which starts out in the specified health state and can be
changed using setHealthy(boolean). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isHealthy()
Returns
true if and only if the Server is healthy. |
SettableHealthChecker |
setHealthy(boolean isHealthy)
Sets if the
Server is healthy or not. |
String |
toString() |
addListener, notifyListeners, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, removeListenerpublic SettableHealthChecker()
SettableHealthChecker which starts out in a healthy state and can be changed
using setHealthy(boolean).public SettableHealthChecker(boolean isHealthy)
SettableHealthChecker which starts out in the specified health state and can be
changed using setHealthy(boolean).public boolean isHealthy()
HealthCheckertrue if and only if the Server is healthy.isHealthy in interface HealthCheckerpublic SettableHealthChecker setHealthy(boolean isHealthy)
Server is healthy or not.Copyright © 2020 LeanCloud. All rights reserved.