Package io.helidon.config.spi
Class AbstractConfigSource<S>
- java.lang.Object
-
- io.helidon.config.spi.AbstractSource<ConfigNode.ObjectNode,S>
-
- io.helidon.config.spi.AbstractConfigSource<S>
-
- Type Parameters:
S
- a type of data stamp
- All Implemented Interfaces:
Changeable<ConfigNode.ObjectNode>
,ConfigSource
,Source<ConfigNode.ObjectNode>
,AutoCloseable
,Supplier<ConfigSource>
- Direct Known Subclasses:
AbstractParsableConfigSource
public abstract class AbstractConfigSource<S> extends AbstractSource<ConfigNode.ObjectNode,S> implements ConfigSource
Base abstract implementation ofConfigSource
, suitable for concrete implementations to extend.- See Also:
AbstractConfigSource.Builder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractConfigSource.Builder<B extends AbstractConfigSource.Builder<B,T>,T>
A commonConfigSource
builder ready to be extended by builder implementation related toConfigSource
extensions.-
Nested classes/interfaces inherited from class io.helidon.config.spi.AbstractSource
AbstractSource.Data<D,S>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractConfigSource(AbstractConfigSource.Builder<?,?> builder)
Initializes config source from builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Flow.Publisher<Optional<ConfigNode.ObjectNode>>
changes()
Returns aFlow.Publisher
to which the caller can subscribe in order to receive change notifications.protected ConfigContext
configContext()
Config context associated with this source.void
init(ConfigContext context)
Initialize the config source with aConfigContext
.protected AbstractSource.Data<ConfigNode.ObjectNode,S>
processLoadedData(AbstractSource.Data<ConfigNode.ObjectNode,S> data)
Performs any postprocessing of config data after loading.-
Methods inherited from class io.helidon.config.spi.AbstractSource
dataStamp, description, fireChangeEvent, isMandatory, load, loadData, uid
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.config.spi.ConfigSource
get
-
Methods inherited from interface io.helidon.config.spi.Source
close, description, load
-
-
-
-
Constructor Detail
-
AbstractConfigSource
protected AbstractConfigSource(AbstractConfigSource.Builder<?,?> builder)
Initializes config source from builder.- Parameters:
builder
- builder to be initialized from
-
-
Method Detail
-
init
public final void init(ConfigContext context)
Description copied from interface:ConfigSource
Initialize the config source with aConfigContext
.The method is executed during
Config
bootstrapping byConfig.Builder
.- Specified by:
init
in interfaceConfigSource
- Parameters:
context
- a config context
-
configContext
protected ConfigContext configContext()
Config context associated with this source.- Returns:
- config context
-
processLoadedData
protected AbstractSource.Data<ConfigNode.ObjectNode,S> processLoadedData(AbstractSource.Data<ConfigNode.ObjectNode,S> data)
Description copied from class:AbstractSource
Performs any postprocessing of config data after loading. By default, the method simply returns the provided inputData
.- Overrides:
processLoadedData
in classAbstractSource<ConfigNode.ObjectNode,S>
- Parameters:
data
- an input data- Returns:
- a post-processed data
-
changes
public final Flow.Publisher<Optional<ConfigNode.ObjectNode>> changes()
Returns aFlow.Publisher
to which the caller can subscribe in order to receive change notifications.Method
Flow.Subscriber.onError(Throwable)
is called in case of error listening on config source data. MethodFlow.Subscriber.onComplete()
is never called.All subscribers are notified using specified
executor
.
-
-