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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.camel.spi.AsyncProcessorAwaitManager
org.apache.camel.spi.AsyncProcessorAwaitManager.AwaitThread, org.apache.camel.spi.AsyncProcessorAwaitManager.Statistics
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
void
void
interrupt
(org.apache.camel.Exchange exchange) boolean
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
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
DefaultAsyncProcessorAwaitManager
public DefaultAsyncProcessorAwaitManager()
-
-
Method Details
-
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
-
countDown
-
size
public int size()- Specified by:
size
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
browse
- Specified by:
browse
in interfaceorg.apache.camel.spi.AsyncProcessorAwaitManager
-
interrupt
- 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
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-