File tree Expand file tree Collapse file tree
modules/commons/src/main/java/org/apache/ignite/internal/thread/context Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818package org .apache .ignite .internal .thread .context ;
1919
2020/**
21- * Represents an arbitrary Scope. A Scope is active from the moment it is created until the {@link #close()} method is
22- * called on the {@link Scope} instance. It is strongly encouraged to use a try-with-resources block to close a Scope.
21+ * Represents the Scope of {@link OperationContext} attributes update. Explicitly calling {@link #close()} method undoes
22+ * the applied changes and restores previous attribute values, if any. Note that every Scope relating to a specific
23+ * {@link OperationContext} update must be closed to free up thread-bound resources and avoid memory leaks, so it is
24+ * highly encouraged to use a try-with-resource block with Scope instances.
25+ * <p>
26+ * Scope is result of the following {@link OperationContext} update operations:
27+ * <ul>
28+ * <li>{@link OperationContext#set(OperationContextAttribute, Object)} - creates a new or update an existing mapping
29+ * between specified {@link OperationContextAttribute} and its value</li>
30+ * <li>{@link OperationContext#restoreSnapshot(OperationContextSnapshot)} - updates {@link OperationContextAttribute}
31+ * values to match the values stored in {@link OperationContextSnapshot}</li>
32+ * </ul>
33+ * </p>
34+ *
35+ * @see OperationContext#set(OperationContextAttribute, Object)
36+ * @see OperationContext#restoreSnapshot(OperationContextSnapshot)
2337 */
2438public interface Scope extends AutoCloseable {
2539 /** Scope instance that does nothing when closed. */
You can’t perform that action at this time.
0 commit comments