The JSON object described by this file represents the root directory. If an entry does not start with a slash, it represents the key of a key value pair. If it does starts with a slash, the value is another JSON object that describes the respective subdirectory.
The component reads the initial values from
to the constructor. During application bootstrap, it
Start event using a handler with priority
999999. When receiving this event, it fires all known preferences
values on the channels of the start event as a
InitialPreferences event, using a new
and waiting for its completion. Then, allows the intercepted
Start event to continue.
Components that depend on configuration values define handlers
ConfigurationUpdate events and adapt themselves to the values
received. Note that due to the intercepted
Start event, the initial
preferences values are received before the
Start event, so
components’ configurations can be rearranged before they actually
start doing something.
Besides initially publishing the stored preferences values,
the component also listens for
on its channel and updates the JSON file (may be suppressed).
Nested Class Summary
Constructor SummaryConstructorDescriptionCreates a new component with its channel set to the given channel and the given file.Creates a new component with its channel set to the given channel and the given file.Creates a new component with its channel set to the given channel and the given file.
Methods inherited from class org.jgrapes.util.NightConfigStore
isNode, onConfigurationUpdate, onFileChanged, onStart, structured
Methods inherited from class org.jgrapes.util.ConfigurationStore
as, asBoolean, asInstant, asNumber, asString, flatten, mergeValue, structure, structure, values
Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setName
Methods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGenerator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
JsonConfigurationStoreCreates a new component with its channel set to the given channel and the given file.
(Channel componentChannel, File file, boolean update) throws IOExceptionCreates a new component with its channel set to the given channel and the given file.
The component handles
FileChangedevents for the configuration file (see
(Channel componentChannel, File file, boolean update, boolean watch) throws IOExceptionCreates a new component with its channel set to the given channel and the given file.
true, the configuration file is updated when
ConfigurationUpdateevents are received.
FileChangedevents are processed and the configuration file is reloaded when it changes. Note that the generation of the
FileChangedevents must be configured independently (see