Class ScopedValuesPreviewNotes
java.lang.Object
net.jrodolfo.java_evolution.java21.scoped_values.ScopedValuesPreviewNotes
Explains scoped values as a Java 21 first preview feature.
Contextual data such as request IDs, tenant IDs, trace IDs, or security
context is often needed several calls below the method that first received
it. Passing that value through every method can make signatures noisy, while
ThreadLocal can introduce mutable state, cleanup burden, and stale
context risks.
Java 21 previewed scoped values as a safer model for immutable contextual data with a bounded lifetime. This package documents the first-preview step and points to the Java 25 module for final runnable code.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDescribes the Java 21 maturity level.nextStep()Points learners to the final Java 25 module.Explains the preview idea.Explains the contextual-data problem.Explains the common older approach and its risks.
-
Constructor Details
-
ScopedValuesPreviewNotes
public ScopedValuesPreviewNotes()
-
-
Method Details
-
problemSolved
-
threadLocalProblem
Explains the common older approach and its risks.- Returns:
- a short explanation
-
previewIdea
-
firstPreviewStatus
Describes the Java 21 maturity level.- Returns:
- a short status note
-
nextStep
Points learners to the final Java 25 module.- Returns:
- a short next-step note
-