Package com.alibaba.ttl
Interface TransmittableThreadLocal.Transmitter.Transmittee<C,B>
- Type Parameters:
C
- the transmittee capture data typeB
- 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
ThreadLocal
s
which are registered by registerTransmittee
method.
Transmittance is completed by methods capture()
=>
replay(Object)
=> restore(Object)
(aka CRR
operations),-
Method Summary
-
Method Details
-
capture
Capture.NOTE:
- do NOT return
null
. - do NOT throw any exceptions, just ignored.
- Returns:
- the capture data of transmittee
- Since:
- 2.14.0
- do NOT return
-
replay
Replay.NOTE:
- do NOT return
null
. - do NOT throw any exceptions, just ignored.
- Parameters:
captured
- the capture data of transmittee, the return value of methodcapture()
- Returns:
- the backup data of transmittee
- Since:
- 2.14.0
- do NOT return
-
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:
- lead to more readable code
- need not provide the constant
EMPTY_CAPTURE
.
- Returns:
- the backup data of transmittee
- Since:
- 2.14.0
- do NOT return
-
restore
Restore.NOTE:
do NOT throw any exceptions, just ignored.- Parameters:
backup
- the backup data of transmittee, the return value of methodsreplay(Object)
orclear()
- Since:
- 2.14.0
- See Also:
-