InteractionLayer (record)
Binds an Interaction ("what" is being executed) with an InteractionContext ("who" is executing, "when" and "where").
InteractionLayer s are so called because they may be nested (held in a stack). For example the org.apache.causeway.applib.services.sudo.SudoService creates a new temporary layer with a different InteractionContext#getUser() user , while fixtures that mock the clock switch out the InteractionContext#getClock() clock .
The stack of layers is per-thread, managed by InteractionService as a thread-local).
API
InteractionLayer.java
record InteractionLayer {
Interaction getInteraction() (1)
InteractionContext getInteractionContext() (2)
}
1 | getInteraction()
|
||
2 | getInteractionContext()
|