T - a type of sourcejava.lang.AutoCloseable, Changeable<T>ConfigSource, OverrideSourceAbstractConfigSource, AbstractOverrideSource, AbstractParsableConfigSource, AbstractSourcepublic interface Source<T> extends Changeable<T>, java.lang.AutoCloseable
<T> of data.| Modifier and Type | Method | Description |
|---|---|---|
default Flow.Publisher<java.util.Optional<T>> |
changes() |
Deprecated.
|
default void |
close() |
Closes the @{code Source}, releasing any resources it holds.
|
default java.lang.String |
description() |
Short, human-readable summary referring to the underlying source.
|
java.util.Optional<T> |
load() |
Loads the underlying source data, converting it into an
Optional
around the parameterized type T. |
default java.lang.String description()
For example, a file path or a URL or any other information that helps the
user recognize the underlying origin of the data this Source
provides.
Default is the implementation class simple name with any "Source"
suffix removed.
java.util.Optional<T> load() throws ConfigException
Optional
around the parameterized type T.
Implementations should return Optional.empty() if the underlying
origin does not exist.
The method can be invoked repeatedly, for example during retries.
Optional<T> referring to an instance of T as read
from the underlying origin of the data (if it exists) or
Optional.empty() otherwiseConfigException - in case of errors loading from the underlying
origin@Deprecated default Flow.Publisher<java.util.Optional<T>> changes()
ChangeableFlow.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.
Method Flow.Subscriber.onComplete() is never called.
changes in interface Changeable<T>nulldefault void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exception - in case of errors encountered while closing the sourceCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.