Interface TransmittableThreadLocal.Transmitter.Transmittee<C,B>

Type Parameters:
C - the transmittee capture data type
B - the transmittee backup data type
Enclosing class:
TransmittableThreadLocal.Transmitter

public static interface TransmittableThreadLocal.Transmitter.Transmittee<C,B>
The transmittee is the extension point for other ThreadLocals which are registered by registerTransmittee method. Transmittance is completed by methods capture() => replay(Object) => restore(Object) (aka CRR operations),
Since:
2.14.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Capture.
    Clear.
    replay(C captured)
    Replay.
    void
    restore(B backup)
    Restore.
  • Method Details

    • capture

      @NonNull C capture()
      Capture.

      NOTE:

      • do NOT return null.
      • do NOT throw any exceptions, just ignored.
      Returns:
      the capture data of transmittee
      Since:
      2.14.0
    • replay

      @NonNull B replay(@NonNull C captured)
      Replay.

      NOTE:

      • do NOT return null.
      • do NOT throw any exceptions, just ignored.
      Parameters:
      captured - the capture data of transmittee, the return value of method capture()
      Returns:
      the backup data of transmittee
      Since:
      2.14.0
    • clear

      @NonNull B clear()
      Clear.

      NOTE:

      • do NOT return null.
      • do NOT throw any exceptions, just ignored.

      Semantically, the code `B backup = clear();` is same as `B backup = replay(EMPTY_CAPTURE);`.

      The reason for providing this method is:

      1. lead to more readable code
      2. need not provide the constant EMPTY_CAPTURE.
      Returns:
      the backup data of transmittee
      Since:
      2.14.0
    • restore

      void restore(@NonNull B backup)
      Restore.

      NOTE:
      do NOT throw any exceptions, just ignored.

      Parameters:
      backup - the backup data of transmittee, the return value of methods replay(Object) or clear()
      Since:
      2.14.0
      See Also: