Class StructuredConcurrencySixthPreviewExamples
java.lang.Object
net.jrodolfo.java_evolution.java26.structured_concurrency.StructuredConcurrencySixthPreviewExamples
Demonstrates the sixth preview of Structured Concurrency from JEP 525.
The preview API is exercised in an isolated child JVM. The generated probe uses structured scopes for deterministic success and failure workflows, keeping preview flags out of the main Maven build.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult from one child process invocation.static final recordResult from compiling and running the generated preview source. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionidea()Explains the structured-concurrency idea.Explains why the preview API runs in a child process.Source used by the child JVM to exercise the preview API.problem()Explains the concurrency problem.runStructuredConcurrencyWorkflow(Path workspace) Runs the Java 26 preview Structured Concurrency workflow.status()Describes the Java 26 maturity level.
-
Constructor Details
-
StructuredConcurrencySixthPreviewExamples
public StructuredConcurrencySixthPreviewExamples()
-
-
Method Details
-
runStructuredConcurrencyWorkflow
public StructuredConcurrencySixthPreviewExamples.StructuredConcurrencyWorkflowResult runStructuredConcurrencyWorkflow(Path workspace) throws IOException, InterruptedException Runs the Java 26 preview Structured Concurrency workflow.- Parameters:
workspace- temporary directory for generated source and classes- Returns:
- result containing compilation and execution output
- Throws:
IOException- when the source file cannot be writtenInterruptedException- when waiting for a child process is interrupted
-
probeSource
Source used by the child JVM to exercise the preview API.- Returns:
- generated Java source
-
problem
-
idea
-
status
-
previewBoundary
Explains why the preview API runs in a child process.- Returns:
- the preview boundary
-