public class DefaultAsyncProcessorAwaitManager extends ServiceSupport implements AsyncProcessorAwaitManager
AsyncProcessorAwaitManager.AwaitThread, AsyncProcessorAwaitManager.Statisticsshutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
DefaultAsyncProcessorAwaitManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
await(Exchange exchange,
java.util.concurrent.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.AwaitThreads that are currently inflight. |
void |
countDown(Exchange exchange,
java.util.concurrent.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.
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
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.
|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspendpublic void await(Exchange exchange, java.util.concurrent.CountDownLatch latch)
AsyncProcessorAwaitManagerawait in interface AsyncProcessorAwaitManagerexchange - the exchangelatch - the latch used to wait for other thread to signal when its donepublic void countDown(Exchange exchange, java.util.concurrent.CountDownLatch latch)
AsyncProcessorAwaitManagercountDown in interface AsyncProcessorAwaitManagerexchange - the exchangelatch - the latch used to wait for other thread to signal when its donepublic int size()
AsyncProcessorAwaitManagersize in interface AsyncProcessorAwaitManagerpublic Collection<AsyncProcessorAwaitManager.AwaitThread> browse()
AsyncProcessorAwaitManagerAsyncProcessorAwaitManager.AwaitThreads that are currently inflight.browse in interface AsyncProcessorAwaitManagerpublic void interrupt(String exchangeId)
AsyncProcessorAwaitManagerinterrupt in interface AsyncProcessorAwaitManagerexchangeId - the exchange id to interrupt.public void interrupt(Exchange exchange)
AsyncProcessorAwaitManagerinterrupt in interface AsyncProcessorAwaitManagerexchange - the exchange to interrupt.public boolean isInterruptThreadsWhileStopping()
AsyncProcessorAwaitManagerisInterruptThreadsWhileStopping in interface AsyncProcessorAwaitManagerpublic void setInterruptThreadsWhileStopping(boolean interruptThreadsWhileStopping)
AsyncProcessorAwaitManagersetInterruptThreadsWhileStopping in interface AsyncProcessorAwaitManagerpublic AsyncProcessorAwaitManager.Statistics getStatistics()
AsyncProcessorAwaitManagergetStatistics in interface AsyncProcessorAwaitManagerprotected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void doStop()
throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class ServiceSupportExceptionServiceSupport.doStart()Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.