Three verified programs (JDK 25, Spring Security 7.1.1, Spring Boot 4.1.1 dependency versions) backing the ankurm.com post: InheritableThreadLocal across thread models, @Async on a virtual-thread SimpleAsyncTaskExecutor (DelegatingSecurityContextExecutor vs ContextPropagatingTaskDecorator), and StructuredTaskScope.fork() propagation. Captured console output and docs chapters included.
20 lines
725 B
Bash
Executable File
20 lines
725 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Compiles and runs all three demos, regenerating docs/output/*.txt.
|
|
# Requires JDK 25 (StructuredTaskScope is a preview API through JDK 25/JEP 505).
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
mvn -q dependency:build-classpath -Dmdep.outputFile=cp.txt
|
|
CP=$(cat cp.txt)
|
|
|
|
rm -rf target/classes
|
|
mkdir -p target/classes docs/output
|
|
javac --release 25 --enable-preview -cp "$CP" -d target/classes $(find src -name '*.java')
|
|
|
|
for demo in Demo1PlainThreadLocal Demo2AsyncVirtualThreads Demo3StructuredConcurrency; do
|
|
num=$(echo "$demo" | grep -o '[0-9]')
|
|
out="docs/output/demo${num}.txt"
|
|
echo "Running $demo -> $out"
|
|
java --enable-preview -cp "target/classes:$CP" "com.ankurm.vt.$demo" | tee "$out"
|
|
done
|