See also https://bugs.openjdk.org/browse/JDK-8296244

--Sean

On 6/16/23 1:48 AM, Alan Bateman wrote:
On 16/06/2023 03:48, Peter Firmstone wrote:
:

As it isn't yet clear how a Subject context will be preserved across
threads in future version of OpenJDK, (currently we use the
AccessControlContext for that), for example we capture the existing
context, to establish TLS connections in call back communications for
network event listeners.


It's good to think about a Subject.current/callAs re-implemented to use
ScopedValue [1], currently in preview with JEP 446 in Java 21.
ScopedValue allows for sharing in structured concurrency contexts.

-Alan

[1]
https://download.java.net/java/early_access/jdk21/docs/api/java.base/java/lang/ScopedValue.html
[2] https://openjdk.org/jeps/446

Reply via email to