@@ -854,14 +854,27 @@ to provide their functionality.
854854
855855Usually, an extension is instantiated only once. So the question becomes relevant: How do
856856you keep the state from one invocation of an extension to the next? The
857- `ExtensionContext` API provides a `Store` exactly for this purpose. Extensions may put
858- values into a store for later retrieval. See the
859- `<<extensions-lifecycle-callbacks-timing-extension, TimingExtension>>` for an example of
860- using the `Store` with a method-level scope. It is important to remember that values
861- stored in an `ExtensionContext` during test execution will not be available in the
862- surrounding `ExtensionContext`. Since `ExtensionContexts` may be nested, the scope of
863- inner contexts may also be limited. Consult the corresponding Javadoc for details on the
864- methods available for storing and retrieving values via the `{ExtensionContext_Store}`.
857+ `{ExtensionContext}` API provides a `{ExtensionContext_Store}` exactly for this purpose.
858+ Extensions may put values into a store for later retrieval.
859+
860+ TIP: See the `<<extensions-lifecycle-callbacks-timing-extension, TimingExtension>>` for an
861+ example of using the `Store` with a method-level scope.
862+
863+ .The `ExtensionContext` and `Store` hierarchy
864+ image::extensions_StoreHierarchy.svg[alt=UML diagram,role=text-center]
865+
866+ As illustrated by the diagram above, stores are hierarchical in nature. When looking up a
867+ value, if no value is stored in the current `ExtensionContext` for the supplied key, the
868+ stores of the context's ancestors will be queried for a value with the same key in the
869+ `Namespace` used to create this store. The root `ExtensionContext` represents the engine
870+ level so its `Store` may be used to store or cache values that are used by multiple test
871+ classes or extension. The `{ExtensionContext_StoreScope}` enum allows to go beyond even
872+ that and access the stores on the level of the current `{LauncherExecutionRequest}` or
873+ `{LauncherSession}` which can be used to share data across test engines or inject data
874+ from a registered
875+ <<launcher-api-launcher-session-listeners-custom, `LauncherSessionListener`>>,
876+ respectively. Please consult the Javadoc of `{ExtensionContext}`,
877+ `{ExtensionContext_Store}`, and `{ExtensionContext_StoreScope}` for details.
865878
866879[[extensions-keeping-state-autocloseable-support]]
867880[NOTE]
0 commit comments