Package org.apache.camel.impl.engine
Class DefaultAsyncProcessorAwaitManager
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.AsyncProcessorAwaitManager
,org.apache.camel.StatefulService
,org.apache.camel.StaticService
,org.apache.camel.SuspendableService
public class DefaultAsyncProcessorAwaitManager extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.AsyncProcessorAwaitManager, org.apache.camel.StaticService
-
-
Constructor Summary
Constructors Constructor Description DefaultAsyncProcessorAwaitManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
await(org.apache.camel.Exchange exchange, CountDownLatch latch)
Collection<org.apache.camel.spi.AsyncProcessorAwaitManager.AwaitThread>
browse()
void
countDown(org.apache.camel.Exchange exchange, CountDownLatch latch)
protected void
doStop()
org.apache.camel.spi.AsyncProcessorAwaitManager.Statistics
getStatistics()
void
interrupt(String exchangeId)
void
interrupt(org.apache.camel.Exchange exchange)
boolean
isInterruptThreadsWhileStopping()
void
process(org.apache.camel.AsyncProcessor processor, org.apache.camel.Exchange exchange)
Calls the async version of the processor's process method and waits for it to complete before returning.void
setInterruptThreadsWhileStopping(boolean interruptThreadsWhileStopping)
int
size()
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
process
public void process(org.apache.camel.AsyncProcessor processor, org.apache.camel.Exchange exchange)
Calls the async version of the processor's process method and waits for it to complete before returning. This can be used byAsyncProcessor
objects to implement their sync version of the process method. Important: This method is discouraged to be used, as its better to invoke the asynchronousAsyncProcessor.process(org.apache.camel.Exchange, org.apache.camel.AsyncCallback)
method, whenever possible.- Specified by:
process
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
- Parameters:
processor
- the processorexchange
- the exchange
-
await
public void await(org.apache.camel.Exchange exchange, CountDownLatch latch)
-
countDown
public void countDown(org.apache.camel.Exchange exchange, CountDownLatch latch)
-
size
public int size()
- Specified by:
size
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
browse
public Collection<org.apache.camel.spi.AsyncProcessorAwaitManager.AwaitThread> browse()
- Specified by:
browse
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
interrupt
public void interrupt(String exchangeId)
- Specified by:
interrupt
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
interrupt
public void interrupt(org.apache.camel.Exchange exchange)
- Specified by:
interrupt
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
isInterruptThreadsWhileStopping
public boolean isInterruptThreadsWhileStopping()
- Specified by:
isInterruptThreadsWhileStopping
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
setInterruptThreadsWhileStopping
public void setInterruptThreadsWhileStopping(boolean interruptThreadsWhileStopping)
- Specified by:
setInterruptThreadsWhileStopping
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
getStatistics
public org.apache.camel.spi.AsyncProcessorAwaitManager.Statistics getStatistics()
- Specified by:
getStatistics
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
-