andi-huber commented on code in PR #3464:
URL: https://github.com/apache/causeway/pull/3464#discussion_r3005105819


##########
api/applib/src/main/java/org/apache/causeway/applib/services/iactnlayer/InteractionLayer.java:
##########
@@ -18,36 +18,71 @@
  */
 package org.apache.causeway.applib.services.iactnlayer;
 
+import org.jspecify.annotations.Nullable;
+
 import org.apache.causeway.applib.services.iactn.Interaction;
+import org.apache.causeway.commons.functional.Try;
 
 /**
  * Binds an {@link Interaction} ("what" is being executed) with
  * an {@link InteractionContext} ("who" is executing, 
"when" and "where").
  *
- * <p>
- * {@link InteractionLayer}s are so called because they may be nested (held in 
a stack).  For example the
+ * <p> {@link InteractionLayer}s are so called because they may be nested 
(held in a stack).  For example the
  * {@link org.apache.causeway.applib.services.sudo.SudoService} creates a new 
temporary layer with a different
  * {@link InteractionContext#getUser() user}, while fixtures that mock the 
clock switch out the
  * {@link InteractionContext#getClock() clock}.
- * </p>
  *
- * <p>
- * The stack of layers is per-thread, managed by {@link InteractionService} as 
a thread-local).
- * </p>
+ * <p> The stack of layers is per-thread, managed by {@link 
InteractionService} as a thread-local).
  *
  * @since 2.0 {@index}
  */
 public record InteractionLayer(
+        @Nullable InteractionLayer parent,
         /**
-         * Current thread's {@link Interaction} : &quot;what&quot; is being 
executed
+         * Current thread's {@link Interaction} : WHAT is being executed
          */
         Interaction interaction,
 
         /**
-         * &quot;who&quot; is performing this {@link #getInteraction()}, also
-         * &quot;when&quot; and &quot;where&quot;.
+         * WHO is performing this {@link #getInteraction()}, also
+         * WHEN and WHERE.
+         */
+        InteractionContext interactionContext,
+        /**
+         * @since 4.0
          */
-        InteractionContext interactionContext
-        ) {
+        Runnable onCloseCallback) implements AutoCloseable {

Review Comment:
   I don't like that as the final answer, because we don't really know how to 
handle potential exceptions of the runnable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to