Interface ConfigBinding<T>
- Type Parameters:
T- immutable configuration value type
- All Superinterfaces:
AutoCloseable, Supplier<T>
Stable typed configuration provider. Close detaches its registration without closing its values.
Implementations are thread-safe; use snapshot when value and version must be read together.
-
Method Summary
-
Method Details
-
snapshot
ConfigBindingSnapshot<T> snapshot()Reads value and version atomically.- Returns:
- one immutable value/version pair
- Throws:
IllegalStateException- if this binding or its owner has closed
-
get
Returns the value from one atomic snapshot.- Specified by:
getin interfaceSupplier<T>- Returns:
- current value, possibly null for an absent optional scalar
- Throws:
IllegalStateException- if closed
-
close
void close()Detaches this registration idempotently; subsequent reads fail.- Specified by:
closein interfaceAutoCloseable
-