docs: improve lockable object

This commit is contained in:
Ilkka Seppälä
2024-05-06 19:36:56 +03:00
parent 30cb9af12b
commit 92ae818fe2
10 changed files with 116 additions and 241 deletions
@@ -42,8 +42,8 @@ import lombok.extern.slf4j.Slf4j;
* the request.
*
* <p>In this example, we create a new Lockable object with the SwordOfAragorn implementation of it.
* Afterwards we create 6 Creatures with the Elf, Orc and Human implementations and assign them each
* to a Fiend object and the Sword is the target object. Because there is only one Sword and it uses
* Afterward we create 6 Creatures with the Elf, Orc and Human implementations and assign them each
* to a Fiend object and the Sword is the target object. Because there is only one Sword, and it uses
* the Lockable Object pattern, only one creature can hold the sword at a given time. When the sword
* is locked, any other alive Fiends will try to lock, which will result in a race to lock the
* sword.