public abstract class BaseServiceProviderBuilder<T,B extends BaseServiceProviderBuilder<T,B,S>,S extends Serializer<T>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<Signal<HealthcheckResult>> |
additionalRefreshSignals |
protected List<Healthcheck> |
healthchecks |
protected int |
healthUpdateIntervalMs |
protected String |
hostname |
protected String |
namespace |
protected T |
nodeData |
protected NodeDataSink<T,S> |
nodeDataSource |
protected int |
port |
protected S |
serializer |
protected String |
serviceName |
protected int |
staleUpdateThresholdMs |
protected List<Consumer<Void>> |
startSignalHandlers |
protected List<Consumer<Void>> |
stopSignalHandlers |
| Constructor and Description |
|---|
BaseServiceProviderBuilder() |
| Modifier and Type | Method and Description |
|---|---|
abstract ServiceProvider<T,S> |
build() |
protected ServiceProvider<T,S> |
buildProvider() |
protected abstract NodeDataSink<T,S> |
dataSink(Service service) |
B |
withAdditionalRefreshSignal(Signal<HealthcheckResult> additionalRefreshSignal) |
B |
withAdditionalRefreshSignals(List<Signal<HealthcheckResult>> additionalRefreshSignals) |
B |
withHealthcheck(Healthcheck healthcheck) |
B |
withHealthUpdateIntervalMs(int healthUpdateIntervalMs) |
B |
withHostname(String hostname) |
B |
withIsolatedHealthMonitor(IsolatedHealthMonitor monitor)
Register a monitor to the service, to setup a continuous monitoring on the monitor
this method can be used to add a
IsolatedHealthMonitor which will later be
scheduled at regular intervals and monitored to generate and maintain an aggregated health of the service
the scheduling will happen in an isolated thread |
B |
withNamespace(String namespace) |
B |
withNodeData(T nodeData) |
B |
withNodeDataSource(NodeDataSink<T,S> nodeDataSource) |
B |
withPort(int port) |
B |
withSerializer(S serializer) |
B |
withServiceName(String serviceName) |
B |
withStaleUpdateThresholdMs(int staleUpdateThresholdMs) |
B |
withStartSignalHandler(Consumer<Void> startSignalHandler) |
B |
withStartSignalHandlers(List<Consumer<Void>> startSignalHandlers) |
B |
withStopSignalHandler(Consumer<Void> stopSignalHandler) |
B |
withStopSignalHandlers(List<Consumer<Void>> stopSignalHandlers) |
protected String namespace
protected String serviceName
protected S extends Serializer<T> serializer
protected String hostname
protected int port
protected T nodeData
protected int healthUpdateIntervalMs
protected int staleUpdateThresholdMs
protected NodeDataSink<T,S extends Serializer<T>> nodeDataSource
protected List<Healthcheck> healthchecks
protected final List<Signal<HealthcheckResult>> additionalRefreshSignals
public B withPort(int port)
public B withHealthcheck(Healthcheck healthcheck)
public B withHealthUpdateIntervalMs(int healthUpdateIntervalMs)
public B withStaleUpdateThresholdMs(int staleUpdateThresholdMs)
public B withIsolatedHealthMonitor(IsolatedHealthMonitor monitor)
IsolatedHealthMonitor which will later be
scheduled at regular intervals and monitored to generate and maintain an aggregated health of the service
the scheduling will happen in an isolated threadmonitor - an implementation of the IsolatedHealthMonitorpublic B withNodeDataSource(NodeDataSink<T,S> nodeDataSource)
public B withAdditionalRefreshSignal(Signal<HealthcheckResult> additionalRefreshSignal)
public B withAdditionalRefreshSignals(List<Signal<HealthcheckResult>> additionalRefreshSignals)
protected final ServiceProvider<T,S> buildProvider()
public abstract ServiceProvider<T,S> build()
protected abstract NodeDataSink<T,S> dataSink(Service service)
Copyright © 2015–2022. All rights reserved.