public interface AsyncProcessorAwaitManager extends StaticService
Exchange
s are being handed over from one thread to another, while
the callee thread is blocked waiting for the other threads to complete, before it can continue.
This manager offers insight into the state, and allow to force stuck exchanges to be continued and for blocked threads
to be unblocked, which may happen in case of severe malfunctions (such as the system runs out of memory, a 3rd party
never responding, or a timeout not triggering, etc).Modifier and Type | Interface and Description |
---|---|
static interface |
AsyncProcessorAwaitManager.AwaitThread
Information about the thread and exchange that are inflight.
|
static interface |
AsyncProcessorAwaitManager.Statistics
Utilization statistics of the this manager.
|
Modifier and Type | Method and Description |
---|---|
void |
await(Exchange exchange,
CountDownLatch latch)
Registers the exchange to await for the callback to be triggered by another thread which has taken over processing
this exchange.
|
Collection<AsyncProcessorAwaitManager.AwaitThread> |
browse()
A read-only browser of the
AsyncProcessorAwaitManager.AwaitThread s that are currently inflight. |
void |
countDown(Exchange exchange,
CountDownLatch latch)
Triggered when the other thread is done processing the exchange, to signal to the waiting thread is done, and can take
over control to further process the exchange.
|
AsyncProcessorAwaitManager.Statistics |
getStatistics()
Gets the utilization statistics of this manager
|
void |
interrupt(Exchange exchange)
To interrupt an exchange which may seem as stuck, to force the exchange to continue,
allowing any blocking thread to be released.
|
void |
interrupt(String exchangeId)
To interrupt an exchange which may seem as stuck, to force the exchange to continue,
allowing any blocking thread to be released.
|
boolean |
isInterruptThreadsWhileStopping()
Whether to interrupt any blocking threads during stopping.
|
void |
setInterruptThreadsWhileStopping(boolean interruptThreadsWhileStopping)
Sets whether to interrupt any blocking threads during stopping.
|
int |
size()
Number of threads that are blocked waiting for other threads to trigger the callback when they are done processing
the exchange.
|
void await(Exchange exchange, CountDownLatch latch)
exchange
- the exchangelatch
- the latch used to wait for other thread to signal when its donevoid countDown(Exchange exchange, CountDownLatch latch)
exchange
- the exchangelatch
- the latch used to wait for other thread to signal when its doneint size()
Collection<AsyncProcessorAwaitManager.AwaitThread> browse()
AsyncProcessorAwaitManager.AwaitThread
s that are currently inflight.void interrupt(String exchangeId)
exchangeId
- the exchange id to interrupt.void interrupt(Exchange exchange)
exchange
- the exchange to interrupt.boolean isInterruptThreadsWhileStopping()
void setInterruptThreadsWhileStopping(boolean interruptThreadsWhileStopping)
AsyncProcessorAwaitManager.Statistics getStatistics()
Apache Camel