@Component public class PassingTimeStrategy extends Object implements InvocationTimeoutStrategy
based on time synchronization
any time to calculate timeout: now - start time of invocation chain
consumer: c
producer: p
---------------------------------------------------------------
| process 2 |
| c-send(T5) c-send(T8) |
| ↑ ↑ |
| p-start(T3) → c-start(T4) → p-operation(T6) → c-start(T7)|
-----↑--------------------------------------------------------
↑
-----↑-----------------
| ↑ process 1 |
| c-send(T2) |
| ↑ |
| c-start(T1) |
------------------------
T2 timeout: T2 - T1
T3 timeout: T3 - T1
T4 timeout: T4 - T1
......
| Modifier and Type | Field and Description |
|---|---|
static String |
CHAIN_START_TIME |
static String |
NAME |
CHAIN_ALREADY_TIMED_OUT| Constructor and Description |
|---|
PassingTimeStrategy() |
| Modifier and Type | Method and Description |
|---|---|
long |
calculateElapsedNanoTime(Invocation invocation) |
String |
name() |
PassingTimeStrategy |
setClock(Clock clock) |
void |
start(Invocation invocation) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitalreadyTimeout, beforeSendRequest, checkTimeout, finishBusinessMethod, startBusinessMethod, startHandlers, startRunInExecutorpublic static final String NAME
public static final String CHAIN_START_TIME
public PassingTimeStrategy setClock(Clock clock)
public String name()
name in interface InvocationTimeoutStrategypublic void start(Invocation invocation)
start in interface InvocationTimeoutStrategypublic long calculateElapsedNanoTime(Invocation invocation)
calculateElapsedNanoTime in interface InvocationTimeoutStrategyCopyright © 2017–2022 The Apache Software Foundation. All rights reserved.