File watcher and infrastructure to support dynamically updating configurations.
There are three core components of this package:
WatchServiceListenerprovides a reactive interface to listen to filesystem changes
ConfigurationReferencescan either be manually updated, or attached to a watch service, and hold a loader plus a loaded node, to pass around a reference to a root node while allowing for reloads.
Value referencescan be retrieved from configuration references, and provide an always up-to-date reference to a deserialized value within a configuration node
These components are designed to work together, but the watch listener can be used independently from the other components for any situation where file watching is necessary.
Interface Summary Interface Description ConfigurationReference<N extends ConfigurationNode>An updating reference to a base configuration node. ValueReference<T,N extends ConfigurationNode>A pointer to a node within a configuration tree.
Class Summary Class Description WatchServiceListenerA wrapper around NIO's
WatchServicethat uses the provided watch key to poll for changes, and calls listeners once an event occurs.
WatchServiceListener.BuilderSet the parameters needed to create a
Enum Summary Enum Description ConfigurationReference.ErrorPhaseRepresenting the phase where an error occurred.