@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
Package ninja.leaping.configurate.reference
File watcher and infrastructure to support dynamically updating configurations
There are three core components of this package:
- The
WatchServiceListener
provides a reactive interface to listen to filesystem changes ConfigurationReferences
can 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 references
can 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 nodeValueReference<T> A pointer to a node within a configuration tree. -
Class Summary Class Description WatchServiceListener A wrapper around NIO'sWatchService
that uses the provided event loop to poll for changes, and calls listeners once an event occurs.WatchServiceListener.Builder Set the parameters needed to create aWatchServiceListener
. -
Enum Summary Enum Description ConfigurationReference.ErrorPhase Representing the phase where an error occurred